Using Virtualbox With A Raw Hard Drive

If you use VirtualBox and make the hard drive map to a separate real hard drive with a different operating system, you can put Linux and Windows each on their own hard drive, and use VirtualBox to run either one from within the other, while still being able to boot either one when you start your computer.

Here are the instructions: https://superuser.com/questions/495025/use-physical-harddisk-in-virtual-box

When following those instructions, one thing they omit is that you have to run the setup commands and VirtualBox as root / Administrator. At least I couldn't find an alternative that worked.

Another problem I ran into is that with a Windows host, the physical hard drive kept changing, probably when I switched the drives around or did something in the BIOS. This is because Windows references the hard drive by a number (0 or 1 if there are 2 hard drives), rather than by something like a UUID. So you have to be careful not to boot it if the hard drive has changed.

According to this, you can prevent the disks from randomly being reassigned by using the WinObj program to get an ArcName for the disk. I tried doing that with this command:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands createrawvmdk -filename C:\VirtualBoxDrives\raw-linux.vmdk -rawdisk "\\.\GLOBALROOT\ArcName\multi(0)disk(0)rdisk(1)"

So far it seems OK, but I'm skeptical it will work in all cases - maybe that numbering also changes randomly upon rebooting.

Another thing that's useful when using this approach is to have Linux boot immediately if it's being loaded from Windows as a virtual machine guest, rather that popping up grub to ask for the operating system. This question shows how to do this.

Note that using Linux as the host and Windows as the guest seems kind of pointless for playing Windows games, because VirtualBox isn't able to use the full capabilities of the graphics card (source). I tried it but had significant issues.


Homepage   Contact Me