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

I have two partitions on my hard drive, one for Windows and one for linux. I would like to use VirtualBox in Linux to boot the Windows partition as a virtual machine. How can I acheive this?

share|improve this question
If you're planning to sometimes boot the partition physically and sometimes virtually, be aware that this isn't easy to set up. Windows doesn't like having the hardware changed underneath it. – Harry Johnston Jul 20 '12 at 21:48

There's actually a really easy solution to achieve this. The following process will create a virtual disk (.vmdk) that will boot to a designated drive/partition. You essentially "fake" boot directly to the drive so the created virtual drive isn't very big in size and it doesn't get any bigger.

However, a downfall to the following suggestion would be that it boots virtually. Meaning, you can run any programs or files that are on it but once in the Virtual Machine, settings/program changes can't be made on the physical drive. If you wanted to add programs, updates, etc... you would have to normally boot to the drive, make desired changes, then boot from the VirtualBox. I don't know if this is a deal breaker for you but here's the goods.

Part of this example is for doing it in Windows because I don't know the Linux directory structure and path variables by heart but the VirtualBox command will be the same, regardless of Host OS. Same process just supplement the OS commands accordingly

1: WindowsKey + R > Type diskmgmt.msc Make note of the disk number of the drive you're trying to virtualize. Linux alternative for figuring this out would be running one of the following utilities > fdisk, lsblk, gparted

2: Open a CommandPromptTerminal with Admin/Sudo privileges > type cd %programfiles%\oracle\virtualbox. I don't know what the default directory path for VirtualBox is in Linux distros but simply find it and cd to it.

3: Run the following VirtualBox command: VBoxManage internalcommands createrawvmdk -filename "%USERPROFILE%"\.VirtualBox\CUSTOMNAMEOFVHD.vmdk -rawdisk \\.\PhysicalDrive#

~ Replace "CUSTOMNAMEOFVHD" to whatever you would like. You can also change the entire path of that file to something else. It's simply telling VBoxManage where to put the created .vhd

~ Change the last character # do the disk drive number recorded in step 1.

Windows Tutorial:

Ubuntu Specific Example:

share|improve this answer
Useful to mention that to use this new .vhd, "VirtualBox Manager" must be started with administrative privileges, because accessing raw devices requires this. – macmadness86 May 17 at 8:31

I love virtualbox

but normally you can't just all of a sudden virtualize a physical windows computer into a virtual one by just reading the hard drive from Virtualbox. (experience and source) Tapped-out's solution seems easier, but I don't think you will boot successfully. You may want to try it first though. Hopefully your windows install doesn't get corrupted when it tries to load all new drivers, etc. but it will probably just BSOD immediately.

If tapped-out's solution doesn't work, go ahead and try this.

Use the vmware standalone converter tool: Make sure you have vmware player (free) installed also.

VMware standalone will let you convert a virtual machine, running physical machine, or an acronis true image backup to a virtual machine. It will also do something to all the drivers so that your machine will work virtually.

  1. if you tried tapped-out's solution, point vmware-converter at at that virtualbox vm you created there. vmware-converter will read it, convert it to a virtual machine, fix the drivers, and install it in vmware player. From there you can convert it to virtualbox format if you want, or just use player.

  2. If you didn't try his solution, or if option 1 did not like the rawdisk read and failed, Virtualbox has a really good article, on converting a real windows install to virtualbox, using linux.


  • Install MergeIDE on the windows machine first
  • cat /dev/sdg | VBoxManage convertfromraw stdin OutPutFile.vdi NUMBEROFBYTES
  • add drive to virtualbox and create new vm
share|improve this answer

From chapter 9 of the VirtualBox manual:

To create a special image for raw partition support (which will contain a small amount of data, as already mentioned), on a Linux host, use the command

VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1,5

This example would create the image /path/to/file.vmdk (which, again, must be absolute), and partitions 1 and 5 of /dev/sda would be made accessible to the guest.

For example, if your hard drive is /dev/sda/ and the Windows partition is /dev/sda2, the command you use might look like:

VBoxManage internalcommands createrawvmdk -filename ~/windows.vmdk -rawdisk /dev/sda -partitions 2

This would create a file, windows.vmdk, in your home folder, which you would then mount in the virtual machine.

share|improve this answer
This may work if you install first. Cool idea for sure. – MattPark Jan 2 '13 at 20:11

You must log in to answer this question.

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