Archive for the ‘Xen’ Category

Citrix Xenoscope

Tuesday, April 19th, 2011

Hi All

Just a quick note that if you’re at Citrix synergy, you’ll get a chance to get a preview of a piece of software me and my team have been developing here in Dublin.

Basically it’s a tool that should help troubleshoot problems with XenServer installations.

Ian will be giving a workshop in Synergy San Francisco.

It’s a really fun and useful product and I hope you like it!


New ubuntu and arch xen install initrds

Tuesday, January 5th, 2010

New Xen install initrds.

Over the past week i’ve been working on Ubuntu 9.10 and Arch linux install initrds for Xen PVM.

The arch one has been straight forward but the ubuntu one is a bit on the tricky side(grub2 mainly).

Will post them up when i have them tested a bit.

Ubuntu Hardy Xen DomU installer

Thursday, December 4th, 2008

So I learned all about ubuntu preseed when i was re-jigging the intrepid installer, so i was able to automate all the extra stuff you had to do at the end on a hardy install described in one of my earlier posts.

Note that this is a amd64 network install kernel/initrd only, so make sure you have fast network access. My last Hardy kernel/initrd was used in conjunction with the CD iso. This one isnt.

This installer runs seamlessly, all you have to do is ignore the “unable to identify hard disk” error.



One thing to note is that the virtual hard disk has to be /dev/hda in order for the installer to work(grub wont install otherwise) so this is an example config:

memory = 500
name = “ubuntu-hardy”
vcpus = 1
disk = ['phy:/dev/xenvg/hardy,hda,w']
kernel = “/xen/hardy/vmlinuz”
ramdisk = “/xen//hardy/initrd”
vif  = [  ]
When the install is finished uncomment the pygrub line, and comment out the kernel/ramdisk lines.

The reason i decided to re-jig the hardy installer was that it is LTS and for virtual servers that might be a selling point.

Any questions let me know.

Many thinks to cjwatson on #ubuntu-installer for teaching me all about preseed.

Ubuntu Intrepid Xen DomU installer

Thursday, December 4th, 2008

I’ve hacked the ubuntu intrepid(amd64 only) initrd so you can run the installer in a Xen DomU. No more debootstrap!

The only glitch is that the installer thinks that the xen block devices are part of a SATA array, when asked to activate the array select no.



Example config:

memory = 500
name = “intrepid”
vcpus = 1
disk = ['phy:/dev/xenvg/ubuntu-test,xvda,w']
kernel = “/xen/vmlinuz”
ramdisk = “/xen/initrd”
vif  = [ 'bridge=eth0']
#this is for your framebuffer if needed
#vfb         = ['type=vnc,vncunused=1,vncdisplay=0,vnclisten=,vncpasswd=password']

When the install is finished uncomment pygrub and comment out kernel and ramdisk and it should be fully functional. If you have any issues or comments please feel free.

Ubuntu intrepid Xen DomU made easy

Thursday, November 6th, 2008

I made this script for bootstrapping and “Xenifying” an ubuntu easily. You will have a working ubuntu domU in 30 seconds flat with a fast mirror.

Root password will always be set to ‘password’. Hostname will be ubuntu , loopback interface will be set up. The sole argument is either a filename or a block device to install the distribution onto. See the top of the script for more configurable options. Notibly the mirror option.

The only prerequisite is that you have (a recent)debootstrap installed. Its available for nearly every distro these days.

Remember that i think you will need Xen 3.3 to boot an ubuntu intrepid DomU.


How to create an ubuntu server DomU using the normal ubuntu install procedure

Wednesday, September 10th, 2008

How to create an ubuntu server DomU using the normal ubuntu install procedure(64 bit only, 32 bit maybe soon.). It may work or it may not, no guarantees. It did for me.

First download the kernel and the initrd and the ubuntu-8.04.1-server-amd64.iso file from .

Create the xen config file similar to this one paying attention to all the paths.

Xen Config File:

memory = 256
name = “ubuntutemp”
disk = ['phy:/dev/filevg/ubuntutemp,hda,w','file:/mnt/filelv/Downloads/ISOs/ubuntu-8.04.1-server-amd64.iso,sda:cdrom,r']
kernel = ‘/xen/ubuntutemp/kernel-xen’
ramdisk = ‘/xen/ubuntutemp/initrd-xen’
vif  = [ '' ]

Fire up the DomU

xm create -c ubuntu.cfg

Setting up the locale settings will be 1st thing.

Then you will be asked:

Load CD-ROM drivers from a driver floppy? say no
Manually select a CD-ROM module and device? say yes
Select “none”
enter /dev/sda
continue without kernel modules.
Ignore “Could not get identity of device” errors, you will get a few, otherwise continue with the setup normally.

Make sure you have a valid internet connection configured because this will be needed later on in the process

Continue the setup until you get the installation complete dialog that says this:

┌│                         Installation complete                         │
││ Installation is complete, so it is time to boot into your new system. │
││ Make sure to remove the installation media (CD-ROM, floppies), so     │
││ that you boot into the new system rather than restarting the          │
││ installation.                                                         │
││                                                                       │
└│     <Go Back>                                          <Continue>     │

select continue. Select go back.

and from the next dialog select “execute a shell” and select continue.

Then issue the following commands to “xenify” the setup.

chroot /target /bin/bash
aptitude install -y linux-image-xen ##this is where you need your internet connection
sed -ibak ’s/generic/xen/g’ /boot/grub/menu.lst
sed -ibak ’s/splash/console=xvc0/g’ /boot/grub/menu.lst
mv /etc/event.d/tty1 /etc/event.d/xvc0
rm /etc/event.d/tty*
sed -i ’s/tty1/xvc0/g’ /etc/event.d/xvc0

