WIMBOOT question

Comments, questions, bug reports, etc.
Post Reply
misty
Posts: 12
Joined: Tue Aug 18, 2015 10:23 am

WIMBOOT question

Post by misty »

I've just checked install.wim from Windows 7 SP1 source - it uses LZX compression with a chunck size of 32768. Whilst it's not marked with the WIMBOOT flag, the compression and chunk size would appear to be WIMBOOT compatible (based on information in https://wimlib.net/man1/wimlib-imagex-apply.html) -
"...the Microsoft driver can externally back files from WIM files that use XPRESS chunks of size 8192, 16384, and 32768, or LZX chunks of size 32768, in addition to the default XPRESS chunks of size 4096 that are created when wimlib-imagex capture is run with the --wimboot option..."
The same documentation also states that -
"...You actually can still do a --wimboot extraction even if the WIM image is not marked as "WIMBoot-compatible". This option causes the extracted files to be set as "externally backed" by the WIM file. Microsoft’s driver which implements this "external backing" functionality seemingly does not care whether the image(s) in the WIM are really marked as WIMBoot-compatible. Therefore, the "WIMBoot-compatible" tag (<WIMBOOT> in the XML data) seems to be a marker for intent only..."
What I'd like to do is the following -
* Extract image 4 (Windows 7 Ultimate) from my source file install.wim - specifying the --WIMBOOT flag
* Copy wofadk.sys to the offline system extracted from install.wim
* Mount the SYSTEM registry hive extracted from install.wim and apply the wofadk.sys settings
* Run bcdboot on the extracted system
* Boot into the extracted system and complete setup

As WimBootCompress.ini is missing in the source install.wim (and I don't want to inject it in this instance as it will modify my original Windows 7 source file) and it's not possible to specify --config in the apply command, it's a non-starter.

If it was possible to add the option to specify a config file for apply, would this override any existing \Windows\System32\WimBootCompress.ini?

Hope this makes sense.

And this is not a feature request. Application is so limited I doubt it's worth the effort - it's more a proof of concept.

Regards,

Misty

P.s. Although WIMBOOT is not officially supported in Windows 7, it does work if wofadk.sys is added and JFX's WimBootCompress.ini is used (see Comparision of --compact compression formats)
synchronicity
Site Admin
Posts: 474
Joined: Sun Aug 02, 2015 10:31 pm

Re: WIMBOOT question

Post by synchronicity »

It's not possible to specify a custom WimBootCompress.ini for apply per se, but any existing WimBootCompress.ini in the image will be honored, and it's possible to add one beforehand by updating the image (or by exporting a copy of the image and updating the copy).
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: WIMBOOT question

Post by zipmagic »

Hey Misty,

WIMBoot in Windows 7 is very complex.

I have tested each and every version of wofadk.sys available.

Some of these cause blue screen errors; others simply cause Windows to boot into "recovery mode" without a chance of repair.

See my other thread in this forum for more information on this topic.

Essentially, it *may* work if you're running a clean virtual machine or similar installation of Windows 7.

Otherwise, even if you exclude the entire windows\* folder, results are very erratic, and you'll get either boot failures or blue screens on some systems.

Do let me know if you figure this out - as I would love to add Windows 7 support to DoubleSpace!

Take care.
misty
Posts: 12
Joined: Tue Aug 18, 2015 10:23 am

Re: WIMBOOT question

Post by misty »

Hi zipmagic,

In answer to your question, my Windows 7 test system was relatively "clean" - no updates were installed and only a couple of programs were installed. Following notes may be of use to you. I can't comment on whether this will work on others systems or with other setups.

Credit to JFX for identifying the [PrepopulateList] settings in WimBootCompress.ini and wofadk.sys registry settings.

SHA1 checksum of the wofadk.sys I used is C70E865AA19B37ED48008564A512FEF26047A8ED - if memory serves it was downloaded using JFX's excellent GetWaikTools.

Some notes on my system setup.

Lenovo Thinkpad T420. Firmware set to boot in UEFI mode only - GPT disk type. Multiboot setup with the following Partition layout -
- Partition 1 - EFI
- Partition 2 - MSR
- Partition 3 - Windows 7 (SP1)
- Partition 4 - Windows 8.1 (Update 1)
- Partition 5 - Windows 10
- Partition 6 - Data

Windows 7 WIMBOOT was prepped when booted into Windows 8.1. Following partitions were mounted -
- C:\ - Windows 8.1 (Partition 4)
- D:\ - Data (Partition 6)
- E:\ - Windows 7 (Partition 3)

Following steps carried out from the booted Windows 8.1
- wofadk.sys copied to E:\Windows\System32\drivers
- wofadk.sys settings applied to offline registry hive (see script below)
- WimBootCompress.ini copied to E:\Windows\System32 (see contents below)
- wimlib-imagex.exe capture E:\ D:\win7_wimboot.wim "Win7 (WIMBOOT)" --wimboot
- Drive E:\ was then formatted
- wimlib-imagex.exe apply D:\win7_wimboot.wim 1 E:\ --wimboot

Boot files did not need creating/editing as they were still intact (on Partition 1)

System rebooted. Subjectively the wimboot Windows 7 system felt a bit slow in use - but worked.

wofadk registry settings

Code: Select all

@echo off
SET TARGET=E:

cls
echo This batch will add registry settings for wofadk.sys
echo and will copy the file to the drive %TARGET%
echo.
pause

cls
echo Loading registry Hive -
echo.
reg.exe load HKLM\_SYSTEM %TARGET%\Windows\system32\config\system
echo.
echo.
echo.

echo Adding WofAdk registry settings - 
echo.
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v Discription /t REG_SZ /d "WofAdk Mini-Filter Driver" /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v DisplayName /t REG_SZ /d "WofAdk" /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v ErrorControl /t REG_DWORD /d 1 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v Group /t REG_SZ /d "FSFilter Compression" /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v Start /t REG_DWORD /d 0 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v SupportedFeatures /t REG_DWORD /d 3 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v Type /t REG_DWORD /d 2 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v DebugFlags /t REG_DWORD /d 0 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v AutoAttach /t REG_DWORD /d 1 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v Tag /t REG_DWORD /d 2 /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v DependOnService /t REG_MULTI_SZ /d FltMgr /f
reg.exe add HKLM\_SYSTEM\ControlSet001\services\WofAdk /v ImagePath /t REG_EXPAND_SZ /d \SystemRoot\System32\drivers\wofadk.sys /f
reg.exe add "HKLM\_SYSTEM\ControlSet001\services\WofAdk\Instances" /v DefaultInstance /t REG_SZ /d "WofAdk Instance" /f
reg.exe add "HKLM\_SYSTEM\ControlSet001\services\WofAdk\Instances\WofAdk Instance" /v Altitude /t REG_SZ /d 40730 /f
reg.exe add "HKLM\_SYSTEM\ControlSet001\services\WofAdk\Instances\WofAdk Instance" /v Flags /t REG_DWORD /d 0 /f
echo.
echo.
echo.

echo Unloading registry Hive -
echo.
reg.exe unload HKLM\_SYSTEM
echo.
echo.
echo.
pause
WimBootCompress.ini contents

Code: Select all

; This is the inbox configuration file used for deploying or capture a
; WIMBoot system. Please do not remove this file because WIMCaptureImage 
; and WIMApplyImage will fail if WIM_FLAG_WIM_BOOT flag is specified.
;
; [PrepopulateList] copied from JFX's  WinNTSetup
; [ExclusionList] copied from WimBootCompress from Windows 8.1 Update 1 source
;

[PrepopulateList]
*winload.*
*winresume.*
\Windows\AppPatch\drvmain.sdb
\Windows\Fonts\vgaoem.fon
\Windows\Fonts\vgasys.fon
\Windows\INF\errata.inf
\Windows\System32\config\*
\Windows\System32\ntkrnlpa.exe
\Windows\System32\ntoskrnl.exe
\Windows\System32\bootvid.dll
\Windows\System32\ci.dll
\Windows\System32\hal*.dll
\Windows\System32\mcupdate_AuthenticAMD.dll
\Windows\System32\mcupdate_GenuineIntel.dll
\Windows\System32\pshed.dll
\Windows\System32\apisetschema.dll
\Windows\System32\api-ms-win*.dll
\Windows\System32\ext-ms-win*.dll
\Windows\System32\KernelBase.dll
\Windows\System32\drivers\*.sys
\Windows\System32\*.nls
\Windows\System32\kbd*.dll
\Windows\System32\kd*.dll
\Windows\System32\clfs.sys
\Windows\System32\CodeIntegrity\driver.stl
\Windows\Boot\DVD\*
\Windows\Boot\EFI\*
\Windows\bootstat.dat

[ExclusionList]
\$bootdrive$
\$dwnlvldrive$
\$lsdrive$
\$installdrive$
\$Recycle.Bin\*
\bootsect.bak
\hiberfil.sys
\pagefile.sys
\ProgramData\Microsoft\Windows\SQM
\System Volume Information
\Users\*\AppData\Local\GDIPFONTCACHEV1.DAT
\Users\*\NTUSER.DAT*.TM.blf
\Users\*\NTUSER.DAT*.regtrans-ms
\Users\*\NTUSER.DAT*.log*
\Windows\AppCompat\Programs\Amcache.hve*.TM.blf
\Windows\AppCompat\Programs\Amcache.hve*.regtrans-ms
\Windows\AppCompat\Programs\Amcache.hve*.log*
\Windows\CSC
\Windows\Debug\*
\Windows\Logs\*
\Windows\Panther\*.etl
\Windows\Panther\*.log
\Windows\Panther\FastCleanup
\Windows\Panther\img
\Windows\Panther\Licenses
\Windows\Panther\MigLog*.xml
\Windows\Panther\Resources
\Windows\Panther\Rollback
\Windows\Panther\Setup*
\Windows\Panther\UnattendGC
\Windows\Panther\upgradematrix
\Windows\Prefetch\*
\Windows\ServiceProfiles\LocalService\NTUSER.DAT*.TM.blf
\Windows\ServiceProfiles\LocalService\NTUSER.DAT*.regtrans-ms
\Windows\ServiceProfiles\LocalService\NTUSER.DAT*.log*
\Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.TM.blf
\Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.regtrans-ms
\Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.log*
\Windows\System32\config\RegBack\*
\Windows\System32\config\*.TM.blf
\Windows\System32\config\*.regtrans-ms
\Windows\System32\config\*.log*
\Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.TM.blf
\Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.regtrans-ms
\Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.log*
\Windows\System32\sysprep\Panther
\Windows\System32\winevt\Logs\*
\Windows\System32\winevt\TraceFormat\*
\Windows\Temp\*
\Windows\TSSysprep.log
\Windows\winsxs\poqexec.log
\Windows\winsxs\ManifestCache\*
\Windows\servicing\Sessions\*_*.xml
\Windows\servicing\Sessions\Sessions.back.xml

Misty
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: WIMBOOT question

Post by zipmagic »

Hi Misty,

Thanks for a very helpful post - you're most kind as always!

I'll let you know if there's anything new here after investigating.

If you want, I can also provide you with the "alpheta" builds of the DoubleSpace version 4 software.

This version adds support for Windows 7 WIMBoot'ing, with the same ease and functionality as it has for other operating systems.

You can WIMBoot an existing system, etc.

However, all of the caveats I mentioned earlier stand - and unless there's a magical bullet in what you have shared (I'm hoping there is!), this software would never see production use, simply because Windows 7 (and Server 2008 R2) systems randomly blue-screen after processing.

Anyways, enough said already. Now I'll compare our implementations and let you know if there's anything I may have missed!

Take care!
zipmagic
Posts: 61
Joined: Thu Aug 06, 2015 7:09 am

Re: WIMBOOT question

Post by zipmagic »

Unfortunately, Misty; the items you have shared are a subset of my existing exclusions.

If you're interested, I'm still happy to share with you DoubleSpace 4 - maybe you can find out something I've missed?

Otherwise, even with these exclusions, there's many issues booting into Windows 7 in "real world" usage.
Post Reply