Mac OS X in Linux via VirtualBox (as guest OS)

Mac OS X

Vinh Nguyen


December 5, 2010

I recently installed a Windows virtual machine on my Linux laptop. I wanted to test out a virtualized Mac OS X machine via VirtualBox as well (just in case I ever needed to do something that can only be done on a Mac). My main references are this post and this post. Although they virtualize on a Windows host machine, it also worked on my Ubuntu 10.10 host laptop.

Things I needed:

  1. A Mac OS X 10.6 (snow leopard) installation dvd (RETAIL version, not the one that comes with the Apple machine). Buy a copy and rip it to iso.
  2. nawcom ModCD to be able to boot the installation DVD. The EFI that came with VirtualBox and the Empire EFI from the first post did not work.
  3. The latest myHack. I used version 1.1 (r123). Install this before the Apple update.
  4. Mac OS X 10.6.5 Update. Don't do OS upgrade via the Automatic Updater, and don't update without consulting the myHack website; things can break.

Some notes to myself:

  1. When creating the hard drive, use "dynamic" and just make it as big as possible. I originally did 20gigs and had to re-do to 100gigs. Since it is dynamic, you won't take up space on your host system until you the space get filled up on the guest. Although there is a way to resize the hard drive on a Windows guest, I wasn't able to do so on the Mac guest (different filesystem and there is that boot loader issue). Looking back in hindsight, I should've just made it 500gigs and move the virtualization on an external disk if I ever reach that (I highly doubt it!).
  2. To access files on the host, set up samba on the host and connect to it on the guest.
  3. I used dmg2img to convert dmg to iso (when needed).
  4. Follow the second post to change the resolution (modify /Extra/ and run VBoxManage setextradata "MacOSX64" "CustomVideoMode1" "1366x768x32" on the host). "1366x768x32" is the resolution on my Toshiba Portege R705 running Ubuntu 10.10. Now I can go fullscreen.
  5. Sound most likely won't work. I have no use for it anyways.

Good luck. I hope I won't have to use it much, but it's nice to do everything in one machine, running inside of Linux (as opposed to having multi-boot).