MacOS Xen: Snow Leopard as guest on a Xen domU

Some days ago I started trying to get MacOS X to run as a virtual machine on Xen. After all if the OSx86 guys are getting it to run on normal PC hardware, why not on virtual hardware?

There’s not much info available and most of them is incomplete. The more accurate sites I could find were:

Some notes:

  • I’m using Debian Squeeze with the bundled Xen 4.0 for the hypervisor and the dom0. The server si a cheap (~300€) PC with a DualCore E5700 @3Ghz and 4Gb of RAM. Other versions of Xen may need different options or have a slightly different config file syntax.
  • I assume you already know how to configure a Xen domU, access it through Xen’s built-in VNC server, etc.
  • Instead of using the original Snow Leopard DVD and then patching like here, I’m taking the easy road using iATKOS S3 v2 which is already upgraded to 10.6.3 and bundles several the OSx86 patches.

My /etc/xen/hackosx.cfg file is a mix of those on the previously mentioned pages:

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 512
device_model='/usr/lib64/xen/bin/qemu-dm'

name = "hackosx"
#vcpus=1
pae=1
acpi=1
apic=1
#HPET=1
#timer_mode=0
#vpt_align=0
#vcpus_avail=1
#localtime=1
NE2000=0

vif = [ 'type=ioemu,ip=192.168.10.10,bridge=xenbr0' ]
disk = [
        'phy:/dev/mapper/xen-hackosx_hd,ioemu:hda,w',
        'file:/root/iATKOS_S3v2.iso,hdc:cdrom,r',
  ]

# first boot from disk, then from cd if that fails
boot="cd"
sdl=0
vnc=1
vnclisten="0.0.0.0"
vncdisplay=1
vncconsole=0
vncunused=1
vncpasswd='pass'

stdvga=1
serial='pty'
monitor=1

Fix the path to the HD image file/dev and the iATKOS ISO if you need.

So, let’s begin:

  • On the dom0 run “xen create /etc/xen/hackosx.cfg” and access it via VNC.
  • Run Disk Utility and partition the virtual HD. Return to the installer.
  • On the screen where you select the destination HD, click the customize button on the bottom left. Besides the default options (on the screenshot) I also selected the following (NOT on the screenshot and NEEDED for OS X to run on Xen):
    • Patches->Modified Kernels->qoopz 10.3.0
    • Drivers->Main Hardware->SATA/IDE->Intel SATA/IDE
    • Drivers->Main Hardware->PS/2->Apple PS/2
    • Drivers->Network->Wired->Realtek->RTL8139

    iATKOS default options

  • Continue with the installation.

The installer proceeds normally until the end. In my case it gets stuck in “Remaining time: 8 minutes approx.” so after a while seeing the progress bar not… well… progressing, I went to the dom0 and restarted the virtual machine. Note: I had to re-install several times until I got the right options and the installer hanged for me at that point always.

Despite the unfinished installation, access again the VM after restarting it with VNC. This time you’ll see the usual OS X 1st time wizard configuring the language, time zone, user account, etc. Yay!

Now, on to the upgrade to 10.6.6:

If everything worked as expected, now you’re running MacOS X Snow Leopard updated to 10.6.6 on a Xen domU. \o/

Some additional details:

  • Network performance with the default OS X RTL-8139 driver is TERRIBLE (at least right after installing iATKOS, before upgrading to 10.6.6). Follow these instructions to replace it.
  • If you go to apple menu on the upper left corner and then “About this Mac”, the Finder restarts and you don’t get the About window. :-/ Nevertheless the system is upgraded: ”uname -r” says 10.6.0 (same as in my MacBook Pro) and the App Store is installed.
  • Run Software Update. There’s a Safari update, a Java one and an iTunes one. ;-) (yes, Software Update works and these upgrades don’t break any of the MultiBeast patching).
  • Install VineServer (it’s free). Is a much better VNC server than the one integrated in Xen and more compatible/standard than the one bundled in OS X.
  • Disable power saving in System Preferences -> Energy Saver. When the virtual OS goes into power saving I don’t know how to wake it, you can VNC to it but it’s completely unresponsive. Maybe there’s a fix, iATKOS and/or MultiBeast have a fix for power saving (not for Xen of course, but maybe it helps) and Xen’s config seems to have some options for power management.

Enjoy. :-)

March 23th update: Apple released the MacOS X 10.6.7 upgrade yesterday. I’ve just tried to install it through Software Update and it works. No need to run MultiBeast even.

Grande Debian, y grande screen

Este finde pasado he actualizado la Debian del Slug de Etch a Lenny. En remoto desde Alicante, a ratos y a lo largo de los tres días (viernes-domingo). XDDD

