Building A Virtual Server (VPS) With Debian 3.1 (Sarge) And OpenVZ - Page 2

2 Install And Start Your Virtual Private Server (VPS) offers precreated OpenVZ template caches for download:

I will show here how to install and start a Fedora 4 minimal template. The steps for the other template caches available on are exactly the same (in case you do not want to install Fedora 4 in a VPS). If you want to create your own custom templates, please have a look at chapter 3 of this tutorial.

Download the Fedora 4 template:

cd /var/lib/vz/template/cache

Create the VPS. The ID of the first VPS is 101. You can choose any numeric ID, as long as the ID is > 100 and unique.

vzctl create 101 --ostemplate fedora-core-4-i386-minimal --config vps.basic

Now I set some basic settings. Configure this VPS to start automatically on boot:

vzctl set 101 --onboot yes --save

Set the hostname. Replace "" with the hostname your VPS shall have:

vzctl set 101 --hostname --save

Set the IP of the VPS. Replace with a free IP from your network and set the number of sockets to 120:

vzctl set 101 --ipadd --save
vzctl set 101 --numothersock 120 --save

Set the nameserver in the VPS. Replace with a nameserver reachable from your server:

vzctl set 101 --nameserver --save

Start the VM:

vzctl start 101

Start the SSH server:

vzctl exec 101 /etc/init.d/sshd start

Set the root password inside the virtual server:

vzctl exec 101 passwd

Now you will be able to login to the virtual server with an SSH client, e.g. PuTTY for Windows.

To see the status of the VPS, run

vzctl status 101

To stop the VPS, run this:

vzctl stop 101

To see the status of all VPS' on the system, run

vzlist -a

Share this page:

1 Comment(s)