Is it possible to boot a Windows VHD using GRUB on a physical machine?

12,274

You can boot a VHD using BOOTMGR here some info about how to chainload it with `grub4dos. I think it should be trivial to adapt it to grub 2 but I'm not confident with grub configurations.

I have not tried it but I found the info for grub4dos here: http://reboot.pro/topic/15407-booting-from-vhd-in-grub4dos/

Form the above thread:

native Windows 7 VHD booting goes through BOOTMGR and an entry dedicated to it to this effect in \boot\BCD. It is NOT about VHD booting, it is about booting WINDOWS 7 on VHD.

Normally you have:

C:\BOOTMGR
C:\boot\BCD
C:\Myl33t7.vhd

The booting sequence is as follows:

BIOS->MBR->Active partition bootsector->BOOTMGR->BCD choice mapping C:\Myl33t7.vhd

You can insert grub4dos in any point BEFORE BOOTMGR.

IF you want to have the BOOTMGR and \boot\BCD INSIDE the .vhd, as long as the .vhd is static, you just map the .vhd in grub4dos and chainload the BOOTMGR in it:

find --set-root /Myl33t7.vhd

map /Myl33t7.vhd (hd31)

root (hd31)

chainload /BOOTMGR

boot

The grub4dos mapping is only used in the initial part of the setup to aloow the loading of BOOTMGR and BCD.

There is another tutorial but it is in Russian, here the translation: http://translate.google.com/translate?hl=en&sl=ru&u=http://habrahabr.ru/post/228641/&prev=search

Share:
12,274

Related videos on Youtube

nc4pk
Author by

nc4pk

I am a sophomore studying Computer Engineering at North Carolina State University in Raleigh, North Carolina.

Updated on September 18, 2022

Comments

  • nc4pk
    nc4pk over 1 year

    Is it possible to boot Windows from a VHD file which is stored on a Linux partition?

    I don't want to run Windows under VirtualBox. Linux is the only OS on the hard drive, and Windows should only exist on the VHD.

    • Admin
      Admin over 10 years
      and doesn't EasyBCD have the option to boot from VHD? Also, with "I want to know this too" I mean I want to be able to use EFI/safe boot or w.e. it's called
    • Admin
      Admin over 10 years
      @Gizmo EasyBCD is just a BCD editor, and BCD is a boot configuration store for BOOTMGR - Windows boot manager. But BOOTMGR doesn't support Linux filesystems.
  • gronostaj
    gronostaj over 10 years
    The last sentence isn't exactly true. Windows can boot from VHD images through BOOTMGR without involving additional host OS.
  • Paul Stelian
    Paul Stelian over 3 years
    @gronostaj You misunderstood, Windows needs a driver for the host disk so it could see the VHD.
  • gronostaj
    gronostaj over 3 years
    @PaulStelian Possibly, but that's beside the point. The sentence I'm disputing states that a host OS is required to read the VHD from disk. That's not true. Windows can be booted directly from a VHD stored in NTFS filesystem without any additional host.
  • Paul Stelian
    Paul Stelian over 3 years
    @gronostaj Well my point is that you're misinterpreting the statement itself. The host system is the Windows system being booted.
  • gronostaj
    gronostaj over 3 years
    @PaulStelian That's what I've been trying to say with my original comment. This answer seems to assume that VHDs can only be used in virtual machines, because disk, filesystem and VHD drivers that are required to do this must be provided by the hypervisor host, therefore you can't boot VHD with GRUB. I'm pointing out that this statement is flawed because bootmgr can boot VHDs without any kind of hypervisor.