Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to somehow make VirtualBox directly use a raw partition image for a virtual machine?

By raw partition image, I mean a file that contains a byte-by-byte copy of the partition that I would like to boot from.

I'm not looking to boot from a raw disk image, nor am I looking for a way to boot from a VHD (which isn't raw because it contains other metadata).

share|improve this question

This may not be a complete solution to what you're looking for, but you can boot to raw physical disks - if you can mount/masquerade your partition file as a disk, I could see this working. Otherwise, if booting to a physical disk is an option, these are the steps for doing so on a Windows 7 host:

  1. Create a 'mock' VMDK file that points to the physical disk you wish to boot to in your VM ( Note that if you are running windows you need to run both the VirtualBox management interface and command prompt as administrator for this command to succeed.
  2. Attach the mock VMDK to a VM.
  3. Offline the disk in disk management and clear the read-only flag for it using DISKPART ( This ensures the disk is read/write accessible for VirtualBox, but nothing else on your host.

You then should be able to use the physical drive as your guest OS. Super handy.

share|improve this answer

Access disk image via loop device

(Found here:

Step 1: Associate the disk image with a loop device.

$ losetup /dev/loop0 /path/to/usb.img

Step 2: Create a virtual disk and register it with VirtualBox.

$ VBoxManage internalcommands createrawvmdk -filename /path/to/usb.vmdk -rawdisk /dev/loop0

Step 3: Attach the virtual disk to a virtual machine and start it. The virtual machine will access the virtual disk, which now is linked to /dev/loop0, which in turn is linked to the disk image file.

Warning: In order for this to work, VirtualBox needs to be able to access the loop device you created. This means either adding your user to a group that has access to disks (on my Ubuntu machine, this is group “disk”), or you need to run VirtualBox as root. Since I’m messing with disks a lot, I used the first option (that’s why my commands start with $ not #), but I think running just VirtualBox as root is the safer/better solution for most users.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .