Create a new Virtuozzo Container (cli)

How to create a new Virtuozzo Container (cli)



The following steps will walk you through setting up a new container on a Virtuozzo server, if you are not familiar with a command line interface however please reference the Virtuozzo beginners’ walkthrough.


Step 1:


Check the list of containers on your host:


[root@vztrain01 ~]# vzlist -a

      CTID      NPROC STATUS    IP_ADDR         HOSTNAME

         1         93 running   192.168.135.58  ServiceCT

       100          9 running   67.228.128.93   vztest01.softlayer.local


Step 2:


Create a container with an open ID#; the number must be above 100 and not already in use. In this example we will use 122.


[root@vztrain01 ~]# vzctl create 122 --pkgset redhat-as3-minimal-x86_64  --config basic

Creating Container private area (redhat-as3-minimal-x86_64/20080630)

Container is mounted

Postcreate action done

Container is unmounted

Container private area created

Container registered succesfully

[root@vztrain01 ~]# vzlist -a


      CTID      NPROC STATUS    IP_ADDR         HOSTNAME

         1         93 running   192.168.135.58  ServiceCT

       100          9 running   67.228.128.93   vztest01.softlayer.local

       122          - stopped   -               -


Immediately after creation the VZ will be in the stopped state. If you are not sure what packages are installed you can use the vzpkgls command, this will show you a listing of installed virtuozzo OS and Application packages on the server. In our example we used a red hat template, but Virtuozzo will support several different OS’s including RedHat, CentOS, Debian, Fedora Core, and SuSe.




Step 3:


Review the default configuration and make changes if necessary for the container:


[root@vztrain01 ~]# less /vz/private/122/ve.conf


Step 4:


Start the container:


[root@vztrain01 ~]# vzctl start 122

Starting Container ...

Container is mounted

Setup slm memory limit

Setup slm subgroup (default)

Setting devperms 20002 dev 0x7d00

Adding port redirection to Container(1): 4643 8443

Adding IP address(es):

Configure meminfo: 65536

Container start in progress...


Moments later the container will be running, you can check the status again with the vzctl status 122 command.


Step 5:


Add parameters necessary for managing the Container:


[root@vztrain01 ~]# vzctl set 122 --ipadd 12.34.234.142 --hostname vz122.domain.com --userpasswd root:password123 --save

Hostname for Container set: vz122.domain.com

Adding IP address(es) to pool: 12.34.234.142

Adding IP address(es): 12.34.234.142

Shutting down loopback interface:  [  OK  ]

Setting network parameters:  [  OK  ]

Bringing up loopback interface:  [  OK  ]

Bringing up interface venet0:  [  OK  ]

Changing password for user root.

passwd: all authentication tokens updated successfully.

Saved parameters for Container 122



This concludes basic setup of a new Virtuozzo Container via the command line. If you have any questions or concerns after reading this article please feel free to open a support ticket and we will assist you with your questions.