Cómo molan dos cosas:

  • dist-upgrade de una plataforma no sé si minoritaria, pero desde luego menos extendida y probada que i386, sin problemas. Todo a la primera. Yay!
  • screen. En remoto con una hardware tan justito y lento como el slug hubiera sido imposible. Con screen: abre sesión, “aptitude full-upgrade”. Apaga el ordenador, cena con amigos, vuelves a casa, ssh, screen … mira, pregunta algo. Respondes. Apagas y a dormir. Al día siguiente otra vez … luego desde casa de un colega …

Son pequeños detalles que al final te acostumbras a ellos y creo que no los valoras en su medida, si no te paras a pensar lo coñazo que hubiera sido tener que reinstalar, que la actualización no fuera bien y al reiniciar no arrancara, o no haber podido ir entrando y saliendo de la sesión durante tres días sin tener que mantener el ordenador encendido y la conexión ssh abierta (y sin cortes con un 3G de Yoigo!).

Bravo!

Mi nuevo servidor

  • english
  • spanish

Ladies and gentleman, let me please introduce you to my new server, the one I’ve been blogging about lately:

dscf0042.JPG dscf0044.JPG

What? You don’t see it? Yes! The small grey box on top of the iomega disk, slightly bigger than the Fonera

In case you don’t know it yet, it’s a Linksys NSLU2, a small device around $100 that comes with two USB2 ports and an ethernet connection. Plug an external USB hard drive to it and it’ll become available over the network like a NAS share. And the best part is: you can flash its firmware and install Debian!! :-D

It’s not that powerful, it has an XScale (ARM) processor at 266Mhz and only 32Mb of RAM. There are pages explaining how to install up to 256Mb. Nevertheless, it works and is small, doesn’t make noise, and has a small electrical consumption.

Up to now I’m running the following on it and it works quite well:

top-nslu2.png

# cat /proc/cpuinfo Processor : XScale-IXP42x Family rev 2 (v5l) BogoMIPS : 266.24 Features : swp half fastmult edsp CPU implementer : 0x69 CPU architecture: 5TE CPU variant : 0x0 CPU part : 0x41f CPU revision : 2 Cache type : undefined 5 Cache clean : undefined 5 Cache lockdown : undefined 5 Cache format : Harvard I size : 32768 I assoc : 32 I line length : 32 I sets : 32 D size : 32768 D assoc : 32 D line length : 32 D sets : 32 Hardware : Linksys NSLU2 Revision : 0000 Serial : 0000000000000000 # free total used free shared buffers cached Mem: 29988 28988 1000 0 404 4808 -/+ buffers/cache: 23776 6212 Swap: 979924 41164 938760 # uname -a Linux eliza 2.6.18-6-ixp4xx #1 Tue Feb 12 00:57:53 UTC 2008 armv5tel GNU/Linux # pstree init-+-afpd---afpd |-atalkd |-atd |-avahi-daemon---avahi-daemon |-cnid_metad |-cron |-dbus-daemon |-events/0 |-getty |-khelper |-klogd |-ksoftirqd/0 |-kthread-+-aio/0 | |-kblockd/0 | |-khubd | |-3*[kjournald] | |-kmirrord | |-kpsmoused | |-kseriod | |-kswapd0 | |-2*[pdflush] | |-scsi_eh_0 | `-usb-storage |-mtdblockd |-nmbd |-papd |-portmap |-rpc.statd |-slpd |-smbd---smbd |-sshd---sshd---sshd---bash---su---bash---pstree |-svscanboot-+-readproctitle | `-svscan-+-supervise---dnscache | |-3*[supervise---multilog] | |-supervise---tinydns | `-supervise---mlnet---mlnet---mlnet |-syslogd `-udevd

netatalk de Debian y MacOS X Leopard

  • english
  • spanish

I’m installing a new fileserver at home (more on this one of these days…) and after installing the netatalk package I wasn’t able to connect to it from MacOS X Leopard, it returned an error after the user/pass prompt.

Googling about it I’ve found that you need to recompile the netatalk package, more info on this and a detailed step-by-step here: Make Netatalk talk to Leopard (Mac OS X 10.5)

Command Line

  • english
  • spanish

I start here a new section on my blog, Command Line (feed), where I will comment on UNIX commands (Linux and MacOS X mainly) that I find useful on my daily work. The articles will range from a very obscure command that I didn’t knew of until some day I needed something like it and found it and saved my day, new or creative ways to use old commands, or small shell-scripts that can make your life easier.

Unless otherwise specified, all these commands are just an “aptitude install” away on Debian and derivate distros (on Ubuntu they may be on universe or multiverse). For RedHat, CentOS, etc. there’s a good chance that you’ll find RPM packages on Dag Wieërs’ repository.

So, without further addo, the first command on the next entry. :)