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

Want to support HowtoForge? Become a subscriber!
 
Submitted by till (Contact Author) (Forums) on Wed, 2006-03-08 21:52. ::

2 Install And Start Your Virtual Private Server (VPS)

OpenVZ.org offers precreated OpenVZ template caches for download:

http://openvz.org/download/template/cache/

I will show here how to install and start a Fedora 4 minimal template. The steps for the other template caches available on http://openvz.org/download/template/cache/ 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
wget http://download.openvz.org/template/precreated/fedora-core-4-i386-minimal.tar.gz

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 "test101.mytest.org" with the hostname your VPS shall have:

vzctl set 101 --hostname test101.mytest.org --save

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

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

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

vzctl set 101 --nameserver 192.168.0.2 --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


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Fri, 2006-05-26 03:19.

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