Before you perform virtual machine cloning, you must create a virtual machine template that the clones are based on.



  1. In vSphere Web Client or vSphere Client, create a new virtual machine.
  2. Configure custom configuration options.
    1. Right-click the virtual machine and click Edit Settings.
    2. Specify the number of vCPUs and the vMemory size.
      Follow the vCPUs and vMemory size guidelines in the installation guide for your Linux distribution.
      For example, Ubuntu 18.04 specifies configuring 2048 MB for vMemory and 2 vCPUs.
    3. Select Video card and specify the number of displays and the total video memory (vRAM).
      Set the vRAM size in vSphere Web Client for virtual machines that use 2D graphics, which use the VMware driver. The vRAM size has no effect on vDGA or NVIDIA GRID vGPU machines, which use NVIDIA drivers.

      Follow the guidelines in Virtual Machine Settings for 2D Graphics. Do not use the Video Memory Calculator.

  3. Power on the virtual machine and install the Linux distribution.
  4. Create a user with root privileges, for example, ViewUser. This user is used to install and uninstall Horizon Agent only.
  5. Edit /etc/sudoers and add the line ViewUser ALL=(ALL) NOPASSWD:ALL.
    With this line in /etc/sudoers, no password is required to run sudo as ViewUser. When you run the sample script to install Horizon Agent that is provided in this chapter, you specify ViewUser as an input.
  6. If the Linux distribution is RHEL, CentOS, or NeoKylin, edit /etc/sudoers and comment out the following lines:
    Defaults requiretty
    Defaults !visiblepw
  7. If the Linux distribution is not RHEL/CentOS 8.x, RHEL/CentOS 7.x, or SLED/SLES 12.x, install VMware Tools.
    RHEL/CentOS 8.x, RHEL/CentOS 7.x, and SLED/SLES 12.x have Open VM Tools installed by default.
  8. Install and configure the dependency packages.
    1. If the Linux distribution is running a version of Open VM Tools earlier than 9.10, install the deployPkg plug-in.
      The instructions are at
    2. If the Linux distribution is Ubuntu, refer to the following Knowledge Base (KB) articles to determine the dependency packages to install and configure in the VM.
  9. For RHEL and CentOS, enable the Network Connection setting Connect automatically.
  10. Perform the AD integration tasks.
  11. Perform the steps to set up graphics.
  12. Install Horizon agent.
     sudo ./ -A yes

    See Installing Horizon Agent.

  13. Perform additional configurations using the Horizon 7 configuration files.
  14. Shut down the virtual machine and create a snapshot.