(This is even more technical than my other technical posts. Consider yourself warned.)
I wanted a dual-boot system between Windows 7 and Ubuntu 9.10 64-bit. I wanted both systems to be fully functional as 64-bit operating systems and have full access to the computer’s hardware. Accomplishing this has been well documented and I won’t bother discussing it. I simply repartitioned the hard drive into two partitions, and then let Windows 7 install on one of them and then installed Ubuntu 9.10 on the other. Grub gives me a choice when the machine boots and defaults to Linux, which is what I wanted. Then I decided I want to run Windows 7 in a VM on the Linux machine, and that I really wanted the VM to run from the Windows 7 partition already created. I had heard this was possible with earlier versions of Windows, so I figured Windows 7 should be no exception (at least if Vista can support such a scenario then Windows 7 should be the same).
I started by reading this, which gave me good guidance, but was the other configuration – Windows as the host and Ubuntu as the guest – I wanted the opposite – Ubuntu as the host and Windows as the guest. That led me to the VirtualBox User’s Guide, which does a great job of describing the process of using Raw Disk access. And finally, I did some perusing of the VirtualBox forums to find a couple specific answers to getting the setup working.
In an effort to help document this scenario, here are the things I did to get it working:
- Read the VirtualBox User’s Guide on Raw Disk Access (here)
-
user@computer:$ VBoxManage internalcommands listpartitions -rawdisk /dev/sda
VirtualBox Command Line Management Interface Version 3.0.8
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x07 0 /32 /33 12 /223/19 100 2048
2 0x07 12 /223/20 1023/254/63 99900 206848
3 0x07 1023/254/63 1023/254/63 70000 204802048
5 0x83 1023/254/63 1023/254/63 65624 348176808
6 0x82 1023/254/63 1023/254/63 2839 482576598 - Notice how there is a 100MB partition (partition 1) – that is the boot partition for Windows 7. This, along with partition 2 are the Windows 7 partitions. Partition 3 is my ‘data’ partition, which is shared between both OSes. All of these partitions need to be enabled for read/write access by me in order for VirtualBox to load them up. I did this by:
user@computer:$ chmod 666 /dev/sda1user@computer:$ chmod 666 /dev/sda2user@computer:$ chmod 666 /dev/sda3
I know this is not the most secure way of doing things, but it works for me.
- Now it is also important that there is a place for Master-Boot Record (MBR) to get loaded from VirtualBox. This is necessary so that when the VM starts up it has an MBR to use – otherwise it will try to use Grub and will fail miserably. To get a ‘dummy’ MBR created I read a couple forum posts (here), and then did the following:
user@computer:$ sudo apt-get install mbruser@computer:$ install-mbr -e12 --force ~/vm.mbr
The -e12 argument means I want the first and second partition enabled in the MBR. This is critical to getting it all to work – otherwise the VM won’t know which partition to enable.
- Now we are ready to actually create the raw disk for VirtualBox to handle, I typed in the following:
user@computer:$ VBoxManage internalcommands createrawvmdk -filename /home/rajat/win7.vmdk -rawdisk /dev/sda -partitions 1,2 -mbr /home/rajat/vm.mbr -relative -register
- Go through VirtualBox, create a new VM, mark it Windows 7 (in my case 64-bit) and save. The VM is ready to be started, but it won’t work entirely yet.
- Set the VM to mount the DVD drive and put in your Vista DVD. Start the VM. Press F12 and select the DVD drive to start (c). Let Win7 setup start, pick a language, and then click the ‘Repair installation’ option. Go through automatic repair, and then let the VM restart. This time it should go into Win7 running off the raw disk.
Let me know if you have any trouble with these instructions, or would like to add to them. Drop me a line to know if these worked for you as well. I can’t wait to use these steps on my other boxes and put Windows in a box while I’m using it.
Update: There is a regression in VirtualBox 3.10 regarding raw disk access. Any machine that boots with raw disk access stops booting using VirtualBox 3.10. Read more about it in the documented bug report. As a workaround simply downgrade to VirtuablBox 3.08 or install the OSE edition. I got hit with this the day after this post went live, downgrading solved the problem for me.
I have been trying to find this sort of detailed guide for a week. Thank you!
Glad this was helpful Kevin. Make sure to downgrade from VirtualBox 3.10, since there is a regression in that release related to raw disk access. See the bug report here: https://www.virtualbox.org/ticket/5355. Let me know how the steps turn out for you and I'd love to hear any feedback you have on them.
Dear rajatarya,
I follow your tutorial, unfortunately I have trouble to repair Seven. I've got a Blue Screen with no useful information (of course ! So easy !), but Windows boot manager give me some clue : Status 0xc000000e – The boot selection failed because a required device is inaccessible. Do you have any idea ?
Thank you in advance
apmsylvain
@apmsylvain
I have also gotten this, but I resolve it by booting up with the Windows 7 DVD and going through the 'Repair' steps. This is an annoying step for actually dual-booting. Since setting this up I have only booted back into Windows 7 a couple times – mostly for testing. I have simply used the Windows 7 instance from within VirtualBox OSE on the Ubuntu installation.
Hopefully this helps, thanks for your comment.
Is there any way to do this without going through the 'repair' step? My laptop has no cd/dvd and I need to dual-boot into one OS or the other frequently. It is not looking promising: https://forums.virtualbox.org/viewtopic.php?f=7&…
I ran into the same problem (it has to do with how the VirtualBox MBR deals with the drive geometry) and found that if I configured the virtual disk without the -mbr switch it used the MBR on the host. I had Windows on the first partition and Linux on the second partition. If I gave the virtual machine access to both partitions it could load menu.lst from the Linux partition and I could boot cleanly into Windows.
I was afraid that some day I might accidentally boot into Linux, which would be really ugly since it would be trying the boot the same OS the host was running and almost surely cause corruption. So as a trick I created a boot floppy image with grub for the Windows VM and changed the menu so Windows was the only choice. I attached this image to the VM, made sure it the boot order had the floppy first, and now I can boot Windows cleanly either natively or through VirtualBox.
Yes, it did work for me like described here!
I tried following your suggested steps but I'm getting a BSOD when I try to run the Windows partition, even after repairing the Windows 7 install from the DVD. Here's my partition layout according to VBoxManage:
VirtualBox Command Line Management Interface Version 3.0.8
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x07 0 /32 /33 162 /162/2 1200 2048
2 0x07 162 /162/3 1023/239/63 64913 2459648
5 0x83 1023/239/63 1023/239/63 44053 135414783
6 0x82 1023/239/63 1023/239/63 1926 225635823
3 0x07 1023/239/63 1023/239/63 10000 229586944
and according to fdisk:
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x02f2e53c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 154 1228800 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 154 8429 66471262 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 14292 15566 10240000 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4 8430 14291 47083680 5 Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5 8430 14046 45110488+ 83 Linux
/dev/sda6 14046 14291 1973128+ 82 Linux swap / Solaris
Does it make a difference that my partitions aren't aligned on cylinder boundaries? I've read that this isn't ideal for other performance reasons (it's a 128GB SSD), but I didn't think the partition alignment would affect the ability to load the raw W7 partition.
I also tried DParker's suggestion of making the Linux partition accessible to VBox, and I did indeed get the grub menu to show up, but selecting the Windows partition caused an immediate crash.
Any advice?
I used this technique. However, when ever I switch from VBox to Native boot (or the reverse) I must do a repair. In the case of native it does the repair on boot, and then does a second boot. In the case of VBox it requires the DVD image to do the repair and reboot. Either way its painful.
Is there a way to avoid the repair on each switch?
Same here. I am not bothered by the native boot self-healing itself, but that would be nice the other way around too. Is it maybe possible to install a recovery console to the same partition too, as it worked with XP?
Hi Rajat,
Firstly thanks for the post. I am researching this process and your guide/post is the best I have found. I too want to have ubuntu as the host and Windows as the guest. At present I have just windows 7 installed, and I am on the verge of repartitioning the hard disk and installing Ubuntu. That is one to ponder eh? Well, I have a couple of questions for you:
You dont mention your system specs. I have a 32 bit dual core @ 2.0 laptop with 4 gig of ram. How much did you put aside in Virtualbox for the 7 VM to get comparable performance to when 7 runs in standalone mode?
I see a few folks have made comments about having to run the 7 repair app on standalone or vm restart. Have you overcome this? D Parker's comments looks great – but I'll need to reread it a few times to follow it. Lastly, how easy was it to downgrade virtualbox?
Thanks in advance,
John
John – Sorry I have not had a chance to update these steps with the added
instructions in the comments – I hope to get time this coming weekend to get
the dual-boot to work without the repair step. In terms of the downgraded
VirtualBox – you should be able to use 3.0.12 and forward – the fix is
included in that version.
Hope this helps and thanks for reading.
Rajat
Thanks for reply Rajat – I look forward to reading the write up.
Note: if you use VBox 3.1.2, then the regression is gone again, no need to downgrade.
Note: if you use the version which is not fully open source but still freely available (and has USB support as well), then you do not need the insecure chmod-ing above either. You only need to add your user to the vboxusers and disk group in /etc/group (line looks like: vboxusers:x:121:sape). In my system (Ubuntu Karmic) ls -l /dev/sda* shows:
brw-rw—- 1 root disk 8, 0 2010-02-03 15:54 /dev/sda
brw-rw—- 1 root disk 8, 1 2010-02-03 15:54 /dev/sda1
brw-rw—- 1 root disk 8, 2 2010-02-03 16:30 /dev/sda2
brw-rw—- 1 root disk 8, 3 2010-02-03 15:54 /dev/sda3
brw-rw—- 1 root disk 8, 5 2010-02-03 15:54 /dev/sda5
brw-rw—- 1 root disk 8, 6 2010-02-03 15:54 /dev/sda6
I can't get mine to work…I have Ubuntu 9.10/VB 3.1.4r57640. I added myself to the disk group and vboxusers group. I have the same setup as you do, a dualboot with windows 7 enterprise and ubuntu9.10. Ubuntu9.10 is my host os. I have all on sda with sda1-win7 100MB part sda2-win7 87G. I get all the way to booting the system and trying the recovery stuff. The recovery claims that it fails and I get these errors. https://imagebin.ca/view/vyhycT.html and https://imagebin.ca/view/yvoZZd.html. Someone on #vbox said that it may mean that win7 doesn't know how to access the vmdk. At this point I am very lost and not sure what to try next. Thanks.
Is there a typo here?
You said:
Set the VM to mount the DVD drive and put in your Vista DVD. Start the VM.
What does a Vista DVD (instead of a Windows 7 DVD? ) have to do with this?
Or, I missed something here?
I can't get mine to work…I have Ubuntu 9.10/VB 3.1.4r57640. I added myself to the disk group and vboxusers group. I have the same setup as you do, a dualboot with windows 7 enterprise and ubuntu9.10. Ubuntu9.10 is my host os. I have all on sda with sda1-win7 100MB part sda2-win7 87G. I get all the way to booting the system and trying the recovery stuff. The recovery claims that it fails and I get these errors. https://imagebin.ca/view/vyhycT.html and https://imagebin.ca/view/yvoZZd.html. Someone on #vbox said that it may mean that win7 doesn't know how to access the vmdk. At this point I am very lost and not sure what to try next. Thanks.
Is there a typo here?
You said:
Set the VM to mount the DVD drive and put in your Vista DVD. Start the VM.
What does a Vista DVD (instead of a Windows 7 DVD? ) have to do with this?
Or, I missed something here?
[…] https://forums.virtualbox.org/viewtopic.php?f=2&t=31759 website/taming-windows-virtualbox-vm […]
I'd like the answer to this as well since I don't see how repairing with Vista is going to help out my Windows 7 installation.
Have you had any luck with 3.2.8? The bug report seems to be closed.
Did you figure out a fix for this? I am running into the same problem.
If you guys are getting an error (ie, when running on Dell hardware), then what you need to do is to enable the Msahci drivers that are disabled at install. See https://support.microsoft.com/kb/922976 for more information.
Great post, just what I was looking for. Unfortunately I am having trouble with the MBR. My setup is like yours, but without shared data partition, and Ubuntu 10.10.
If your host OS is Ubuntu, you have to add the user to the group “disk”.
So I did this and something got hammered on my system. Anyways, booting normally into Windows 7 (with a repair) got Windows 7 working on it’s own. However, my disk changed. The 100megabyte partition disappeared now my drive starts with /dev/sda2. It seems the mbr can not find the disk now, should I be using -e2 or -e1?
Thx for the hints, my virtual machine now works fine, only when I boot into the native Win7 the mouse doesn’t work properly anymore (it’s miss-behaving without any input!) – any ideas?
Thx & Cheers,
Michael
Thanks Parker. That really helps a lot.
I get a blue screen when starting windows 7,
“A problem has been detected and windows has been shutdown to prevent damages”
I followed the tutorial and everything worked fine until the final step, any ideas?
Are you now able to alternate between booting natively and booting in a VM without having to repair?
Thanks D Parker this worked for me but with some minor changes. Since it toke me almost a day to make everythin work I will write some short notes about how I did.
1. Add group disk to your user
sudo usermod -a -G disk myusername
2. Logout to make this change work.
3 My partitions is a bit messy but here it is:
$ VBoxManage internalcommands listpartitions -rawdisk /dev/sda
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8_OSE
(C) 2005-2010 Oracle Corporation
All rights reserved.
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0xde 0 /1 /1 4 /254/63 39 63
2 0x07 5 /25 /21 17 /216/7 100 81920
3 0x07 17 /216/8 1023/254/63 79900 286720
5 0x83 1023/254/63 1023/254/63 19072 163923968
6 0x83 1023/254/63 1023/254/63 196594 202985472
7 0x82 1023/254/63 1023/254/63 953 605612032
8 0x0b 1023/254/63 1023/254/63 8582 607565824
$ fdisk -l /dev/sda
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x77e3ed41
Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 * 6 18 102400 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 18 10204 81817600 7 HPFS/NTFS
/dev/sda4 10204 38914 230608897 5 Extended
/dev/sda5 10204 12636 19529728 83 Linux
/dev/sda6 12636 37698 201312256 83 Linux
/dev/sda7 37698 37820 975872 82 Linux swap / Solaris
/dev/sda8 37820 38914 8787968 b W95 FAT32
4. Partition 5 is not required at the end but before the grub image is created the native grub have to know about partition 5 when booting over vm.
$ VBoxManage internalcommands createrawvmdk 2.-filename /home/mans/virtualbox/win7.vmdk -rawdisk /dev/sda -partitions 2,3,5 -register
5. This is all the steps to create a grub image that then can be mounted over vbox. I never managed to understand how D Parker created a floppy image with grub since grub-mkrescue seem to have removed that option.
mkdir iso
cd iso
mkdir -p boot/grub
cd boot/grub
#disable all boot options except windows 7 option
sudo chmod -x /etc/grub.d/10_linux
sudo chmod -x /etc/grub.d/20_memtest86+
create a new grub.cfg file
sudo grub-mkconfig > grub.cfg
#change the grub options back
sudo chmod +x /etc/grub.d/10_linux
sudo chmod +x /etc/grub.d/20_memtest86+
#create a grub CD image
sudo install xorriso
grub-mkrescue –modules=”linux ext2 fat fshelp ls boot pc ntfs” –output=/home/myusernam/virtualbox/grub2.iso iso/
6. To add the grub CD image to the Vbox start Vbox and go to File->Virtual Media Manager and click on CD/DVD image tab and add your newly created grub iso. Click on settings for your windows 7 vm and choose Storage and then add an IDE Controller and select your grub.iso file in CD/DVD Device drop down box.
Thats it now you can safely run windows 7 both natively and as a guest OS through VBox without worrying about the issue stated by D Parker
maybe not so short 🙂
Yup!!! I elaborated more on what Parker explained here:
https://www.researchut.com/site/virtualbox-native-partition
Great post!!! But I tryed everything and the best I acchieved was a Starting Windows screen running forever.. :S
Any tip? I’m running dualboot with Windows 7 Pro 32bits and Ubuntu 10.04 32bits, with VirtualBox 4.0.4.
Before you ask me to change the VB version I advice you that I’ve already it done… I tryed 3.12, 3.10 and 3.8 build releases, and OSEs too.
Thanks,
Tony
——————
Here are some extra informations:
$ fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x08000000
Device Boot Start End Blocks Id System
/dev/sda1 1 14 112423+ de Dell Utility
/dev/sda2 * 15 1292 10258432 7 HPFS/NTFS
/dev/sda3 1292 12118 86961668+ 7 HPFS/NTFS
/dev/sda4 12118 60802 391053313 5 Extended
/dev/sda5 12118 59676 382009344 83 Linux
/dev/sda6 59676 60802 9042944 82 Linux swap / Solaris
$ VBoxManage internalcommands listpartitions -rawdisk /dev/sda
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0xde 0 /1 /1 13 /254/63 109 63
2 0x07 14 /5 /56 1023/254/63 10018 225280
3 0x07 1023/254/63 1023/254/63 84923 20742144
5 0x83 1023/254/63 1023/254/63 373056 194666496
6 0x82 1023/254/63 1023/254/63 8831 958687232
About partitions:
sda2 –> Windows 7 Pro 32bits (RecoveryImage)
sda3 –> Windows 7 Pro 32bits
sda5 –> Ubuntu 10.04 LTS 32bits
Hello René,
I did everything mr Rajat, mr Ritesh and mr Noramans told us to do in preview posts. I tryed:
– create a MBR + vmdk image and repair the boot with DVD
– create a vmdk image of my disk and a specific grub for boot only W7
– create a vmdk image of my disk with my original grub support (and choose W7 manually)
Summarizing… I tryed everything that is told here but no success. The “Starting Windows” screen forever persists. :S
I think the problem is with Windows7 because in all cases I booted the base system, but it stops the execution on Starting screen. I tryed to run MergeIDE on W7 because I read in some place that some registries need to be changed. But the result was the same.
Any idea?
Tony
BTW
HOST : Ubuntu 10.04 32 bits
GUEST: Windows 7 Pro 32bits
I added my user to disk group =) No success =S
In my case this was caused by wrong bios SATA mode setting. I installed windows 7 with bios SATA mode set to RAID so windows installed only RAID drivers. Since VM is using AHCI mode to access harddisks, windows doesn’t have proper driver installed for it. Microsoft has made a fix for this https://support.microsoft.com/kb/922976, you must run this fix before changing SATA mode to AHCI or running VM in AHCI. Still I recommend changing the bios setting to AHCÍ before even installing windows.
Thanks for your help, other guides didn’t mention the trick of creating an MBR file. Now I managed to boot (this way I bypass GRUB and don’t get an error. I’m at the 7th step. I have Win 7 x64. Why do you mention Vista DVD? You seem to have also a Win7. I don’t have an installation CD, how can I overcome this step?
Doesn’t matter which one you use tbh, the point is to run the startup repair option which simply overwrites the mbr with a vista/win7 compatible bootloader. Both vista and win7 install / repair disks will work fine.
I have been having the same issues as apmsylvain – blue screens when trying to boot windows- but am not able to resolve it. I tried the repair route, but receive the message “Startup Repair cannot repair this computer automatically”. I tried changing the controller from SATA to IDE, but had no luck with that either.
The host is Ubuntu 11.04 running Vbox 4.0.12 and the windows version that I am trying to do the raw device map from is Windows 7 64bit.
Any suggestions would be appreciated.
I’d really love to try this, but before I do – how much of this might be different in VirtualBox 4.1.2 (it’s been a while)?
It is a BAD BAD idea to add yourself to group disk. Many bad things can happen and it would be a great vector for viruses. Create a new user, add them to the group disk and then run the vm as that user. Here is my script (based on another found on virtualbox) that automates this. Just create the user virtualbox and use this script.
#! /bin/bash
# Windows 7 VM boot script for VirtualBox 4.x– you’ll have to always use it instead of running VirtualBox
VBUSER=virtualbox # name of custom account created (which is a member of disk group)
VM_NAME=Win7 # name of virtual machine
wait_for_closing_machines() {
RUNNING_MACHINES=`sudo -u $VBUSER VBoxManage list runningvms | wc -l`
if [ $RUNNING_MACHINES != 0 ]; then
sleep 5
wait_for_closing_machines
fi
}
sudo chown -R $USER:users /home/$USER/.VirtualBox # make sure $VBUSER will be able to access VirtualBox settings etc.
# we use sudo because $VBUSER creates files with its ownership on previous runs
sudo chmod -R g=u /home/$USER/.VirtualBox # $VBOXUSER permissions should be the same as ours
sudo chown -R $USER:users /home/$USER/VirtualBox VMs/$VM_NAME # ditto for VirtualBox VMs directory.
sudo chmod -R g=u /home/$USER/VirtualBox VMs/$VM_NAME
xauth extract /home/$USER/cookieTmp $DISPLAY
chmod g+r /home/$USER/cookieTmp
sudo chmod g+x /home/$USER/
sudo -u $VBUSER XAUTHORITY=/tmp/.Xauthority_$VBUSER xauth merge /home/$USER/cookieTmp
rm /home/$USER/cookieTmp
sudo -u $VBUSER DISPLAY=:0 XAUTHORITY=/tmp/.Xauthority_$VBUSER VBOX_USER_HOME=/home/$USER/.VirtualBox VBoxManage startvm $VM_NAME
#sudo -u $VBUSER DISPLAY=:0 XAUTHORITY=/tmp/.Xauthority_$VBUSER VBOX_USER_HOME=/home/$USER/.VirtualBox virtualbox
echo “Waiting for shutdown of $VM_NAME”
wait_for_closing_machines
echo “$VM_NAME shutdown. Resetting permissions.”
sudo chown -R $USER:users /home/$USER/.VirtualBox # make sure $VBUSER will be able to access VirtualBox settings etc.
# we use sudo because $VBUSER creates files with its ownership on previous runs
sudo chmod -R g-rw /home/$USER/.VirtualBox/* # $VBOXUSER permissions should be the same as ours
sudo chown -R $USER:users /home/$USER/VirtualBox VMs/$VM_NAME # ditto for VirtualBox VMs directory.
sudo chmod -R g-rw /home/$USER/VirtualBox VMs/$VM_NAME
Great Post, many thanks.
I did it all step-by-step and all went smooth up to the point 6.
When trying to create a new virtual machine in the VB it refuses to pick up the created win7.vmdk file with the following error/.
Any idea what I’m doing wrong?
p, li { white-space: pre-wrap; }
p, li { white-space: pre-wrap;
Failed to open the hard disk /home/xxx/win7.vmdk.
The medium ‘/home/xxx/win7.vmdk’ can’t be used as the requested device type.Deatails show the following:
p, li { white-space: pre-wrap; }
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
Medium
Interface:
IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee:
IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}
[…] Taming Windows 7 in a VM […]
I am getting errors when I run your 5th step. It says that -register is an invalid argument. I’m using Ubuntu 11.10 and VB 4.1.4, so I’m guessing the -register argument has been deprecated.
Can both your main OS and the virtual machine both access your data partition (partition 3) at the same time? If so how? This is exactly what I’ve been looking for.
You can’t mount a partition in both the guest and host. But there is a workaround using shared folder. Mount the partition in host OS (oreferably) and use it as shared folder in guest OS.
6.5 set vm to use IO APIC
thank you for this guide, works for me
only have 1 problem.. i have to run virtualbox as root to be able to see or use the virtual machine.
i had to run it as root to add the virtual disk image, even after changing the file owner couldn’t add is as normal user, keeps getting an error
I did this with XP once and was trying to remember how it went. The one thing I remember that I don’t see here is when I did it I first copied the Hardware profile. Then I booted the VM off the copy so the repair “fixed” the drivers under the copied hardware profile and left the original intact. That way I could boot the physical XP in the VM and normally just by switching profiles. I don’t know if this is relevant in 7 or not but I wanted to bring it up anyway.
Infinite repair loop solution.
You can use bcdedit to add a second item in the Windows boot manager menu. The Windows boot manager then will show you a menu with a list of boot options (one for Native boot and one for VBox boot). Each menu item is associated with a boot loader entry in the BCD Windows registry.
A boot loader entry can be created manually (using bcdedit) or automatically by the repair procedure.
To append the new boot loader entry to the menu, you can use
bcdedit /displayorder {ID} /addlast
where ID is the GUID of the boot loader entry.
So, to solve the infinite repair loop problem you can:
– Boot with VBox and follow automatic repair from Windows Installation DVD. This creates the boot loadere entry and makes it the deafult boot option. At this point Native boot would not work because the default boot option is not applicable to Native boot.
– Boot again VBox with Windows Installation DVD inserted and choose Repair your Computer/Command Prompt.
type: bcdedit
you will see the boot manager entry and the default boot loader entry
type: bcdedit /enum all
you well se all the entries. Search a boot loader entry whose device and osdevice properties are set to “unknown” (there can be more than one, if you have used automatic fix many times) and copy its ID.
type: bcdedit /displayorder {ID} /addlast
Now you have added a new item to the boot menu.
type: bcdedit
you will see one boot manager entry (whose displayorder property now contains two values) and two boot loader entries.Optionally, change boot loaders descriptions by using bcdedit.
– Boot natively, select the correct boot menu item and … well, this worked for me!
Hope this helps.