As many of you know I am a Manager of a Computer Centre and Server/Network Administrator for a small library in Montreal Canada.  Every so often I get tasked with a project that makes my life hell for few days/weeks.  This time round, its Microsoft that’s the culprit of my frustrations.  And since I had to search the internet for multiple solutions, I figured I would write a post to help others who are in the same situation.

Topics Covered

How to boot from a clean system solely to a VHD

SO my first task was to reimage a test machine.  One of the systems in our computer center fried and I had a fresh clean system to deal with.  How best to make system dual boot with System 7 and 8.1, and make it easily maintainable?  VHDs.

SO I spend about 2 weeks creating the images, updating the OS and software and finally got to putting it on the system.  I decided to use the old HDD, keep the new one incase its needed elsewhere.  So I first have to wipe the old one before I put on the new hard drives.  So here is what the basic steps are:

  • Boot from a Windows 8.1 Instalation CD
  • Format the hard drive
  • Create a partition
  • Copy the VHD files to the hard drive
  • Use the Installation CD to add the two VHDs to the boot menu

So here goes the technical steps:

  1. A mentioned you need to boot from a WIndows 8.1 Installation CD (Windows 7 works too, but I prefer using the latest versions of things)  At the Install Windows prompt, hit Shift+F10 to brink up a console
  2. RunDiskpart [code]c:>diskpart[/code]
  3. List the disks you have so you know which number to select [code]DISKPART>list disk[/code]
  4. Select the disk that pertains to the disk you want to format and put the partition on [code]DISKPART>select disk #[/code]
  5. If you List Disk again, you should see a * beside the disk you selected.  Make sure its the right one as we are wiping it clean.
  6. To remove anything that was on the drive before, run the Clean command which will erase all partitions off the drive [code]DISKPART>clean[/code]
  7. Now to create a partition, if you want more than one, you can specify a size=(MB) command, if you want to usethe whole drive, omit the size. The example showthe creation of a 250GB partition [code]DISKPART>create partition primary size=250000[/code]
  8. Format the new partition [code]DISKPART>format quick[/code]
  9. Then you need to Activate it and assign it a letter [code]DISKPART>active
    DISKPART>assign[/code]
  10. Plug in your VHD source USB Drive (I used a Passport 500GB portable USB Drive)  WAit a few moments for ti to register.
  11. Now you need to list the volumes to see what drive letterwas assigned to the portable drive and which letter got assigned to your new partition (Marked by a *). Then Exit. [code]DISKPART>list volume
    DISKPART>exit[/code]
  12. Now comes the long part, copying over the image.  I recommend usingRobocopy instead of the regular Copy command, this way you can see the progress of how muchis transferred, [code]c:>robocopy d: c: YourFIle.vhd[/code]

    If you have more than one VHD (as I am trying to dual boot) You cna use *.vhd instead to copy all VHD files

  13. Once copied you will need to mount each drive and attach them.  In my case I used ccwin7.vhd and ccwin8.vhd [code]c:>diskpart
    DISKPART>select vdisk file=c:ccwin7.vhd
    DISKPART>attach vdisk
    DISKAPRT>select vdisk file=c:ccwin8.vhd
    DISKPART>attach vdisk[/code]

    You can attach more if you are trying to triple boot or Quad boot, etc.

  14. List the volumes so you can find out the new letters are as you will need to know them for theBCDBOOT commands. then exit. [code]DISKPART>list volume
    DISKPART>exit[/code]
  15. Add which ever operating system you want to appear LAST in the list, I wanted Windows 7to be first in the list so I will add windows 8.i then Windows 7. While I am at it I will also rename it so I know what it is later on. [code]c:bcdboot e:windows /s c:
    c:bcdedit /set {default} Description "Windows 8.1"[/code]
  16. Now I will add my Windows 7image which now become the Default (take note its a different drive letter but Istiall assign it to C:) [code]c:bcdboot f:windows /s c:
    c:bcdedit /set {default} Description "Windows 7"[/code]
  17. You can run BCDEDIT to make sure both entries are there.  Afterwards, close the console window by hitting the red X in the top corner and cancel the install process.
  18. Reboot, select your images and complete the install process of each image (as I assume you syspreped them first). Done.

Which versions of Windows 7 support booting from a VHD?

Despite what all the blogs and forums posts state, you need understand it the right way.

  • All versions of Windows 7 support the ability to add VHDs to the boot menu, they all suport the creation and attachment of VHDs and all support installing something to a VHD.
  • ONLY Windows 7 Enterprise and Windows 7 Ultimate ACTUALLY ALLOW BOOTING into Windows 7 from a VHD. 

If you get a message along the lines of “License error: Booting from a vhd is not supported on this system”, this means you are not running Enterprise or Ultimate.  Why do I say this? Why am I telling you it won’t work DESPITE EVERY FORUMS OUT HERE SAYING IT WILL!!!!!  Because I spent 2 weeks creating a Windows 7 Pro VHD Image.  2 long exhausting weeks making sure every update was done, ever program installed…  All for waste.  Or was it?

Upgrading from Windows 7 Pro to Enterprise

If you accidentally wasted your time installing everything to a Windows 7 Pro VHD, your time is not wasted.  Trust me.  I know it tells you you can only upgrade from Windows 7 Pro to Windows 7 Ultimate, but my problem is I don’t have a VLK for Ultimate, I have Keys that support Pro and Enterprise from Microsoft’s Volume Licensing Service.  And when you are tired of installing and just want it to work, you look for the answer, even when one doesn’t technically (legitimately) exist.  By this I mean the solution is not, by any means, supported my Microsoft.  It also requires and edit to the Registry which is you do not know what you are doing, can cause a lot of problems.

Open Regedit and make your way to the follow Key location:

[code]HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion[/code]

You will need to change 2 settings under this area.

[code] Name: EditionID
Type: REG_SZ
Data: Professional

Name: ProductName
Type: REG_SZ
Data: Windows 7 Professional[/code]

Change these two so that they are Enterprise instead

[code] Name: EditionID
Type: REG_SZ
Data: Enterprise

Name: ProductName
Type: REG_SZ
Data: Windows 7 Enterprise[/code]

This essentially will fool Windows into thinking it is Enterprise, even though it is NOT Enterprise.  However this is not the last step… Although the Registry part has been changed, Windows is still the Pro Version and will not work.  You need to now do an In place Update which will make sure that the OS has all the right credentials.

Note: You will need to have the have the same Level if Version of Windows Enterprise Install as you had for Windows 7 Pro.  In other words if you try and update Pro SP1 to Base Enterprise, it will tel you the version you have is newer and will not continue.  Also if you are downloading from Microsoft’s Licensing Center, make sure you down load “Windows 7 Enterprise WITH SP1” and not just “Windows 7 Enterprise SP1” which is just the service pack… again, my mistake.

Running Sysprep after the Upgrade

If you used my method of forcing an upgrade from Windows 7 Pro to Enterprise, and you want to use the image on multiple systems like I do, you will run into one more problem… You will get an error saying that Sysprep is for Freshly installed systems and NOT Upgraded systems, despite the fact it was really technically a in place repair as we were going from “Enterprise” (Fooled version of Pro) to Enterprise.  There is again a fix for this, hard to find, and as with the earlier issue, not supported by Microsoft as again you are doing an Edit to the Registry.  make your way over to the following Key in Regedit:

[code]HKEY_LOCAL_MACHINEsystemsetup[/code]

If you see an entry called “Upgrade”, delete it.

What to do after fixing the errors

Now before you go and boot back in, you will need to delete the earlier {Default} (if you added it to the boot menu last) or using the ID (looks like {941e895b-d54c-33e4-9699-90b11c784a00}).

[code]bcdedit /delete {Default}[/code]

Then run through the steps again of selecing the VHD, Attaching it, and using BDCBOOT to add it once again as described in the first section.

Now if you were in a bind like I was, this 20 – 30 minutes of extra work, will save you 2 weeks of starting fresh… SOmething I wasn;t willing to do.