2.1. Creating Virtual Machines and Containers

This section explains how to create new Virtuozzo virtual machines and containers using the prlctl create command. The options you should pass to this command differ depending on whether you want to create a virtual machine or container.

2.1.1. Choosing OS EZ Templates for Containers

Before creating a container, you need to choose an OS EZ template it will be based on. Listing OS EZ Templates

To find out which OS EZ templates are already installed on the hardware node and cached (i.e. ready to be used), you can use the vzpkg list command. For example:

# vzpkg list -O
almalinux-8-x86_64                 2022-12-27 16:57:59

The timestamp next to an OS EZ template indicates when the template was cached.

Adding the -O option to the vzpkg list command, you can list only those OS EZ templates which are installed but not cached. You can also add the --with-summary option to display brief template descriptions:

# vzpkg list -O --with-summary
almalinux-8-x86_64                :AlmaLinux 8 (for AMD64/Intel EM64T) Virtuozzo Template
<...> Installing and Caching OS EZ Templates

Some of the supported OS EZ templates may not be preinstalled, so you may need to perform additional steps before you can create containers based on these templates. To list templates available for installation in the official remote repositories, run the following command:

# vzpkg list --available
sles-15-x86_64                     virtuozzo-os

To prepare a template for container creation, do the following:

  1. Install the template package. For example:

    # vzpkg install template sles-15-x86_64
  2. Configure additional template parameters if needed. Some of the EZ templates may require specific preparation steps that depend on the operating system. To prepare, for example, a SLES 15 template for container creation, you additionally need to do the following:

    1. Obtain six keys from the installed system by copying them in the etc/zypp/repos.d/ directory:

      cd /etc/zypp/repos.d/
      grep 'https://updates.suse.com/SUSE/Products/SLE-Module-Basesystem/15/x86_64/product?' \
      *.repo $SLES_KEY_REL
      grep 'https://updates.suse.com/SUSE/Updates/SLE-Module-Basesystem/15/x86_64/update?' \
      *.repo $SLES_KEY_UPD
      grep 'https://updates.suse.com/SUSE/Products/SLE-Product-SLES/15/x86_64/product?' \
      *.repo $SLES_KEY_PRO
      grep 'https://updates.suse.com/SUSE/Updates/SLE-Product-SLES/15/x86_64/update?' *.repo \
      grep 'https://updates.suse.com/SUSE/Products/SLE-Module-Server-Applications/15/x86_64/\
      product?' *.repo $SLES_SERVER_REPO
      grep 'https://updates.suse.com/SUSE/Updates/SLE-Module-Server-Applications/15/x86_64/\
      update?' *.repo $SLES_SERVER_UPDATES
    2. Add the obtained keys to the /etc/vztt/url.map file:

      echo "$SLES_KEY_REL <obtained_key_1>" >> /etc/vztt/url.map
      echo "$SLES_KEY_UPD <obtained_key_2>" >> /etc/vztt/url.map
      echo "$SLES_KEY_PRO <obtained_key_3>" >> /etc/vztt/url.map
      echo "$SLES_KEY_PRU <obtained_key_4>" >> /etc/vztt/url.map
      echo "$SLES_SERVER_REPO <obtained_key_5>" >> /etc/vztt/url.map
      echo "$SLES_SERVER_UPDATES <obtained_key_6>" >>/ etc/vztt/url.map

    You may also need to set the $RCE parameter and SUSE repository credentials (obtained from the SUSE Customer Center) in the /etc/vztt/url.map file as follows:

    $RCE            %24RCE
    $SLES_LOGIN     <user>
    $SLES_PASSWORD  <password>
  3. Create the template cache:

    # vzpkg create cache sles-15-x86_64

Now you can create containers based on the prepared template.

2.1.2. Creating Containers

To create a container, use the prlctl create command as follows:

# prlctl create MyCT --vmtype ct

