Leopard VMWare Fusion OpenVZ fun!

some text

Virtualize within an already virtualized host, yes, why? who knows.

Here's what you will need:
A Mac running 10.5 (Leopard)
VMWare Fusion
Centos Install ISO
Ubuntu OpenVZ Image
Time
Coffee
Lack of sanity

Let's get to my crazy directions, which might or might not work :) (they did for me)

Vmware Fusion install of CentOS 5.2 using netinstall image (7.2MB :) )

HTTP Install with the following values
Web site Name: mirror.centos.org
CentOS Directory: centos/5.2/os/i386

Bare bone install, nothing extra

Gave Vmware Fusion 40GB Disk
Bridged Network
1 CPU
1024 RAM

Install vmware-tools

Installing OpenVZ
Grab YUM Repos

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

Install Kernel

yum install ovz-kernel-ent

Reboot and Select new kernel

chkconfig off un-needed services like cups/bluetooth etc
Disable firewall/SELinux

Add the following (this is only for IPv4)

vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Next install OpenVZ container mgmt and quotas

yum install vzctl vzquota

Start up OpenVZ

/sbin/service vz start

Next install packages needed for templates

yum install vzpkg vzyum vzrpm43-python vzrpm44-python vzctl-lib

Next change directory into

cd /var/lib/vz/template/cache

wget template of choice from here http://download.openvz.org/template/precreated/

I downloaded this http://download.openvz.org/template/precreated/ubuntu-8.04-x86.tar.gz

Lets create a container now. $IPADDR is a IP Address on your internal network.

vzctl create 101 --ostemplate ubuntu-8.04-x86
vzctl set 101 --onboot yes --save
vzctl set 101 --ipadd $IPADDR --save
vzctl set 101 --nameserver $IPADDROFDNS --save
vzctl set 101 --numothersock 120 --save

Increase DISKSPACE by default its a 1GB

vi /etc/vz/conf/101.conf

Turn off quota's if your just messing arould like me

vzquota off 101

Start up your container (OpenVZ speak for Guests in the VMware world)

vzctl start 101

Set root password

vzctl exec 101 passwd

SSH to IP Address you set

linux:~ jdunn$ ssh $IPADDR
jdunn@IPADDR's password:
Linux ubuntu-vps.joedunn.com 2.6.18-92.1.18.el5.028stab060.8ent #1 SMP Mon Feb 9 22:44:56 MSK 2009 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
jdunn@ubuntu-vps:~$

Now if your crazy and just want to mess around, lets install Gnome :)


sudo apt-get update
#Go grab a coffee when you run the next command
sudo apt-get install ubuntu-desktop
sudo /etc/init.d/gdm start
sudo apt-get install vnc4server xinetd
# Might need to set the display
DISPLAY=1.0
vi .vnc/xstartup and add gnome-session & instead of the default tdm
# Might need to break the lock on the Xauthority file
sudo xauth -b
#Lets Start up VNC
vncserver -name vzdesktop

#Now Lets Connect
on Leopard do the following
cmd + k
type: vnc://IPADDR:5901
Enjoy

#If you only want an application to run

ssh -Y $IPADDR

Application to run say 'firefox'

some text

Sources:
http://www.chrisgountanis.com/technical/45-centos-netinstall.html
http://wiki.openvz.org/Quick_installation
http://ubuntuforums.org/showthread.php?t=119256
http://ubuntuforums.org/archive/index.php/t-186298.html
http://lists.freebsd.org/pipermail/freebsd-x11/2006-February/002660.html


Theme port sponsored by Duplika Web Hosting.
Home Back To Top