I am trying to create a dual boot system for my public library computers using Steadier State as my starting point to boot Windows 7 Ultimate from a VHD file. The other OS is Linux Mint 17.
I have figured out how to do this, but I'm trying to perfect the approach.
Steadier State (SS) is a set of scripts designed by Mark Minasi to convert a system to run from a VHD file. It uses WinPE as a sort of "supervisor" that decides if bootmgr should boot the VHD file or WinPE. It does NOT provide the ability to always reboot to a standard "template" version of the OS, thereby ALWAYS discarding the snapshot.VHD file. However, I got around that by creating a one line shutdown script in Windows that uses bcdedit to switch the default bootmgr entry, so on shutdown that script sets the default to boot WinPE, which will perform the "rollback" and reboot to the snapshot.VHD file.
As I said it all works OK, except every system restart requires 2 boot cycles: 1) Boot WinPE; if no maintenance flag is set delete the snapshot.VHD file and use diskpart to recreate a new one against the parent image.VHD file. It then changes the boot\BCD file so the next boot will be the new snapshot.VHD boot entry in bootmgr. 2) Reboot to the freshly created snapshot.VHD file. This effectively "rolls back" all changes done in the last session of running Windows from the snapshot.VHD file.
Unlike wioski, which avoids this "double reboot" scenario using clever tricks with /unattend.xml and MDT in the setup / deployment, SS is not as sophisticated.
Now grub2 is a very capable bootloader that includes some limited scripting capabilities. If I could put the SS logic of what to boot into a grub2 script I might be able to eliminate the need for WinPE and therefore reduce the process to a single boot cycle.
I recompiled grub2 to include support for lua, a small scripting language used by many applications. I was hoping to copy into place the appropriate BCD and snapshot.VHD files before chainloading to bootmgr, which would put grub2 in the drivers seat completely in controlling whether to reboot to a pristine, new snapshot.VHD file or to boot WinPE if the maintenance flag (a file of a specific name is present or not) is set.
Unfortunately I discovered grub2 has zero filesystem write functionality, and therefore neither does the lua module as it relies on grub.run (there is no os. or io. object) to access the filesystem. So lua under grub2 won't help me it seems.
Could bootmgr be made to look in different places or in different files for its BCD info? If so can different grub2 menuitems be defiined to invoke bootmgr so it uses BCD.a for one menuitem but BCD.b for a different menuitem?