7

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.

2
  • 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
    – Gizmo
    Aug 29, 2013 at 20:34
  • @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
    Sep 1, 2013 at 10:44

2 Answers 2

2

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

0

I don't think it is possible, because you need some "layer" that

  • is able to understand the linux filesystem where the VHD is stored.

  • "interprets" the VHD file and presents it to your Windos as a harddisk.

This "layer" is needed not only for starting the OS on it, but also the whole time it runs. And this "layer" is your host system.

5
  • 4
    The last sentence isn't exactly true. Windows can boot from VHD images through BOOTMGR without involving additional host OS.
    – gronostaj
    Sep 1, 2013 at 10:43
  • @gronostaj You misunderstood, Windows needs a driver for the host disk so it could see the VHD. Dec 15, 2020 at 15:25
  • 1
    @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.
    – gronostaj
    Dec 15, 2020 at 15:42
  • @gronostaj Well my point is that you're misinterpreting the statement itself. The host system is the Windows system being booted. Dec 15, 2020 at 18:36
  • @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.
    – gronostaj
    Dec 16, 2020 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.