This is my brief guide to getting Xen functioning on an Intel mac-mini. Please note, I have only briefly tested this installing and booting WindowsXP on my mac-mini, but it seemed to work just fine. Good luck!

The intel macs are nice, small, quite, fairly-inexpensive machines that support the VT instructions required to boot unmodified Operating Systems using Xen. When they were announced, I thought it would make a very nice dev/testing box. However, a little extra work was needed to get Xen working.

Because these machines are EFI based, you will need the latest Apple firmware which enables the Compatibility Support Module (CSM). You will also need to enable your VT instructions if they are disabled. My mac shipped with them enabled, but if yours are disabled use the EFI utility found here. Feel free to use BootCamp to resize your partition if you want to dual boot. Personally, I use rEFIt to triple boot OS X, Windows, and Linux on my mini. Instructions on how to create this setup can be found at

You will need to install your linux distro of choice. The purpose of this guide isn't to get Linux onto your mac or how to use Xen. There are plenty of other places to find that information. Use google if you need help with that. This is a guide purely on getting an Intel Mac to run Xen.

I find it is easiest to modify a working installation into a xen dom0. I know that OpenSuSE 10.1 and Ubuntu Dapper Drake both work fine on the mini. I haven't tested any other distros. The main requirement for a distro to work is that lilo is a boot-loader option, and it has a semi-recent kernel. The reason lilo needs to be an option is even though Xen requires grub, you'll want to choose lilo as the bootloader for your first install due to the fact the macs lack a A20 gate (thus locking up unmodified grub stage2 before it boots).

Once you have a working linux installation on your mac, you will need to install the grub boot loader. A patch is provided here to work around the A20 gate issue. For those of you that want a binary, grub_0.97-1ubuntu9_i386.deb is a modified ubuntu package and grub-0.97.tgz is a tarball created using the alien utility. For anyone who just cares about the stage2 binary itself and has a .97 grub install on the system, stage2 is the only part you need to replace in a grub install. Note: grub .97 is the only version I've tested this with.
Thanks to jkeil at the forums for posting this workaround!

Basically to switch to grub you will need to copy the files in /lib/grub/i386-pc/ to /boot/grub/

Then you will want to launch the grub shell:
root@mdklein-2:~# grub
then when the shell comes up please note for this chain of commands #: 1 for sda2, 2 for sda3, 3 for sda4
grub> root (hd0,#)
Filesystem type is reiserfs, partition type 0x83
grub> setup (hd0,#)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd0,2)"... 18 sectors are embedded.
Running "install /boot/grub/stage1 (hd0,2) (hd0,2)1+18 p (hd0,2)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
grub> quit

Alternatively, you could try grub-install \(hd0,#\), but I prefer the extended dialog as assurance everything was written correctly.
you're now done with grub install.

You'll also need a /boot/grub/menu.lst entry. Something like

title Ubuntu
root (hd0,2)
kernel /vmlinuz root=/dev/sda3 ro
initrd /initrd.img

Reboot the system now to make sure your grub is working fine. No point messing your system up further if grub isn't working. It would be wise to have a rescue cd handy.

Now that your system is happily booting with grub, you will need to install the xen package. I've found that the default xen kernel config+initrd will crash when trying to load a domU, so I've included a very custom kernel for the intel mac mini. It would be trivial to modify the config for other intel macs. Please feel free to use this config as a base. My config is xen-mini.config. If you'd like to see which options are important to you, check out this guide at The version of xen I used on my mini was the testing branch from hg. I have a tarball available here. Just untar it and run the ./ script. Right now there's an issue with the netfilter-bridge and the sky2 network driver, so avoid loading that module or your machine will kernel panic randomly after creating the xenbr0 bridge.

my /boot/grub/menu.lst looks like this. Note: my Linux is /dev/sda3

title Xen 3.0.testing / XenLinux 2.6
root (hd0,2)
kernel /boot/xen.gz noreboot
module /boot/vmlinuz-xen root=/dev/sda3 ro console=tty0

Reboot, and start xend. You should now be able to create domU hosts even using hvmloader. Check out the Xen documentation for usage instructions. Two quick gotchas I will write about here is that before you start xend on Ubuntu dapper drake you will need to "mkdir -p /var/run/xenstored" or xend will not start. The other is that occasionally "xm create winxp" will say "Error: an integer is required". However, the DomU guest is still created, so I'm unsure what if anything this error means.

My winxp xen configuration is here:

disk = [ 'file:/var/lib/xen/images/winxp/hda,ioemu:hda,w' ]
memory = 256
vcpus = 2
builder = 'hvm'
device_model = '/usr/lib/xen/bin/qemu-dm'
kernel = "/usr/lib/xen/boot/hvmloader"
name = 'winxp'
vif = [ 'type=ioemu,bridge=xenbr0' ]
stdvga = 0
sdl = 1
vnc = 0
vncviewer = 0
boot = 'd'
cdrom = '/home/mdklein/winxp.iso'

Written by Mark Klein at the Scalable Computing Laboratory, June 8th, 2006. version 1.0