Virtuozzo Hybrid Server will create a new container with the name MyCT using the default parameters from the global configuration file /etc/vz/vz.conf.

If you want to create a container with a guest OS different from the default specified in the global configuration file, add the --ostemplate option after the prlctl create command. For example:

# prlctl create MyCT --vmtype ct --ostemplate centos-6-x86_64

All container contents will be stored in this container’s private area. To find out where the private area is located, use the prlctl list command as follows:

# prlctl list MyCT -i | grep "Home"
Home: /vz/private/26bc47f6-353f-444b-bc35-b634a88dbbcc

Take note of the following:

  • The first time you install an operating system in a container, its cache is created. To create a cache, you need to have an active Internet connection to access repositories that contain packages for the respective operating system. You can also set up a local package repository and use this repository to provide packages for your operating system. A local package repository is also required for some commercial distributions (e.g., for Red Hat Enterprise Linux).

  • For information on creating containers with preinstalled applications, see Using Golden Images.

2.1.3. Creating Virtual Machines

Creating a new virtual machine means creating a VM configuration based on a distribution you specified. To create VMs, use the prlctl create command. For example:

# prlctl create MyVM --distribution centos7 --vmtype vm

This command creates a configuration for a virtual machine MyVM, adjusts it for running the CentOS 7 guest OS, and places all the required files in the /vz/vmprivate/<UUID> directory.

Once the virtual machine configuration is ready, you will need to install a supported guest OS in it (e.g., via VNC as described in Enabling VNC Access to Virtual Machines and Containers).


To install a Windows guest in a virtual machine, you will need to manually mount a corresponding image file to VM’s virtual floppy drive using the command prlctl set --device-set fdd0 --image <image_file>. The images are located in /usr/share/vz-guest-tools/ and are typically named to match the guest OS name. For Windows Server 2012 (not R2), however, choose floppy_win8.vfd.

When choosing a distribution to install, have in mind that Virtuozzo Hybrid Server supports VM guest initialization via cloud-init, so you can perform some of the initial configuration tasks on stopped virtual machines. To be able to use this feature, you can install a “cloud-enabled” distribution instead of a regular one. For more information, see Using cloud-init for Virtual Machine Guest Initialization.

2.1.4. Supported Guest Operating Systems

The following guest operating systems have been tested and are supported in virtual machines and containers. Virtual Machines

  • AlmaLinux 8.x

  • CentOS 8.x, CentOS 7.x, CentOS 6.x

  • CloudLinux 8.x, CloudLinux 7.x, CloudLinux 6.x

  • Debian 11.x, Debian 10.x, Debian 9.x, Debian 8.x

  • FreeBSD 13.x, FreeBSD 12.x, FreeBSD 11.x, FreeBSD 10.x, FreeBSD 9.x

  • RockyLinux 8.x

  • Ubuntu 22.04 LTS, Ubuntu 20.04 LTS, Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, Ubuntu 14.04 LTS

  • VzLinux 8.x, VzLinux 7.x

  • Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 with Service Pack 1 Containers

  • AlmaLinux 9.x, AlmaLinux 8.x

  • CentOS 7.x, CentOS 6.x

  • Debian 11.x, Debian 10.x, Debian 9.x, Debian 8.x

  • openSUSE 42.x

  • RockyLinux 8.x

  • SUSE Linux Enterprise Server 15 Service Pack 2, SUSE Linux Enterprise Server 12 Service Pack 1

  • Ubuntu 22.04 LTS, Ubuntu 20.04 LTS, Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, Ubuntu 14.04 LTS

  • VzLinux 8.x, VzLinux 7.x, VzLinux 6.x Notes and Known Limitations

  • FreeBSD 10.x and FreeBSD 9.x cannot work inside the virtual machines with UEFI boot enabled.

  • FreeBSD 8.x is not supported due to SCSI limitations. Instead, you can try to configure the OS manually and use IDE controllers.

  • Some functions of FreeBSD guest tools are not fully implemented yet.