Home

May 12th, 2008

Xen + Ubuntu 8.04 Howto

  • May. 12th, 2008 at 7:25 PM
ibm phd fellowship 2
NOTE: This is a work in progress

For details that I might be missing a good resource is:
http://howtoforge.com/ubuntu-8.04-server-install-xen-from-ubuntu-repositories

Another useful link related to HVM and Solaris/OpenSolaris:
http://blogs.sun.com/breakdown/entry/ubuntu_8_04_and_xen

I will clean this up and do more testing when I have time

Any problems, questions leave a comment or post to the xen-users mailing list

Also, this is just proof of concept, in production I would recommend things like
LVM and network storage solutions like AoE, iSCSI, and DRDB.

Another NOTE: this is for amd64, there are also packages for i368


sudo apt-get remove network-manager
sudo gedit /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp


sudo /etc/init.d/network restart
sudo apt-get install ubuntu-xen-server
wget http://downloads.howtoforge.com/ubuntu_8.04_server_xen_from_repositories/linux-headers-2.6.24-16-xen_2.6.24-16.30zng1_amd64.deb
wget http://downloads.howtoforge.com/ubuntu_8.04_server_xen_from_repositories/linux-image-2.6.24-16-xen_2.6.24-16.30zng1_amd64.deb
sudo dpkg -i linux-headers-2.6.24-16-xen_2.6.24-16.30zng1_amd64.deb linux-image-2.6.24-16-xen_2.6.24-16.30zng1_amd64.deb

Restart into Xen

sudo xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  3888     2     r-----     57.7

sudo mkdir -p /xen/images
sudo dd if=/dev/zero of=/xen/images/para.partition bs=1M seek=10240 count=1
ls -lh /xen/images/
sudo mkfs.ext3 -F /xen/images/para.partition
sudo mkdir /mnt/para
sudo mount -o loop /xen/images/para.partition /mnt/para
sudo debootstrap hardy /mnt/para
sudo cp -a /lib/modules/`uname -r` /mnt/para/lib/modules/
echo para | sudo tee /mnt/para/etc/hostname

fix /etc/hosts, /etc/fstab, /etc/network/interfaces etc.

sudo umount /mnt/para
sudo gedit /etc/xen/para

kernel="/boot/vmlinuz-2.6.24-16-xen"
ramdisk="/boot/initrd.img-2.6.24-16-xen"
disk=['tap:aio:/xen/images/para.partition,xvda1,w']
memory=512
vif=['']
root="/dev/xvda1"
extra='xencons=tty'

sudo xm create -c para


sudo dd if=/dev/zero of=/xen/images/hvm.disk bs=1M seek=10240 count=1
sudo gedit /etc/xen/hvm

kernel="/usr/lib64/xen/boot/hvmloader"
builder="hvm"
device_model = "/usr/lib64/xen/bin/qemu-dm"
disk=['tap:aio:/xen/images/hvm.disk,hda,w','phy:/dev/<cdrom device>,hdc:cdrom,r']
#disk=['tap:aio:/xen/images/hvm.disk,hda,w','phy:/dev/loop0,hdc:cdrom,r']
sdl=1
boot="dc"
memory=512
vif=['type=ioemu,bridge=eth0']

Note that it if you want to use an ISO, just run the command:
sudo losetup `sudo losetup -f` The_ISO_file.iso

sudo xm create hvm

after the hvm install, you can do:

kernel="/usr/lib64/xen/boot/hvmloader"
builder="hvm"
device_model = "/usr/lib64/xen/bin/qemu-dm"
#disk=['tap:aio:/xen/images/hvm.disk,hda,w','phy:/dev/dvdrw1,hdc:cdrom,r']
#disk=['tap:aio:/xen/images/hvm.disk,hda,w','phy:/dev/loop0,hdc:cdrom,r']
disk=['phy:/xen/images/hvm.disk,hda,w']
sdl=1
boot="dc"
memory=512
vif=['type=ioemu,bridge=eth0']
#stdvga=1

NOTES:
UPDATE 1: add sudo in front of `losetup -f` so not it reads `sudo losetup -f`
UPDATE 2: change phy: to tap:aio: in the cases referring to image files (in the HVM config file examples)
UPDATE 3: added note at the top to state specific to amd64, but that i386 packages are available.
UPDATE 4: add another link towards the beginning related to HVM and Solaris/OpenSolaris

Profile

ibm phd fellowship 2
[info]deshantm
Todd Deshane
Website

Latest Month

December 2009
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

Advertisement

Powered by LiveJournal.com