How to use virtual box on a real drive (not vdi)

Ok, be really careful with this since you can easily lose your data :
You can boot or use a real drive (not a vdi file) with virtualbox using a VMWare disk image (vmdk).

The VMware disk image format usually stores data within a file (similar to the vdi file format) but can also use a raw device like a real drive which is what we want here.

To create a vmdk image using a raw device, you can use VBoxManage :

VBoxManage internalcommands createrawvmdk -filename /Users/myusername/Library/VirtualBox/VDI/raw-disk.vmdk -rawdisk /dev/disk0s3

A few things to know :

  • This is dangerous for your data since you can easily boot your current system drive : this will probably kill your OS install
  • You’ll get access to the existing data of the disk (no format needed)
  • MBR is stored in the vmdk file, you cannot create a bootable drive this way
  • MBR is read from the vmdk file, you’ll have to fix it once in virtualbox in order to boot an existing system from the disk
  • On MacOSX, you can only use a drive with no OSX readable partitions on it (ext3 is ok). If one partition is mounted, you’ll not be able to create or use the vmdk image

(You’ll find all details in the VirtualBox user manual)

  • Oma Eusebia

    Wow, this is great! Thank you a lot!