Page 1 of 1

Accessing Windows Vista Partition (Raw Partition with VMDK)

Posted: 11. May 2009, 23:30
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

--------

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 the MBR wiki article spoken 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, or at least I can't find it.

Edit 3:
Tried using gparted to recognize the drive and change the flags but here is a screen shot of the drive, it says it does not exist and cannot change any of the flags
Image Link: http://img144.imageshack.us/my.php?image=harddrive.png

Sorry for the long post, figured I would give as much information as I could.