This will work only if you put again on same drive it was before the source folder/file and decompress there the VHD, if you do this on another drive, this DO NOT WORK.
There are powershell dism cmdlets
https://docs.microso...ll/module/dism/More ideas, no I'havn't tried this so far.
Copy the vhd and the wim file to a new drive, mount the vhd image and run Update-WIMBootEntry
Adjust the drive letter and path to current layout.
PS C:\> Get-WIMBootEntry -Path "C:\"
PS C:\> Update-WIMBootEntry -Path "C:\" -DataSourceID 0 -ImagePath "D:\Windows Images\install.wim"
There are more features like Add-WindowsImage, New-WindowsCustomImage.
Run 7-zip and open the vhd image. Compare file sizes.
If there is small size used, it's a link to the wim file.
fsutil support some wim too:
fsutil wim enumwims c:
0 {81BD618E-53E3-4C0D-8794-48204F4B17AB} 00000001 D:\windows\system.wim:1
As for a plain default WimBootCompress.ini
[PrepopulateList]
bootstat.dat
*winload.*
*winresume.*
wof.sys
\Windows\System32\Config\SYSTEM
\Windows\System32\PlatformManifest\*
C:\Windows\System32\drivers>for %a in (*.sys) do fsutil wim queryfile %a
wof.sys is extracted, part of the vhd file.
Bootmgr loads this driver and can read wim files next.
pci.sys is a link to the wim file. It's not part of the VHD file.
There is no driver stack to the wim file at early boot.
grub4dos VHD RAM booting uses BIOS.
Bootmgr has to have access to the wim file.
Bootmgr searches a BIOS disk {81BD618E-53E3-4C0D-8794-48204F4B17AB}.
This can be a internal or a external USB disk.
We may like the default setting:
small vhd file, low RAM usage, files are read from the wim file. Changes are lost at reboot.
At the other hand, another approach is nice.
inclulde more files to the vhd image. E.g. all files from ntbtlog.txt.
Bigger vhd image, more RAM usage, more files are read form the RAM disk, faster at boot. Driver stack may work more hardware.
Both apporaches are useful, a user has to define his needs.