Installing guest tools in new virtual machines

When you create a new VM, you can attach the guest tools image to it and install the guest tools after the operating system. To do this, perform the following steps on a compute node:

  1. Create a new VM with the guest tools image. For example, to create a Linux VM centos, run:

    # vinfra service compute server create centos --network id=private \
    --flavor medium --volume source=blank,size=64,boot-index=0,type=disk \
    --volume source=image,id=centos7,size=3,boot-index=1,type=cdrom \
    --volume source=image,id=vz-guest-tools-lin,size=1,boot-index=2,type=cdrom

    Round up the size of volumes to be created from images. For example, if the OS distribution image is 2.6 GB, use size=3.

    In this example, the first volume is a blank virtual HDD, the second volume is the OS distribution image centos7, and the third volume is the guest tools image vz-guest-tools-lin. Make sure to specify the correct boot order by means of the boot-index parameter.

  2. Log in to the virtual machine and install an operating system in it.

  3. Run guest tools installer inside the VM:

    • Inside a Linux VM, create a mount point for the optical drive with the guest tools image and run the installer:

      # mkdir /mnt/cdrom
      # mount /dev/sr1 /mnt/cdrom
      # bash /mnt/cdrom/install
    • Inside a 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.