VirtualBox RAW Disk Access and Microsoft Vista
WARNING
This information is provided with no warranty of any kind-- USE AT YOUR OWN RISK. It is provided here because an answer was not found on the web that was satisfactory short of "reinstall windows". We are not responsible for any data loss or any loss or damages due to your use of this information.
SUMMARY
Using SunVirtualbox it is possible to boot a system in a virtual environment that is already installed on a physical hard disk. Here's how to make that connectivity happen. In this example we were looking to run a virtual instance of XP Pro that was on a hard disk removed from a computer that had died.
Note, however, that Vista blocks write access to all mass storage devices-- "Vista RC2 now blocks write-access to raw disk sectors for user mode applications, even if they are executed with elevated administrative rights," Rutkowska wrote on her Invisible Things blog.
Note, Even with Oracle VBOX 4.1.2 this was still an issue, however we were able to do it within about 20 minutes with VMWARE Workstation 8 and after it was up and running installing vmtools and cleaning up the necessary drivers took about 1/2 a day. Runs great now.
PROCEDURE
- Install Sun Virtualbox on your Vista Host System
- create a batch file that runs the commands to display your disk partitions (you have to create a batch file so you can run the command AS AN ADMINISTRATOR otherwise you won't have permissions
-
"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands listpartitions -rawdisk \\.\PhysicalDrive0"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands listpartitions -rawdisk \\.\PhysicalDrive1"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands listpartitions -rawdisk \\.\PhysicalDrive2"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands listpartitions -rawdisk \\.\PhysicalDrive3"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands listpartitions -rawdisk \\.\PhysicalDrive4
pause - Output will look like this:
-
VirtualBox Command Line Management Interface Version 3.1.2(C) 2005-2009 Sun Microsystems, Inc.All rights reserved.
Number Type StartCHS EndCHS Size (MiB) Start (Sect)1 0x0c 0 /1 /1 1023/254/63 8714 632 0x07 1023/0 /1 1023/254/63 182056 17848215
-
-
- Once you have the correct disk and partition identified then you need to build a batchfile with the following commands to create the "link" in virtual box management tool that creates a link to the physical hard disk you are trying to boot (remember to run as Administrator and make sure you have a place to put the VMDK file and have the correct PhysicalDrive and partition identified before running the commands, the following is only an example):
-
"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands createrawvmdk -filename C:\XP_RAWDISK\hp_pav_pd1_s2.vmdk -rawdisk \\.\PhysicalDrive1 -partitions 2 -register
pause
- You should see a successful message like the following:
-
C:\Windows\system32>"C:\Program Files\Sun\Virtualbox\vboxmanage" internalcommands createrawvmdk -filename C:\XP_RAWDISK\hp_pav_pd1_s2.vmdk -rawdisk \\.\PhysicalDrive1 -partitions 2 -registerVirtualBox Command Line Management Interface Version 3.1.2(C) 2005-2009 Sun Microsystems, Inc.All rights reserved.
RAW host disk access VMDK file C:\XP_RAWDISK\hp_pav_pd1_s2.vmdk created successfully.
-
-
NOTE
DO NOT attempt to access a raw partiton on a disk that is used by your host (Vista) operating system. You will more than likely corrupt your host operating system and the partition you are attempting to access.
You can hide a drive from vista by following this procedure (this was copied from the TechArena Community Forum):
If you are user of Vista Business, Ultimate, and Enterprise editions, than try this steps:-
1. Open the Start Menu.
2. In the white line (Start Search) area, type gpedit.msc and press Enter.
3. If prompted, click on Continue in the UAC prompt.
4. In the left pane, click on User Configuration, Administrative Templates, Windows Components, and Windows Explorer. (See screenshot below step 5)
5. In the right pane, right click on Hide these specified drives in
My Computer and click on Properties
6. To Unhide All Drives :-
-
Dot Disabled or Not Configured and click OK.
-
Go to step 8.
7. To Hide a Drive or Combination of Drives:-
-
Dot Enabled.
-
Click on the drop down arrow and select the drive or combination of drives option that you want to set as restricted (hidden).
-
Click on OK.
8. Close the Local Group Policy Editor window. Your done.
Please see the virtualbox end-user manual for details surrounding the limitations. Specific issues on migrating Microsoft environments are presented in more detail from VirtualBox's own WIKI here: http://www.virtualbox.org/wiki/Migrate_Windows.




