Jump to content











Photo
- - - - -

manually adding boot entry for vhd booting


  • Please log in to reply
4 replies to this topic

#1 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 19 March 2009 - 01:32 PM

I've created a vmdk file using VMware and installed Windows 7 inside it, then I used Vmdk2Vhd.exe to convert it into a vhd file.

I think installing bootmgr into MBR is not needed as grub4dos is more handy and can chainboot bootmgr.

The questionable part is how can I tell bootmgr to boot the vhd file?

#2 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 19 March 2009 - 02:07 PM

The questionable part is how can I tell bootmgr to boot the vhd file?


I was just reading about that. From the Win7 beta WAIK Users Guide:

If you are deploying the VHD to a BIOS-based computer without a Windows 7 boot menu, for example, a computer using Windows Server 2008 as the running operating system, you will need to update the boot environment using a Windows 7 Windows Preinstallation (Windows PE) disk before you can configure the system for native-boot VHDs.


bcdboot v:\windows

Where v: is a Win7 or Win7 PE. bcdboot is a new tool that copies the boot environment.

Then

bcdedit /copy {default} /d "vhd boot (locate)"
... makes a copy of an entry in the Win7 BCD to be editted. Returns a {GUID}.

Then

bcdedit /set {guid} device vhd=[locate]\windows7.vhd

bcdedit /set {guid} osdevice vhd=[locate]\windows7.vhd
... looks fairly easy!

Then

bcdedit /default {guid}
... to set it as the default.

And lastly

bcdedit /set {guid} detecthal on
... for some some systems.


Hope it goes well! Regards :good:

#3 diddy

diddy

    Member

  • Tutorial Writer
  • 78 posts

Posted 19 March 2009 - 04:53 PM

I was just reading about that. From the Win7 beta WAIK Users Guide:

[codebox]Windows Boot Manager--------------------identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795}device partition=C:description Windows Boot Managerlocale en-usinherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}default {b24aef85-1530-11de-98be-fa21bc1d2c2c}resumeobject {b24aef84-1530-11de-98be-fa21bc1d2c2c}displayorder {b24aef85-1530-11de-98be-fa21bc1d2c2c}toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d}timeout 30Windows Boot Loader-------------------identifier {b24aef85-1530-11de-98be-fa21bc1d2c2c}device file=[C:]\test.vhdpath \windows\system32\winload.exedescription Windows 7locale en-usinherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}osdevice file=[C:]\test.vhdsystemroot \windowsresumeobject {b24aef84-1530-11de-98be-fa21bc1d2c2c}nx OptIndetecthal Yes[/codebox]This worked with a vhd file on which Windows was installed via setup.exe (from install DVD) - I had inadvertantly managed to delete the original BCD store created when Windows was installed to the vhd.It did not work with a vhd file containing an image captured from my hard disk (non - syspreped). This image started to boot but hung during desktop setup. It eventually prompted a restart but still didn't work. I checked the drive containing my vhd file and discovered that the image had expanded to it's maximum allocated size and several folders had been added to the root of the drive (including a windows folder). I suspect that if I had syspreped the image it might have worked but I have not tested this. [quote name='allanf' post='62755' date='Mar 19 2009, 02:07 PM'][code]bcdedit /copy {default} /d "vhd boot (locate)"[/code]... makes a copy of an entry in the Win7 BCD to be edited. Returns a {GUID}.Then[code]bcdedit /set {guid} device vhd=[locate]\windows7.vhdbcdedit /set {guid} osdevice vhd=[locate]\windows7.vhd[/code]
... looks fairly easy!


I think this is an error in the WAIK documentation as vhd=[locate] is normally used for differencing disks (see my post here) - when I tried using it as suggested it resulted in error 0xc000000f.

Hope this helps without adding more confusion to this poorly documented process.

#4 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 19 March 2009 - 11:05 PM

Yep, it booted but did hang in the startup screen.

Following a install Windows 7 directly to newly created fixed vhd was however working.

#5 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 20 March 2009 - 12:21 AM

I think the section you are referring to in the WAIK documentation is Windows Preinstallation Phases - Phase 4: Deploying Your Windows Image - Deploy Windows on a VHD with Native Boot.


Nope! It's the section, 'Add a Native-Boot Virtual Hard Disk to the Boot Menu', which is very straightforward.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users