Back in the Windows F^HVista/7 and Server 2008/2008R2 days, it was possible to install an operating system instance without needing to input a key during the installation process. You could use various methods to make a bootable OS Install USB key then simply remove the \sources\ei.cfg file and you'd be able to choose between all the versions of the OS inside the boot.wim file - this was very handy!
Microsoft has made a change since Windows Server 2012/Windows 8 whereby they don't allow you to install Windows without the use of a Product Key. There is no ei.cfg file in the \sources folder and you are forced to input a Product Key during installation.
Well, there's a simple way to work around this to not only create a bootable USB Key that doesn't need a Product Key during install (and lets you choose among the multiple OS variants in the boot.wim file), but also to re-create a bootable ISO image so that you can then mount this as an installation media source in Hyper-V!
The steps to achieve these goals are:
- First, you'll need to download a Windows Server 2012, 2012R2 or 2016 ISO image or use the VL ISO image you already have there. Then you'll need to either extract this image to a folder, or better still, just run the (portable) Rufus application to make yourself a bootable USB key that allows for quite quick OS installs.
- Now, you'll need to copy the following into a new plain text file called ei.cfg in the \sources folder of the USB key:
[Channel]
Retail
[VL]
1 - If you only need the bootable USB key, you can stop here, however if you now wish to recreate the ISO image file so that you can then use this modified image in a Hyper-V environment...
- Download and install the latest Windows Assessment and Deployment Kit (ADK) (the latest at time of writing this post was for Windows 10 Build 1607). The installer itself is around 1.7MB and the only component you need to install for this process is Deployment Tools, which is around 68MB
- Now, to create an ISO image that will work with BIOS-based systems, assuming the USB Key we just made is available at U: and you're creating the ISO image on D:
- Run the Deployment and Imaging Tools Environment (Command Prompt) as Administrator, change to the "amd64\oscdimg" folder and then type the following:
- oscdimg.exe –l<disc_label> -m -u2 –b<path_of_bootable_img_file> <path_of_installation_source> <path_where_ISO_is_to_be_created>
- Please see this link for an explanation of the oscdimg.exe command-line options
- Example:
oscdimg.exe -lSVR2016BIOS -m -u2 -b"U:\boot\etfsboot.com" "U:\" "D:\Svr2016BIOS.iso"
- If you wish to create an ISO image that will work on both BIOS-based and UEFI-based systems such as a Hyper-V 2012 R2 and 2016 Gen 2 guest instance, assuming the USB Key we just made is available at U: and you're creating the ISO image on D: (this uses a modified version of the instructions found here):
- Run the Deployment and Imaging Tools Environment (Command Prompt) as Administrator, change to the "amd64\oscdimg" folder and then type the following:
- oscdimg -l2016UEFI -m -o -u2 -udfver102 -bootdata:2#p0,e,b"U:\boot\etfsboot.com"#pEF,e,b"U:\efi\microsoft\boot\efisys.bin" "U:\" "D:\2016-ei-UEFI.iso"
- Please see the original post (here) for more information on the command-line options used.
- Now, you can burn this ISO image to a DVD or simply use it as the source for a Hyper-V guest and because it contains both the BIOS and UEFI boot data, it can be used to install either a Gen 1 (BIOS) or Gen 2 (UEFI) Hyper-V Guest. :)
Enjoy!
Regards,
The Outspoken Wookie