Saturday 5 December 2020

Use Ventoy to boot WinPE ISOs such as c't Emergency Windows 2021 ISO (aka 'ctNotWin', 'ctNotFall' etc.)

Easy2Boot and agFM can boot WinPE-based ISOs easily, however many of these ISOs require access to files on the 'DVD' drive once they have booted to WinPE.

Since these files are inside the ISO file on the USB drive, these extra utilities cannot be found by the miniWindows environment and you may find some Desktop and StartMenu items missing!

E2B and agFM can make this work however by using that fact that most WinPE's are built using WinBuilder which typically contain this extra startup code. When a WinPE made by WinBuilder boots, it looks for a volume containing a .ini file in the root (e.g. \WIN10PESE.ini) which specifies the path of an ISO file. WinPE will then find that ISO file and auto-mount it as a virtual DVD drive so that WinPE can now access the files within the ISO.



E2B and agFM will modify these .ini files before booting the ISO (that is one reason why a write-enabled USB drive is required). The ISO filename should not contain spaces because some versions of WinBuilder cannot cope with spaces in filenames.

However, this only works if the WinPE contains this special WinBuilder startup code which looks for the special WinBuilder .ini file.

E2B and agFM also modify the \AutoUnattend.xml file in the root of the E2B USB drive - this file is automatically run if the ISO is a Windows Install ISO (but it is not usually run by WinPE ISOs).

c't Emergency ISO

Unfortunately, some WinPE ISOs do not contain this special startup code (e.g. c't Emergency Windows 2021). There are a number of ways around this:

1. Use 'Ventoy for Easy2Boot' - Ventoy has the unique ability to inject code into the boot.wim files which are loaded into RAM and it can cause the ISO file to be mounted as a virtual DVD drive within WinPE. This means that you can boot from most WinPE ISOs and expect to find the original 'DVD' drive in Explorer as drive Y:. i.e. it just works! Always test Ventoy on a real system - some UEFI64 payloads seem to have problems running from Ventoy on a Virtual Machine such as VirtualBox!

Tip: Add 'Ventoy' to the filename to remind you to run it using Ventoy.

2. Convert the ISO to a .imgPTN23 file using the Easy2Boot MPI Tool Kit and the MPI_FAT32 Desktop shortcut. This is the most reliable way because the WinPE will just see a normal 'flat file' FAT32 partition containing all the program files, etc. (i.e. same as booting from a USB drive prepared by Rufus or Etcher). It should also perform better if you are Secure booting because no special Kaspersky boot shim is used - only signed Microsoft boot files.

3. Extract the files - Instead of using the .ISO file, you can simply extract and rename the \sources\boot.wim file which is inside the ISO file (e.g. \_ISO\MAINMENU\MySpecialWinPE.wim). Then extract the rest of the contents of the ISO to a partition on your E2B USB drive. In the case of the c't Emergency ISO, you would copy the file CDUsb.y to the root of the E2B Partition 1 volume and also the whole \Programs folder:

\Programs\(various folders)

Obviously, you can only do this for a few ISOs and not for two ISOs which use the same folder structure, so this approach is limited and not recommended.

4. Boot to the .ISO file using E2B or agFM, using WinPE Explorer find the same ISO file on the E2B USB drive and right-click on it and choose the 'Mount' option (sometimes you can use ImDisk if it is present) to mount the ISO as a virtual drive. You will now need to run the WinPE startup commands again. For instance, if the PECmd.exe was used (as is the case with this c't ISO), you type WinKey+R to run a command and type 'pecmd X:\windows\system32\pecmd.ini' as Admin.

Building the c't Emergency ISO

  1. First mount a Windows 10 x64 Install ISO as a virtual drive (e.g. as drive M:). 
  2. Next run the PEBakerLauncher.exe file from the c't download (extract the zip file to an empty folder first).
  3.  If prompted to install anything (e.g. .Net Core 3.1) onto your Windows then do this and try again. 
  4. Select the Windows virtual drive (e.g. M:) in PEBakery.
  5. Click on the large  white 'Build' triangle at the top  to start the build of the ISO file. 
  6. You may have to 'Ignore' quite a few AntiVirus warnings during the build or even temporarily disable your AV whilst PEBakery is running.

I got no errors (apart from Comodo AV warnings) and my Windows 10 PC built the ISO correctly on the first attempt! 

Note: The c't WinPE Desktop is in German.

No comments:

Post a Comment