Creating your first container (virtual machine)
In order to create your first container, you need a template file. ‘Templates’ in OpenVZ refers to a compressed format of different operating systems that are available freely. You can browse the templates at https://openvz.org/Download/ template/precreated.
Download your favourite operating system’s template to the /vz/template/cache directory and once completed, follow the steps shown in the next section.
The power of the shell comes in handy when creating containers or when amending the current settings related to a container. In this section, we will create our first container (virtual machine) and add a few parameters, including the IP address, so that you can access your machine over a LAN (or provide a public IP so that it can be accessible over a WAN as a standalone virtual server), name, DNS name server, root user password, etc. So, let’s get started with creating the container first:
To check if your container was created successfully, run vzlist -a and it should list all the containers (even those not running) as shown in Figure 2.