Page 1 of 1

Cannot Start VBox described Win7 Bootcamp partition

Posted: 7. Mar 2012, 20:25
by JimBushWhack
Have there been changes to the createrawvmdk internal vboxmanage command in the past year or so? I recently upgraded my Macbook Pro laptop to Lion. I have been running A VirtualBox Windows 7 Virtual Machine on a Bootcamp partition for almost a year now on my Snow Leopard installed Macbook. The bootcamp partition had originally been setup as partition 3 on my hard disk. After upgrading to Lion, I tried to bring up the virtual machine view of this bootcamp partition, but it failed miserably, with a message something like “No Operating System Found”, or some such. Upon investigating, I found that when Lion was installed the Hard disk partitioning had been shuffled and partition 3 was now the MacOS Recovery partition and the bootcamp partition had been moved to partition 4:

JBs-MacBook-Pro:~ Jim$ sudo vboxmanage internalcommands listpartitions -rawdisk /dev/disk0
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0xee 1023/254/63 1023/254/63 200 1
2 0xaf 1023/254/63 1023/254/63 274167 409640
3 0xab 1023/254/63 1023/254/63 619 561903832
4 0x07 1023/254/63 1023/254/63 30258 563173376

After seeing this, I setup my startup disk for the bootcamp partition and rebooted to make sure the Windows 7 contents did not get mangled. It booted up with no problems. So I rebooted to MacOS Lion and thought that it would be a simple matter of rerunning the createrawvmdk command again, specifying partition 4 instead of 3 as the bootcamp partition:

JBs-MacBook-Pro:BC6 Jim$ sudo vboxmanage internalcommands createrawvmdk -rawdisk /dev/disk0s4 -filename BC6.vmdk
RAW host disk access VMDK file BC6.vmdk created successfully.
JBs-MacBook-Pro:BC6 Jim$ ls -l
total 8
-rw------- 1 root Jim 540 Mar 7 07:58 BC6.vmdk

As you can see, the command ran fine, but it only created the vmdk file. In the past when I have run this (last June, with a current version of VirtualBox at the time), a 2nd file which would have been named BC6-pt.vmdk was also created. This essentially was an MBR template description file which which denoted the partition type of each partition.

After setting open permissions on the BC6.vmdk and /dev/disk0s4 files, I tried creating a new virtual disk with just the one vmdk file, but it did not work. It seems to be created OK, but I get “A disk read error occurred. Press Ctrl+Alt+Del to restart” in the Win7 window. I am running VBox version 4.1.6.

Am I missing something here or has the createrawvmdk command been broken? Here is the VBox configuration:
Screen Shot 2012-03-07 at 9.53.43 AM.png
Screen Shot 2012-03-07 at 9.53.43 AM.png (65.66 KiB) Viewed 2332 times

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 8. Mar 2012, 11:31
by ChipMcK
Lion has a new partition scheme that includes a hidden partiton "Recovery HD" and now the partitions slide up in number.
This is well discussed in the variety of Mac orientated forums

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 8. Mar 2012, 20:54
by JimBushWhack
Yes, I knew about the Recovery HD partition. But that was not the question. The question was that even after changing the vmdk file to reflect the new partitioning scheme, I still could not get VBox to start up Windows 7 which exists on that bootcamp partition.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 9. Mar 2012, 11:59
by mpack
JimBushWhack wrote:JBs-MacBook-Pro:BC6 Jim$ sudo vboxmanage internalcommands createrawvmdk -rawdisk /dev/disk0s4 -filename BC6.vmdk
Is that the correct command? Isn't it the "access to individual partitions" section of the manual you should be following (9.8.1.2 )? The command you used is the one that maps the whole disk and hence uses the MBR that is already on the disk.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 9. Mar 2012, 23:10
by JimBushWhack
Thanks much mpack, it worked! I changed the command line to:
cd ~/Library/Bootcamp/BC7
sudo vboxmanage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename BC7.vmdk -partitions 4
sudo chmod 777 BC7*
ls -l
-rwxrwxrwx 1 root Jim 512 Mar 9 12:41 BC7-pt.vmdk
-rwxrwxrwx 1 root Jim 731 Mar 9 12:47 BC7.vmdk

And as you can see, it created the local MBR file as well. I set it up as a new virtual disk from and existing disk and am now able to bring up my VBox windows 7 machine with no problems. I had not had to do this for several months and thought that the command line that I had previously used had worked for me before, but maybe not. I tend to try things until they work and then forget them.

Opinion: It would be really helpful and probably save much head scratching and discourse in this forum if some examples of doing this and other not so straight forward operations were documented in the manual.

Thanks again.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 10. Mar 2012, 12:46
by mpack
JimBushWhack wrote:Opinion: It would be really helpful and probably save much head scratching and discourse in this forum if some examples of doing this and other not so straight forward operations were documented in the manual.
Um... an example of the use of this command is given in the manual, in that section 9.8.1.2 which I already mentioned.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 10. Mar 2012, 23:06
by JimBushWhack
mpack wrote:
JimBushWhack wrote:Opinion: It would be really helpful and probably save much head scratching and discourse in this forum if some examples of doing this and other not so straight forward operations were documented in the manual.
Um... an example of the use of this command is given in the manual, in that section 9.8.1.2 which I already mentioned.
Sorry, I did not make myself clear. What I meant was that if specific scenario examples were included in the manual, this would make these scenarios easier to understand. For instance, if there was a section on " How to Use a MacOS Bootcamp partition as a VBox guest Virtual disk". More or less a how to guide specific to this topic and perhaps other not so easy to understand topics. The command line examples given in section 9.8.1.2 are Linux specific, whereas the command line I included is MacOS Lion specific.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 11. Mar 2012, 04:36
by rpmurray
JimBushWhack wrote:For instance, if there was a section on " How to Use a MacOS Bootcamp partition as a VBox guest Virtual disk". More or less a how to guide specific to this topic and perhaps other not so easy to understand topics.
Well, now that you've figured out how to do this I'm sure that you'll follow through by writing it up as a nice guide for others and putting it into the "Howtos and Tutorials" section of these forums so others can benefit.

Re: Cannot Start VBox described Win7 Bootcamp partition

Posted: 13. Mar 2012, 22:09
by JimBushWhack
rpmurray wrote:
JimBushWhack wrote:For instance, if there was a section on " How to Use a MacOS Bootcamp partition as a VBox guest Virtual disk". More or less a how to guide specific to this topic and perhaps other not so easy to understand topics.
Well, now that you've figured out how to do this I'm sure that you'll follow through by writing it up as a nice guide for others and putting it into the "Howtos and Tutorials" section of these forums so others can benefit.

OK, I guess that is only fair and will be giving something back for the help I have gotten over the years from the forums. I have just started reading the rules of how to add a HowTo guide to the section you mentioned. I will write something up and submit it for approval in the next week or so.

Thanks,
JimBushWhack