| VirtualBox using physical bootable partition |
|
|
|
| Written by Administrator |
| Sunday, 02 November 2008 22:00 |
|
I recently reformated my laptop hardrive to use ArchLinux instead of Gentoo. So I decided to make a special partition to run WinXP natively as well as under virtualbox. I just explain a little the steps I followed to make it working...
Partitionning First, you need to partition your harddrive correctly. That is to say that any bootable partition must be primary. As a simple example here is my partition scheme for a 160Gb drive: /dev/sda1 : Primary, /boot (ext2fs, 180 Mb) As you can see, I use /dev/sda4 as my windows XP partition. A Virtual disk as partition wrapper Virtualbox is not able to use physical partition easily out of the box. In fact you have to create a fake disk image that define how to access the physical partition. Making a pseudo MBR If you want to make the partition bootable you will need to make a pseudo MBR (Master boot record). The package "ms-sys" contains the tool to build one: pacman -S ms-sys # install ms-sys package touch ~/.VirtualBox/WindowsXP.mbr # the file that will receive the MBR must exists... ms-sys --mbr -f ~/.VirtualBox/WindowsXP.mbr # create a MBR and store it in a file Making the fake disk imageTo do so, open terminal and be sure that your user is part of the "vboxusers" and "disk" groups. Then use VBoxManage (for /dev/sda4): VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/VDI/winxp_sda4.vmdk \ -rawdisk /dev/sda -partitions 4 -relative -register -mbr ~/.VirtualBox/WindowsXP.mbr just after "-filename", you can see the virtual disk file that will represent the VirtualBox disk. Using the new partitionCreate a new virtual machine and choose the existing harddisk we just created. When the VM wizard has finished, select the VM and edit its setting to turn on "IO APIC". You can install windows XP either using the VM or booting natively. As soon as Windows is installed, go to settings / system and open the hardware list windows. find the IDE controller and change the driver to be the "generic IDE". Then, create a new hardware profile. You can reboot the computer or th VM. You will now have to choose the profile to use before booting. Now you can install all needed drivers for each profile, but do not try to boot VirtualBox with the profile used for the hardware boot, else it wont work (and vice-versa). |
| Last Updated on Sunday, 02 November 2008 22:56 |



I rebooted my machine and chose to start from the newly created aditional boot.ini entry. The Windows logo with the loading bar apears for a brief moment, then I get a bluescreen for a brief moment and my laptop restarts. Windows starts normally from vBox though. I have tried to reinstall Win, but same problem. Maybe I should try by formating the partition with linux first and then reinstall, but I don't think it'll be successful.
If you can gain access to the boot.ini file, check sections [boot loader]
and [operating systems], then try to change disk and/or partition number
However, using this method, when the installer restarts the first time windows won't boot saying that \system32\hal.dll is missing or damaged.
Any ideas?
In terms of speed; it is probably faster that a classical Harddive file because we use a true partition here.
And finaly yes you can use seamless mode. In fact you can use all virtualbox features.