8/21/2013

Booting from external drive in VMWare Fusion

I recently evacuated from my former research lab and therefore I don't have any machine to run ubuntu.  What I have now is a late-2012 macbook pro, so I plan to run my "old" dev env on it.  However, I still favor to use MacOS in most circumstances, and solely using ubuntu on my macbook therefore isn't an option.  My hard drive is a 256gb SSD, it's quite tight, so dual-os system isn't an option either.  I chose to clone everything on my office desktop disk to an external disk (an Seagate GoFlex 1TB USB3.0 external hard drive), and running my old dev env from VMWare Fusion in MacOSX.

The idea is simple, but how to achieve isn't.  The reason is because VMWare Fusion is not official support booting form external drive.  I mean, at least, you ain't able to find this option from its UI interface.  The idea is doable through VirtualBox so I think it should be also possible with a much powerful virtualization solution.  After I googled for a while, the answer is YES.  And here is a mini how-to.


  1. Create a virtual machine in VMWare Fusion.  You can only choose using virtual drive.  It is okay because we will not this virtual drive anyways. (We use "Ubuntu 64-bit" as the name of the virtual machine)
  2. Plug your external drive to your MAC.  Find out the disk number in "Disk Utility", say it's /dev/disk2.
  3. Create a "vmdk" to represent this disk: sudo ./vmware-rawdiskCreator create /dev/disk2 "fullDevice" ~/dev/ubuntu-usb ide
  4. Correct the permission of the newly created vmdk file (it is /dev/ubuntu-usb.vmdk in this example): chown ~/dev/ubuntu-usb.vmdk
  5. edit vmx file of the virtual machine (it should be "Ubuntu 64-bit.vmx" in ~/Document/Virtual Machines.localized/Ubuntu 64-bit.vmwarevm in this example): vim Ubuntu\ 64-bit.vmx
    1. remove lines with scsi0.*
    2. add lines:
      1. ide0:0.present = "TRUE"
      2. ide0:0.fileName = "~/dev/ubuntu-usb.vmdk"
  6. Launch the virtual machine, it should work.

沒有留言: