Software Applications in regulated domains use customized OS based on an embedded OS such as WES7 or Win10 IOT. This is for restricting access and also to provide a highly controlled environment.
The application software installation can be time consuming as it involves first formatting and installing the OS; then installing application software. With multiple releases of the software and limited resources, installation of an older release can be painful especially if it's DVD based due to wear and tear.
A Virtual Hard Disk or VHD is nothing but a flat file on the disk of host PC, which can be mounted as a Hard disk on the system with multiple partitions. Further a VHD can be made bootable by adding an entry to the boot menu. A VHD can be created using DiskMgmt control panel app or using diskpart.exe.
A VHD can come very handy where OS + Application can be pre-installed on a VHD. It simply can be mounted and made bootable on demand. In other words, a single PC can run multiple installations on demand without requiring an installation. The file can be even copied and deployed on a different but compatible PC.
Example
Consider a typical software application that runs on a customized embedded OS. The volume layout can be as below.C: OS + Application Software
D: Data
Create a VHD
A VHD can be created using DiskMgmt control panel app or diskpart.exe. The example below creates a VHD with a matching volume layout as shown above.After running the script, the VHD can be visualized as shown above diskmgmt.msc
Load OS into VHD
The next step is to format the active partition on the VHD and load OS into it using imagex commandNote that H: is the system partition as shown above. This usually loads syspreped image of the OS
imagex /apply Installer.wim 1 H:
Make VHD bootable and make it default
bcdboot h:\windowsBoot files successfully created.
bcdedit /set {default} description "Some App 1.0"
The operation completed successfully.
Reboot
After reboot a new boot menu entry is added as shown below and is automatically selected to boot from.
Load Application Software
Once OS is installed, the Application software will be loaded as a part of the installation.
Source and Binaries can be found here.