GNU/Linux Desktop Survival Guide by Graham Williams |
|||||
OpenVX |
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
linux-headers-2.6.18-openvz-686_02_i386.deb linux-headers-2.6.18-openvz-amd64_01_amd64.deb linux-image-2.6.18-openvz-686_02_i386.deb linux-image-2.6.18-openvz-amd64_01_amd64.deb |
From http://download.openvz.org/template/precreated/ download
fedora-core-5-i386-minimal.tar.gz fedora-core-5-i386-default.tar.gz |
Set up networking. Edit /etc/network/options to set:
ip_forward=yes |
$ sudo sysctl -w net.ipv4.conf.eth0.proxy_arp=1001 |
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 192.168.0.10 --nameserver 203.0.178.19 --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): 192.168.0.10 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 VPSID NPROC STATUS IP_ADDR HOSTNAME 1001 17 running 192.168.0.10 ovz01 $ ping 192.168.0.10 PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data. 64 bytes from 192.168.0.10: 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 [email protected] [email protected]'s password: Last login: Sat Jan 13 23:32:01 2007 from 192.168.0.5 [root@ovz01 ~]# [root@ovz01 ~]# ping google.com PING google.com (72.14.207.99) 56(84) bytes of data. 64 bytes from eh-in-f99.google.com (72.14.207.99): 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.