Installing guest tools in existing virtual machines

The steps you need to perform to install the guest tools in existing VMs depend on the guest OS type. They are described in the following subsections.

Installing guest tools in existing Linux virtual machines

To install the guest tools in an existing Linux virtual machine, do the following:

  1. Create a volume from the uploaded guest tools image. For example:

    # vinfra service compute volume create vz-guest-tools-lin-vol \
    --storage-policy default --size 1 --image vz-guest-tools-lin
    
  2. Attach the guest tools volume to the virtual machine. For example:

    # vinfra service compute server volume attach \
    --server centos vz-guest-tools-lin-vol
    +--------+--------------------------------------+
    | Field  | Value                                |
    +--------+--------------------------------------+
    | device | /dev/sr1                             |
    | id     | 1a40012a-7976-47a1-81f1-ff498cba90af |
    +--------+--------------------------------------+
    
  3. Log in to the virtual machine, create a mount point for the optical drive with the guest tools image, and then run the installer:

    # mkdir /mnt/cdrom
    # mount /dev/sr1 /mnt/cdrom
    # bash /mnt/cdrom/install
    

    Guest tools rely on the QEMU guest agent that is installed alongside the tools. The agent service must be running for the tools to work.

Installing guest tools in existing Windows virtual machines

To install the guest tools in an existing Windows virtual machine, do the following:

  1. Power off the Windows VM. For example, to stop the win10 VM, run:

    # vinfra service compute server stop win10
    
  2. Convert its system volume to a template image. You will need the volume ID that you can obtain with vinfra service compute volume list. For example, to use the win10 VM boot volume, run:

    # vinfra service compute volume list | grep win10
    | 7116d747-a1e1-4200-bd4a-25cc51ef006c | win10/<...>/Boot volume   | <...> |
    | ef2f1979-7811-4df6-9955-07e2fc942858 | win10/<...>/CD/DVD volume | <...> |
    # vinfra service compute volume upload-to-image \
    7116d747-a1e1-4200-bd4a-25cc51ef006c | grep id | id | 79da5239-b2bb-4779-ada2-46cb8da8ba0e
  3. Create a new Windows VM from the template, attaching the guest tools image to it during creation. For example:

    # vinfra service compute server create newvm --network id=private \
    --flavor medium --volume source=image,id=79da5239-b2bb-4779-ada2-46cb8da8ba0e,\
    size=64,boot-index=0,type=disk --volume source=image,id=vz-guest-tools-win,\
    size=1,boot-index=1,type=cdrom

    The size of volume to be created from a template image must be equal to or greater than the minimum volume size specified in the image metadata. You can learn the minimum volume size by using vinfra service compute image show <image_id> | grep min_disk.

    In this example, the first volume is the template of the original VM’s system disk and the second volume is the guest tools image. Make sure to specify the correct boot order by means of the boot-index parameter.

  4. Once the image is mounted inside the Windows VM, launch the installer in the AutoPlay window if autorun is enabled. Otherwise open the optical drive in Explorer and run setup.exe.

    After installing guest tools, restart the VM.

    Guest tools rely on the QEMU guest agent that is installed alongside the tools. The agent service must be running for the tools to work.