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:

Suggested articles

1 Comment(s)

Add comment


By: Anonymous

Excellent, thank you, and hey, I *almost* understood it all, tho being a *nix newbie with only some ancient experience with ibm and sco-unix all I know these days is debian.

I had *some* trouble making the debian cache and template, apt-get got me the debootstrap util.
Rebuilding the kernel I used stab077 instead of stab064, that all went fine

The ubuntu bit was kinda annoying when the attraction to the document was that it was all debian sarge, but I got over it ;)

Id like my contribution to be this little script i wrote to simplify making a new VPS from a template down to one command plus some bulk starting/stopping stuff .

If its not posted here, its cause 'it looked suspicous' to the forum/comments parsing code on here.

Cheers and thanks