Linux KVM/Qemu Virt-Customize Tutorial – POFTUT

Linux KVM/Qemu Virt-Customize Tutorial

I am gonna show you today a practical and useful tool for managing Linux virtual machines and disks. Whit virtualization people start to use a lot of vms in their personal or corporate pc’s. But managing them is difficult. I faced with these difficulties too. So I search for a tool helps me especially in updates. I came with virt-customize which is a tool in libguestfs-tools package. Here we start.

Load Image

Update existing disk image Virt-customize opens the disk and then look for last update seed and then try to run update commands which are used this distro. Windows image are not supported yet but you can use run command to update windows images. Here you can you URI for remote disk images. The disk format is automatically detected.

Mount ISO to Image

To attach a iso file use attach option. If you want to attach them to specific directories run mount scripts which we will look later

Connect Libvirt or Hypervisor

To connect and hypervisor and run virt-customize there use -c option with hypervisor uri which is here local libvirtd and give domain name or uuid with -d option.

Run Update Test Mode

To run update in test mode or readonly mode use -n or –dry-run option

LEARN MORE  Virt Install Tool For Virtualization With KVM and Qemu For Linux

Set RAM/Memory

You can specify memory usage with -m or –memory option. Default memory size can be seen with guesfish get-memsize

Start Without Network

Network connection can be controlled with –network or –no-network options.

Verbose or Debug Mode

To see verbose output which is very detailed use –verbose or -v

Delete File

To delete files and folders on the disk image use –delete customization options

LEARN MORE  Qemu Tutorial

Set Host name

You can set host name with –hostname option

Install Packages

To install packages use –install option use , to specify more than one package

Create Directory

To create directories on file system use –mkdir option. There is no border it acts like root you can create whatever you want

Run Command

Up to now we call options related to standard Linux commands also we can run commands inside disk image with –run-command option.

Run Script

If we want to run script we can use –run command with script path

LEARN MORE  Linux KVM Libvirt Tutorial

Upload File To The Image

To upload files to the disk image use –upload option

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)