This article assumes you have already . If not, follow the link to perform the steps needed.

Create and start a container

To create and start a , run the following commands:

[host-node]# vzctl create CTID --ostemplate osname[host-node]# vzctl set CTID --ipadd a.b.c.d --save[host-node]# vzctl set CTID --nameserver a.b.c.d --save[host-node]# vzctl start CTID

Here CTID is the numeric ID for the ; osname is the name of the OS template for the , and a.b.c.d is the IP address to be assigned to the .

Example:

[host-node]# vzctl create 101 --ostemplate fedora-core-5-minimal[host-node]# vzctl set 101 --ipadd 10.1.2.3 --save[host-node]# vzctl set 101 --nameserver 10.0.2.1 --save[host-node]# vzctl start 101

Your freshly-created should be up and running now; you can see its processes:

[host-node]# vzctl exec CTID ps ax

Enter to and exit from the container

To enter give the following command:

[host-node]# vzctl enter CTIDentered into container CTID[container]#

To exit from , just type exit and press Enter:

[container]# exitexited from container VEID[host-node]#

Stop and destroy the container

To stop :

[host-node]# vzctl stop CTIDStopping container ...Container was stoppedContainer is unmounted

And to destroy :

[host-node]# vzctl destroy CTIDDestroying container private area: /vz/private/CTIDContainer private area was destroyed

Now, when you know how to manage your , learn about .