Probably best to do these 1 by 1, its important every single command finishes.

Now we need to edit the configuration file to this:

memory = 256
name = “ubuntutemp”
disk = ['phy:/dev/filevg/ubuntutemp,hda,w','file:/mnt/filelv/Downloads/ISOs/ubuntu-8.04.1-server-amd64.iso,sda:cdrom,r']
#kernel = ‘/xen/ubuntutemp/kernel-xen’
#ramdisk = ‘/xen/ubuntutemp/initrd-xen’
vif  = [ '' ]

Obviously changing paths as needed.

And then fire up the machine again

xm create -c ubuntu.cfg

After a short while you should be presented with a lovely login dialog:

Ubuntu 8.04.1 ubuntu xvc0

ubuntu login:

And thats it, you have a fully functioning ubuntu DomU using the starndard ubuntu server setup procedure. FYI LVM setups have been tested and worked too, Encrypted LVM hasnt been tested.

Installing an ubuntu DomU using the native installer

Wednesday, September 10th, 2008

So I wanted to install an ubuntu DomU in my Centos5 Dom0 which proved to be quite the task due to the lack of debootstrap. So an idea was to get the ubuntu install initrd and modify it so it would work with Xen so the installer would work like it would in a normal system. I succeded to an extent, with a few minor operations at the end of the install its reletively simple to install ubuntu using this system.

I’ll post my intructions and kernel/initrd later.

FreeBSD 7(DomU) on XEN 3.

Monday, June 16th, 2008

I have compiled a FreeBSD-current XEN kernel(386/PAE) from the sources on cvsup10, I have also built an image which is a pristine image of FreeBSD which has been customised for the XEN kernel, uncompressed the filesystem layout is as follows:

pristine# df -m
Filesystem 1M-blocks Used Avail Capacity Mounted on
/dev/xbd833s1a 421 36 350 9% /
devfs 0 0 0 100% /dev
/dev/xbd833s1e 383 0 352 0% /tmp
/dev/xbd833s1f 6059 1917 3657 34% /usr
/dev/xbd833s1d 726 7 660 1% /var
procfs 0 0 0 100% /proc

The root password is “password”

This is not a stable kernel in the slightest, there is a known bug which segfaults the kernel, do not use for anything but experimentation.

This is an example XEN configuration:

name = ‘freebsd’
memory = ‘256′
vif = [ 'bridge=br0' ]
disk = [ 'file:/path/to/freebsd7.pristine,hdb1,w' ]
on_shutdown = ‘destroy’
on_reboot = ‘restart’
on_crash = ‘destroy’
kernel = ‘/path/to/kernel’
extra = “,vfs.root.mountfrom=ufs:/dev/xbd833s1a”
extra += “,kern.hz=250″

Kernel: here
Filesystem: here

OpenSolaris in XEN

Saturday, February 9th, 2008

So I took on to put (open)Solaris in a Suse Linux 10.3 Dom0 with xen 3.1 64bit. I made a LOT of silly mistakes along the way, the first and most time wasting mistake was trying to work off the first CD instead of the DVD. The reason this was such a waste of time is because the CD doesn’t come with the 64 bit miniroot(boot_archive) so the kernel cant be loaded properly(look out for panic[cpu0]/thread=d30cfe00: HYPERVISOR_mmu_update() failed) , this wouldnt have been a problem if I was using 32 bit but unfortunately I wasn’t.

The general procedure after you download the DVD is as follows. As I’m using suse they like to bastardise things so it doesn’t come with pygrub, which is needed for a simpler install, so i had to fetch the kernel and the boot archive myself by mounting the ISO loop back and fetching the following files:

mount -o loop /home/dmarkey/sol.iso /mnt
mkdir /xen/solaris

cp /mnt/boot/amd64/x86.miniroot /xen/solaris

cp /mnt//platform/i86xpv/kernel/amd64/unix /xen/solaris

OK so now me have our kernel and our boot archive, now to generate our XEN configuration file.

name = ’solaris’
memory = ‘1024′
disk = [ 'file:/home/dmarkey/sol.iso,6:cdrom,r','file:/home/dmarkey/solaris.disk,0,w' ]
vif = [ 'mac=00:16:3e:00:20:11' ]
on_shutdown = ‘destroy’
on_reboot = ‘restart’
on_crash = ‘destroy’
kernel = ‘/xen/solaris/unix’
ramdisk = ‘/xen/solaris/x86.miniroot’
extra = ‘/platform/i86xpv/kernel/amd64/unix -B install_media=cdrom’

Because the boot archive is so bloated, you need a LOT of ram to get it booted, thats why I’m allocating 1024 meg of RAM. So now we have to generate the hard disk file, use something like DD to create a >8G file in /home/dmarkey/solaris.disk or wherever you want to put it, remember to change all the file paths in you configuration. I named this configuration file /xen/solaris/solaris.

So now we should be able to boot, so we do:

xm create -c /xen/solaris/solaris

And fingers crossed we should be able to perform a Solaris setup. When the setup is finished we need to edit the config file. First uncomment the #root=’/dev/dsk/c0d0s0′ line, and then we change the extra line to simply extra = ‘/platform/i86xpv/kernel/amd64/unix’ and you can reduce the amount of ram to 512 if you want.

The performance of Solaris under XEN is i would say near to native. The only problem is that solaris need 512mb of ram to even attempt to boot. This is because of the huge boot_archive (x86.miniroot). In another entry I will go through the steps to make a smaller boot_archive and now my Solaris under Xen will successfully boot with 96M of ram!

Copyright © 2018 All Rights Reserved.
No computers were harmed in the 0.090 seconds it took to produce this page.