However, Windows still doesn't load in the VM after running bootrec. It wipes out grub nicely, but doesn't fix the VM Windows installation. When I boot Windows subsequently in the VM, I get an error message "A required device is not accessible". I also tried running the automated repair from the recovery disk in the VM. This fails to fix the VM Windows, and has the added benefit of making Windows native fail to boot, which fortunately can be fixed by running auto-recovery options from the recovery disk booted natively.
I have the following partitions on my system:
Code: Select all
sudo blkid
/dev/sda1: LABEL="SYSTEM" UUID="F8C4B13FC4B100C4" TYPE="ntfs"
/dev/sda2: LABEL="OS" UUID="36AA701CAA6FD6C1" TYPE="ntfs"
/dev/sda4: LABEL="HP_RECOVERY" UUID="6CEAF910EAF8D774" TYPE="ntfs"
/dev/sda5: UUID="5ebb92a5-b015-4a90-b55a-48a521237010" TYPE="ext4"
/dev/sda6: UUID="cebc1c17-cd2f-4ccb-be81-20f81b659957" TYPE="swap"
/dev/sda7: LABEL="Shared" UUID="1FF344F316D8343E" TYPE="ntfs"
/dev/sdc1: LABEL="BACKUP" UUID="7EF5-1DEE" TYPE="vfat"
Here's what I'm doing to create the raw disk:
I create the MBR using one or other of the following two methods separately.
1.
Code: Select all
sudo dd if=/dev/sda of=myMBR.mbr bs=512 count=1Code: Select all
$ sudo apt-get install mbr
$install-mbr -e12 --force myMBR.mbrCode: Select all
VM_NAME=Windows7Raw # name of virtual machine
sudo VBoxManage internalcommands createrawvmdk -filename /home/$USER/VirtualBox\ VMs/$VM_NAME/$VM_NAME.vmdk -rawdisk /dev/sda -partitions 1,2 -relative -mbr myMBR.mbr
Code: Select all
#! /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=Windows7Raw # name of virtual machine
sudo chown -R $USER:$USER /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
chmod -R g=u /home/$USER/.VirtualBox # $VBOXUSER permissions should be the same as ours
sudo chown -R $USER:$USER /home/$USER/VirtualBox\ VMs/$VM_NAME # ditto for VirtualBox VMs directory.
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/
echo "merging"
sudo -u $VBUSER XAUTHORITY=/tmp/.Xauthority_${VBUSER} xauth merge /home/$USER/cookieTmp
rm /home/$USER/cookieTmp
sudo -u $VBUSER XAUTHORITY=/tmp/.Xauthority_${VBUSER} VBOX_USER_HOME=/home/$USER/.VirtualBox VBoxManage startvm $VM_NAME
Any help would be greatly appreciated. Here is my boot-info file:
Code: Select all
Boot Info Script 0.60 from 17 May 2011
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for on this drive.
=> No boot loader is installed in the MBR of /dev/sdc.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD
sda2: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe /wubildr
/ubuntu/winboot/wubildr /wubildr.mbr
/ubuntu/winboot/wubildr.mbr /ubuntu/disks/root.disk
/ubuntu/disks/swap.disk
sda2/Wubi: _____________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.04
Boot files: /boot/grub/grub.cfg /etc/fstab
sda3: __________________________________________________________________________
File system: Extended Partition
Boot sector type: Unknown
Boot sector info:
sda5: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.04
Boot files: /boot/grub/menu.lst /boot/grub/grub.cfg /etc/fstab
"RESULTS4.txt" 834 lines, 31587 characters