Running Windows from first (and second) partition - how to skip GRUB?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
w-sky
Posts: 2
Joined: 21. Sep 2016, 00:43
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows
Location: Berlin

Running Windows from first (and second) partition - how to skip GRUB?

Post by w-sky »

Hi there,

I am using VirtualBox in a Ubuntu 16.04 environment on a ThinkPad Intel i5 notebook. My aim is to run the pre-installed Windows 7 "Professional" in a virtual machine. When I installed Ubuntu, I resized the original windows system partition to make room for Linux, but left it otherwise untouched. The drive sda now has the following partitions:

Code: Select all

sda1 - Windows Boot
sda2 - Windows System
sda3 - Extended
- sda5 - Linux System
- sda6 - Swap
I followed the guide about "Using a raw host hard disk from a guest" in chapter 9.9 of the documentation and succesfully booted Windows in the virtual machine. It is working very well.

Except that it always loads the GRUB bootloader first. For comprehensible reasons, I want to boot Windows in VBox directly and so I followed the instructions to mount partitions as described in chapter 9.9.1.2, but either way I try, it does not work.

By the way, I don't know where else to mention: The documentation lacks some information about where to get a "winxp.mbr" boot sector file. They should mention that it can be created with the command

Code: Select all

install-mbr [-p <partition number to boot>] --force winxp.mbr
I tried giving access to sda1 and sda2 (the Windows partitions) only, but to my surprise I am only getting a GRUB rescue prompt. When installing Ubuntu, I think there was a question about placing an emergency GRUB bootsector on the first partition and I think I should not have done this. Maybe booting Windows will work when the original Windows bootsector is installed on partition sda1 ??

But also, VBox has this option to use an alternative file as bootsector. Using the command mentioned above, I created bootsectors to boot from default, first or second partition and tried them all; but the closest I get to Windows this way is a Bluescreen at startup ("Windows-Start-Manager") status 0xc000000e stating that it cannot access a neccessary device.

Any ideas? If it won't work with partition vmdk's, is there a way to give a parameter from VBox to GRUB to boot a certain OS entry?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Running Windows from first (and second) partition - how to skip GRUB?

Post by socratis »

  1. You are accessing the raw hard drive. That means that you'll be accessing the same options as if you were booting the computer from the hard drive. And you do get the GRUB menu when you do that, right?
  2. The documentation is not tailored to specific needs for operating systems. So to include the mention to "winxp.mbr", it's a slim to none possibility. My two cents.
  3. Is there a way for GRUB to accept "commands" or "parameters" from somewhere else? No. So even if VirtualBox could send a "signal" to GRUB (which it can't), GRUB wouldn't pick it up.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
w-sky
Posts: 2
Joined: 21. Sep 2016, 00:43
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows
Location: Berlin

Re: Running Windows from first (and second) partition - how to skip GRUB?

Post by w-sky »

socratis wrote:
  1. You are accessing the raw hard drive. That means that you'll be accessing the same options as if you were booting the computer from the hard drive. And you do get the GRUB menu when you do that, right?
Sure, yes! That how it works the "easy way", when I grant full access to the drive. (sda, sda1 and sda2).

But then I tried to grant access to the Windows partitions sda1 and sda2 only using the "-partitions" option with VBoxManage, which should work (I guess) if GRUB were not installed on sda1. AFAIK it does not have to, because it can be on sda or sda5 as well. If anyone will confirm this, I will try to reinstall the Windows MBR on sda1. (I don't know how yet. I cannot use a Windows Rescue DVD because a) I don't have one b) the notebook has no DVD drive c) it will overwrite GRUB on sda.)
[*]The documentation is not tailored to specific needs for operating systems. So to include the mention to "winxp.mbr", it's a slim to none possibility. My two cents.
Well they do not mention at all how the file has to be constructed, obtained from or anything else. Not even which exact directory the file has to be in. Also, the "-partitions" option is only available on linux hosts (as the documentation says).

They say: "The modified MBR will be stored inside the image, not on the host disk." but that does not work or happen at all, there seems to be an error.
[*]Is there a way for GRUB to accept "commands" or "parameters" from somewhere else? No. So even if VirtualBox could send a "signal" to GRUB (which it can't), GRUB wouldn't pick it up.[/list]
Would be handy though, especially in cases of booting from a real partition. ;)
Post Reply