Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go


Allows one to run multiple GNU/Linux distributions as virtual hosts. They all share the same kernel, which may be a limitation!

From http://download.openvz.org/kernel/debian/etch/ download


These might only work for etch? (Should be okay for sid)

From http://download.openvz.org/template/precreated/ download


These are OS templates.

Set up networking. Edit /etc/network/options to set:


(Might need to wajig restart networking - not sure it was necessary.) Then run:

$ sudo sysctl -w net.ipv4.conf.eth0.proxy_arp=1001

Can have this on boot with the following in /etc/network/interfaces:

up sysctl -w net.ipv4.conf.eth0.proxy_arp=1001
pre-down sysctl -w net.ipv4.conf.eth0.proxy_arp=0

Now create a new host. We'll give it an id of 1001.

$ sudo mv fedora* /var/lib/vz/template/cache

$ sudo vzctl create 1001 --ostemplate fedora-core-5-i386-default
Creating VPS private area: /var/lib/vz/private/1001
Performing postcreate actions
VPS private area was created

$ sudo vzctl set 1001 --ipadd --nameserver --hostname ovz01 --save
Saved parameters for VPS 1001

$ sudo vzctl start 1001
14 Jan 07:22:58 gjw@belinos:/var/lib$ sudo vzctl start 1001 Starting VPS ...
VPS is mounted
Adding IP address(es):
Setting CPU units: 1000
Set hostname: ovz01
touch: setting times of `/etc/resolv.conf': Function not implemented
File resolv.conf was modified
VPS start in progress...

$ sudo vzlist
      1001         17 running    ovz01

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.045 ms

$ sudo vzctl enter 1001
-bash-3.1# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
-bash-3.1# logout

$ ssh -X root@
root@'s password:
Last login: Sat Jan 13 23:32:01 2007 from
[root@ovz01 ~]#

[root@ovz01 ~]# ping google.com
PING google.com ( 56(84) bytes of data.
64 bytes from eh-in-f99.google.com ( 
   icmp_seq=1 ttl=240 time=246 ms

To stop the virtual host:

$ sudo vzctl stop 1001
Stopping VPS ...
VPS was stopped
VPS is unmounted

To remove the virtual host setup:

$ sudo vzctl destroy 1001 
Destroying VPS private area: /var/lib/vz/private/1001
VPS private area was destroyed

So now we have Fedora Core running, virtually as a separate machine. But I recall now why I moved to Debian - it is a dog to get packages installed appropriately.

Copyright © 1995-2019 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware and the author of open source software including Rattle and wajig.
Also the author of Data Mining with Rattle and Essentials of Data Science.