Warning: Cannot modify header information - headers already sent by (output started at /home/drkaos/taylorbanks.com/blog/wp-content/themes/gluedideas_subtle/functions.php:7) in /home/drkaos/taylorbanks.com/blog/wp-includes/pluggable.php on line 876
The LTB.log » Ubuntu on the MacBook Pro: Physical, Virtual, or Both?!

Ubuntu on the MacBook Pro: Physical, Virtual, or Both?!


Ubuntu instead of, and in addition to, Mac OS X on a MacBook Pro

MacBook PhysiVirtuBuntu

When I purchased my MacBook Pro, I bought it with the intention of dual-booting into Ubuntu to run VMware Server so that I could run VMware ESX inside of a virtual Machine. Shortly thereafter, VMware Fusion was released, rendering my original intent academic.

Nonetheless, earlier this week I decided to revisit Ubuntu, given that changes since I originally installed it have improved hardware support and the end-user experience significantly. In fact, I’m now running Mac OS X and Ubuntu via dual-boot and using the very same copy of Ubuntu inside of a VMware Fusion virtual machine when I need to run them both side-by-side. Want to do the same thing (or something similar)? Click “Continue reading” below…

Ubuntu on the MacBook Pro

In lieu of regurgitating the process of installing Ubuntu on the MacBook Pro (mine is the Santa Rosa model), I’ll refer you to KnoxWiki’s page on Debian GNU/Linux on Apple Macbook Pro and the MacBookPro/SantaRosa page on the Ubuntu Wiki, which collectively provide thorough details on the process. Once you’ve got Ubuntu running natively on your MacBook, come back here and I’ll show you how to get your real Ubuntu running inside of a virtual machine in VMware Fusion.

Creating a virtual machine to house your natively-installed Ubuntu installation

Note: This process is essentially the same if you’d prefer to run XP or Vista via Bootcamp and boot the same copy of Windows inside of a VMware Fusion virtual machine.

Ok, now that you’ve got Ubuntu successfully installed and running in it’s own partition, it’s time to make that partition available to a virtual machine in VMware Fusion, allowing you to boot the identical linux installation inside of osx.

First, you’ll need to create a new virtual machine, which you can do using Fusion’s New Virtual Machine Assistant. Assuming you used the 64-bit Ubuntu installer, it’s important that you select “Ubuntu 64-bit” on the Choose Operating System dialog. Keep the virtual disk small, as you won’t be needing it after setup. At the final dialog of the VM Assistant, uncheck the “Start virtual machine” box and click Finish.

Next, we’ll need to create a vmdk to represent the physical disk partition on which Ubuntu is installed. To do so, open up Terminal.app (or iTerm, or…), then:

  1. cd into the VMware Fusion app support directory:

    cd “/Library/Application Support/VMware Fusion”
  2. List the partitions on your physical drive:
    ./vmware-rawdiskCreator print /dev/disk0
  3. Create the raw disk mapping for use in our virtual machine:
    ./vmware-rawdiskCreator create /dev/disk0 X /path.to/Ubuntu.vmwarevm/rdm.vmdk ide

    (where X is the number of your linux partition, as identified in step 2, path.to is the path to your newly created VM, Ubuntu.vmwarevm is the VM’s container folder, and rdm.vmdk is the name given to the raw disk vmdk you are creating)

  4. Finally, add references to your newly created vmdk into your VM’s config file (i.e. Ubuntu.vmx):
    ide0:0.present = “TRUE”
    ide0:0.fileName = “rdm.vmdk”

Voilà! Now power on the pseudo-VM, and revel in the glory of your new MacBook/PhysiVirtuBuntu!

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

  • http://wewwl.com Dustin Davis

    Thanks for the walkthrough! this is exactly what I was looking forward to doing.

  • jtw

    This doesnt work for me…when launching the VM I just get a black screen … I’ve done and redone this and confirmed the rdm.vmdk file is in the package. Trying to boot off of my Ubuntu partition into the VM

  • Bruce Wong

    When I bought my macbook the first thing I did was dual boot XP, I found myself in XP way more than on OSX, On my desktop Vaio I ran Dual boot Ubuntu and Vista.

    After a while of thinking I scrapped both XP and OSX and now I use the macbook exclusively for Ubuntu, Its way better than both other OS combined, and makes me feel better about spending so much on a grossly over priced and underpowered macbook.

  • Pingback: Putting Ubuntu on my MacBook Pro. Wish me luck. « …being the blog of Aaron Hefel…

  • PointZero

    When I issued the ‘vmware-rawdiskCreator print’ command, it listed my Linux partition as ‘HFS+’. When I continued with the rest of the steps, after starting the Linux Virtual Machine in VMware Fusion, I would get to the grub shell and then not be able to continue.

    This is what I had to do to get it working:
    - Reboot MacBook Pro
    - At the rEFit screen, invoke the Partitioning Tools
    - The Partitioning Tools will suggest that the partition mentioned above should be labeled as ‘Linux’
    - Accept the suggestion
    - Boot into OS X
    - Remove any files that were previously created by vmware-rawdiskCreator
    - Repeat the steps provided by taylor

    I was then able to start the Linux Virtual Machine successfully. Just FYI, I am using Fedora 8 64-bit.

  • Nigel Simpson

    Thank you for writing this extremely helpful article, Taylor!

    There’s a minor error in the instructions. In VMware Fusion 2.0, when you use vmware-rawdiskCreator to create the raw disk mapping, if you specify the .vmdk file extension then it creates a disk file with the vmdk extension duplicated: xxx.vmdk.vmdk. So the correct command should omit the .vmdk extension:

    ./vmware-rawdiskCreator create /dev/disk0 X /path.to/Ubuntu.vmwarevm/rdm ide

    Thanks again!

  • Edward

    Thanks for the write up. I’m trying with one of the new all-aluminum Macbooks. I follow all the directions and I tell VMWare fusion to boot the newly minted virtual machine and all I get is an attempt to boot off the network, which inevitably fails. Basically, I think something isn’t pointing to the right place. Anyone else run into this? Thanks.

  • Boatzart

    Thanks for the write up, Taylor! Unfortunately when I try to follow your instructions the VM just spits out the following prompt:

    error: no such partition.
    grub rescue> _

    Anyone else have this problem?

  • Harald

    VMware Fusion 3.1.2 on MacBook Pro – same problem with running Ubuntu in VM:

    error: no such partition.
    grub rescue> _

    My setup is triple boot, 5 partitions:
    1: EFI,
    2: OS X 10.6.6,
    3: Windows 7,
    4: Ubuntu 10.04
    5: Data

  • Steve

    Yep same problem

    error: no such partition.
    grub rescue> _

    Anyone else have this problem?