Accessing Windows Vista Partition (Raw Partition with VMDK)

Discussions related to using the OSE version of VirtualBox.
Post Reply
Trent0r
Posts: 4
Joined: 8. May 2009, 03:38
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

Accessing Windows Vista Partition (Raw Partition with VMDK)

Post by Trent0r »

Hi, I have been reading some of the posts here on the Virtual Box forum and I have been struggling with a specific problem. I know this has been done before, for some reason what I am doing is not working.

I am trying to run my Vista partition within virtual box, as per these old forum posts:

http://forums.virtualbox.org/viewtopic. ... isk+access
http://forums.virtualbox.org/viewtopic. ... aterawvmdk

My vista partition is /dev/sda2, and I have tried running the following commands and nothing seems to work. For a while I did have it auto mounted as read only using fstab, but I know you cant run the virtual machine and have it mounted at the same time so I commented it out in fstab.

Code: Select all

sudo su
umount /dev/sda2
chmod 666 /dev/sda2
VBoxManage internalcommands createrawvmdk -filename /home/trent/.VirtualBox/WinVista2.vmdk -rawdisk /dev/sda2 -relative -register
chown trent:users /home/trent/.VirtualBox/WinVista2.vmdk
I have gotten to the point where VirtualBox will acctually recognize the partition, however when I start the virtual machine nothing happens, it just stays at the black screen.

Thanks, if anyone has any advice, I'd love it.

Trent
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Accessing Windows Vista Partition (Raw Partition with VMDK)

Post by TerryE »

Remember that the MBR is virtualised and if you are using a Grub loader or the MBR is referencing the other partitions, it will get confused as VBox reads these as 0s. Boot your VM either with a Windows recover disk or a Linux Live CD, install a windows MBR bootstrap and set the Vista partition as active. The MBR in the VMDK is virtualised so this won't change the real one on the actual disk. Only R/W to the partition 2 are passed through to the real disk.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Trent0r
Posts: 4
Joined: 8. May 2009, 03:38
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: Accessing Windows Vista Partition (Raw Partition with VMDK)

Post by Trent0r »

TerryE wrote:Boot your VM either with a Windows recover disk or a Linux Live CD
Either or? If I use a windows one I would be installing the windows boot loader and if a Linux Live CD, well I don't know how to install grub just from the CD
TerryE wrote:install a windows MBR bootstrap
Would the windows disk 'repair' function do this?
TerryE wrote:set the Vista partition as active
Don't know what you mean here, active in the sense of

Thanks

Trent :roll:
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Accessing Windows Vista Partition (Raw Partition with VMDK)

Post by TerryE »

My point is that both the Windows recovery disk and a Linux Live CD boot from the CD without needing to install anything. A BartPE disk would do just as well. They are just a way for installing a windows bootstrap and activating the sda2 partition. If you boot the Windows disk in recovery mode, there are commands to do the FIXMBR and activate the partition.

If you want to understand what activation means then the wiki MBR article and related ones explain.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Trent0r
Posts: 4
Joined: 8. May 2009, 03:38
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: Accessing Windows Vista Partition (Raw Partition with VMDK)

Post by Trent0r »

Ok, so would doing the following solve my problem:
  • Using my Ubuntu 9.04 CD
    Starting up the windows virtual machine
    Booting onto the ubuntu live cd image
    Installing GRUB with the following commands:

    Code: Select all

    sudo grub
    find /boot/grub/stage1
    root (hd0,1)
    setup (hd0)
    quit
    
    Exit out of ubuntu live disk
    Restart the virtual machine
To my limited knowledge this would mean that whenever I boot up the windows virtual machine it will have its own grub screen (separate from the one that I use to manage my ubuntu and windows partition) and will be able to boot into the other partition?

I am mainly asking because after some googling I am failing to understand what a windows bootstrap is. I'm also wondering if there is anything that I have the ability to do within the virtual machine that would be a bad idea, and effect my windows drive or even possibly my more used ubuntu partition.

Thanks, Trent

EDIT:

Tried the method above, grub failed to find my hard drive, tried a few different techniques that the ubuntu forum mentioned for grub to find a bootable hard drive, but no luck. Got my hands on a 32bit vista recovery cd. Tried doing a startup repair, it showed a lot of processing going on, for a while it seemed promising, it looked like it was doing a lot, the processing was very high for a long time. I waited about 45 minutes and nothing happened, I was starting to worry that I may have done something to corrupt the drive since it was taking so long but still I waited patiently. After about an hour it said the drive could not be repaired automatically, apparently the tool failed.


EDIT 2:
Tried finding this MBR wiki article as you speak of, these are the only results I have found:
http://www.virtualbox.org/search?q=mast ... =1&wiki=on
Not meant to be sinister, just showing that apparently it is not there.
Post Reply