Windows 7 native VHD boot

Discussion in 'Windows 7' started by Gremo, Jul 15, 2011.

  1. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    As far as i know it only works if the o.s. in the VHD is Ultimate/Enterprise. Any chance (reg tweaks, add/remove packages using dism) to get it work with, say, Home Premium?

    Many Thanks :worthy:
     
  2. MrG

    MrG MDL Addicted

    May 31, 2010
    833
    185
    30
    Try out for yourself.

    Rt. clk Computer/ Manage/ Disk Management (wait)+ rt. clk again/ Create VHD

    do you see that.
     
  3. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    Dunno what you mean. I already booted Home Premium from VHD, getting an error about licensing (as expected). I'm asking if there is a way to solve this...
     
  4. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    How does this error look exactly? i never used Home Prem in vhd, im just interested.. :)

    Anyway, you can also try EasyBCD's "Boot from Raw Hard Disk" instead of "Boot from VHD" option. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    Error was: "License error: Booting from a vhd is not supported on this system" because of HP

    What is "raw hd" and how should solve my problem and allow me booting HP?
     
  6. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,783
    180
  7. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    #7 Shenj, Jul 15, 2011
    Last edited: Jul 15, 2011
    I think the Raw Hard Disk feature from EasyBCD let's you use a VHD as well.
    But please note you can only boot from FIXED hard discs with this method, EasyBCD autoconverts to fixed as far as i could check when choosing raw disk for vhd

    EDIT:
    And you actually don't even need ANY tool to make a 'fixed' Virtual disk bootable with EasyBCD, it will start at byte 0 (well what else..)

    So pull up your <choose your favorite Virtual HD like VDI or VMWARE thingy> make it Fixed size, fire up a good Hex editor like HxD, search for the NTFS header entry for the <REAL> volume, remove everything before that and save as new file, now you can boot with EasyBCD your 'Virtual' hard disk.

    You can use 'Imdisk' to test this offset, so if it mounts your virtual hard drive perfectly in explorer you got the right offset, so everything before that can be deleted.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    Ok, thanks for the tip. Also thanks to Shenj for the links. I'd like to try the hex solution, i've opened the VHD (with windows 7 HP inside) and i'm looking for the ntfs header entry. Where is located? What do you mean with <REAL> volume?

    My question is also: i've created the VHD using only diskpart (id=27, active) and imagex /apply. Will this work using the converted raw hd?
     
  9. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    #10 Gremo, Jul 15, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Well i did a quick test with Thin PC (because of the small image size) and something went wrong. What i did:

    Code:
    diskpart
    create vdisk file=C:\ThinPC.vhd maxium=5120 type=fixed
    attach vdisk
    create partition primary id=27
    active
    format fs=ntfs quick
    assign letter=K
    exit
    
    imagex /apply Z:\sources\install.wim 1 K:
    
    and then i've used DriveImage XML to make a raw image of K: (C:\ThinPC.dat). Then i renamed it C:\ThinPC.img and i've added it to the boot using EasyBCD (as raw disk image). When i boot it i can see only the grub shell :(

    What i'm missing? :confused:
     
  11. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    #11 Shenj, Jul 15, 2011
    Last edited: Jul 15, 2011
    Like i said, don't even use anything! Just load the VHD with EasyBCD D:
    Or edit it yourself but then you have to use 'Raw Partition' i think (not sure, i didnt test this functionality yet)

    When i looked inside my VHD, i found the Partition header on offset 100000 Hex, 2048 Blocks (512Bytes x 2048 = Dec 1048576 offset)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    Also letting easy bcd do the job didn't work, it always show the grub shell. Now i'm trying you method, i've just found the offset.

    Do you thing i'm doing it right in the previous post?
     
  13. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    #13 Shenj, Jul 15, 2011
    Last edited: Jul 15, 2011
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
  15. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,557
    652
    60
    #15 Shenj, Jul 16, 2011
    Last edited: Jul 16, 2011
    Ultimate/Enterprise support VHD booting nativly.

    Edit: Oh and sorry now that i think about it, deleting everything before NTFS header doesnt really make sense, this method will shift all offsets > it can't work.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. Gremo

    Gremo MDL Junior Member

    Feb 19, 2011
    99
    24
    0
    I was thinking about injecting the vhd driver or package from ultimate to home premium. Anyone knows what is the component that allows vhd boot?
     
  17. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,783
    180
    Good luck with finding it (so far nobody did)
    Not to say that somebody one day will not...

    vmlite sounds great & I even managed to get it working on a couple of test machines/images

    Sadly on the ones I really wanted to use it did not work at all, so even if it was completely free it was unusable

    Plus the support by the single bloke that also writes it, is not really possible in any extend

    sebus
     
  18. 100

    100 MDL Expert

    May 17, 2011
    1,346
    1,542
    60
    #18 100, Jul 16, 2011
    Last edited by a moderator: Apr 20, 2017
    It's not a driver issue. The editions are technically all able to boot from the VHD; it's a kernel licensing policy that prevents you from doing so, so I suppose it could be possible by patching the kernel.

    Security-SPP-Component-SKU-Ultimate-ppdlic.xrm-ms:
    Code:
    <sl:policyInt name="Kernel-NativeVHDBoot" attributes="reboot-required, override-only">1</sl:policyInt>
    Other editions than Enterprise/Ultimate or Server will have this set to 0.
     
  19. meme2209

    meme2209 MDL Novice

    Dec 23, 2010
    1
    0
    0
    Thanks for the info.

    But how do i change the kernel licensing policy?
     
  20. arnyc23

    arnyc23 MDL Novice

    Oct 12, 2009
    20
    1
    0
    Did you guys try to change BootStatusPolicy and/or BootUxPolicy values in BCD Store for your OS Loader? Is there a complete list of BCD Store Loader values posted anywhere with explanation what they are used for? They can be added / edited easily with Visual BCD or manually with bcdedit command.