Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.


  Search this Thread
Old 09-20-2012, 11:29 PM   #1
Senior Member
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,394
Blog Entries: 7

Rep: Reputation: 164Reputation: 164
Help boot Windows partition through Virtualbox

Hello, i've recently upgraded my hard drive and now for the first time in a year and a half, have partition for Windows. It is Windows 7. I primarily use Gnu/Linux. I would like to be able to boot up my windows 7 partition in virtualbox instead of making a fresh install primarily for vbox.
I have been googling and found several tutorials stating much the same thing. I have found issue with all the tutorials and would appreciate it if some people with experience doing this would kindly help me by providing some instructions. My Windows partititon is on /dev/sda2.

My issues with the tutorials i've read is they seem to cater for Ubuntu and require installing a package called 'mbr' (for faking the mbr in the vm or something) I am currently running Opensuse and there's no 'mbr' package available in our repo.
Another issue i've had is some of the tutorials instruct you to emulate the entire drive instead of just the one partition. I don't want to do that unless i have to.

Thanks for your help and suggestions.
Old 09-21-2012, 03:46 PM   #2
Registered: Mar 2008
Posts: 15,522

Rep: Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240Reputation: 2240
Well, the issue is hal or hardware abstraction layer. Windows 7 would require you to at least fix it. Or you may not even be allowed to authenticate it if you have an OEM tied to your computer.

I personally would not boot to a real partition. I think you actually you need two, a 100M is needed.

I'd convert it to a virtual machine with some P2V app.
Old 11-13-2012, 07:41 AM   #3
Senior Member
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,394
Blog Entries: 7

Original Poster
Rep: Reputation: 164Reputation: 164
Alright guys. It's taken me this long to get this sorted out once and for all. This worked for me but it may not for others due to me having a boot partition which chainloads everything.

The following was done on Debian Wheezy (currently testing in freeze) Virtualbox installed from repos, version 4.1.18.

# vboxmanage internalcommands createrawvmdk -filename /home/<user name>/windows.vmdk -rawdisk /dev/sda
This makes the vm file, but it is of the whole hard drive, not just the Windows partition. I had to do it this way because i couldn't get it to work with only the Windows partition. Doing this, you are going to want to make sure you don't boot the linux partition currently running.
# chown <user name>:users /home/<user name>/windows.vmdk
# usermod -a -G disk <user name>
The chown command will change the user group of the created .vmdk file from root to you.
The usermod command puts you in the disk group, you need this or it won't work.

Open virtualbox, select 'New', continue with the propts, naming it windows, and making windows the os ect.
Windows 7 apparently needs at least 512MB of ram, so make sure that requirement's filled.
Once you're at the 'Virtual hard disk' part, select 'use existing hard disk'. select the one created earlier, and it should all be good. Some people have said you need to open the settings of the windows vm and allocate at least 50Mb of ram for video; but i have it running fine on just 18Mb.
Once the vm is created, reboot you computer into Windows and run the .reg file that can be downloaded from below.
This will modify the Windows registry so that windows won’t check hard drive structure upon start-up and won’t fail if it's changed.
I can not say if the vm will boot without this, because i did a lot of trial and error and have not tried this method absent of this step.
Boot back into linux and try to run the vm.
It will boot up your bootloader and then into Windows, (I've changed my default os to Windows, so that i won't accidentally boot my running Gnu/Linux os in virtual box and cause data corruption. I don't shutdown much anyways)
When i boot Windows in the vm, it showes the Windows7 splash screen and then a black screen with a movable mouse cursor. It doesn't seem to be doing anything, but if i wait long enough it eventually boots into Windows 7.
I hope this has helped anyone else looking to do the same as me.

Thank you jefro for your suggestions.

As an additional note:
due to virtualbox registering as different hardware, Windows will require reregistration under the virtual machine. I own a license for Windows 7 on my machine, and could not find any way possible in fooling Windows into thinking it was the same hardware, even though technically it is. I do not condone pirating, but i used a program often used to pirate Windows, in order to re-register my legal version of Windows under the vm. This has not affected Windows when i do a native boot. This was a last resort for me, but i couldn't find another way. If you run other proprietary software under Windows, that requires registration, you will probably have to do something similar for that too.

Last edited by Knightron; 11-14-2012 at 07:51 PM. Reason: fixing errors and adding additional notes
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Windows boot partition got unallocated after resizing partition mike54 Linux - Newbie 5 10-28-2011 03:18 PM
Running a Windows partition through Virtualbox Completely Clueless Linux - Virtualization and Cloud 3 03-18-2010 05:34 PM
dual boot - Grub won't boot Windows on /windows/D partition biosol SUSE / openSUSE 9 04-09-2006 09:14 PM
Messed up partition table and Windows' partition boot sector pyromithrandir Linux - General 32 04-08-2006 01:26 PM
Deleted linux partition, how to boot Windows partition? mysak Linux - General 3 12-14-2005 05:22 PM

All times are GMT -5. The time now is 11:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration