I wanted to cleanup the partition table on my drive, so I grabbed another drive and made a Windows To Go workspace. In that WTG system, I backed up my exising Windows 10 with DISM. Then I cleaned the disk and re-partitioned before I attempt to apply the WIM image back.

Now however I attempt to apply or mount the image, both DISM and ImageX get stuck and quit at file \Users\iBug\AppData\Local\lxss\rootfs\lib\xtables\libip6t_HL.so. Both are reporting "Error 5: Access denied." I know it's a file from Windows Subsystem for Linux.

I set up 7-Zip and opened the WIM file and it seems OK. I navigated to that folder and was surprised to see 2 files with the same name there, only differing by cases. That is, I have libip6t_HL.so AND libip6t_hl.so in the same place. I think that's the problem because NTFS doesn't have its case sensitivity support enabled by default (it does have support, though).

So how can I apply the WIM correctly? I am eager to destroy those files (or even the whole WSL setup if required).


Finally restored my Windows 10 installation from backup!!!

I used a Chinese utility called WimTool. In its main UI there's a "Edit Configuration" button. I added \Users\iBug\AppData\Local\lxss to [ExclusionList] section, then applied the WIM. As expected, the folder was ignored and no more errors popped up. After restoring Windows 10 setup, simply reinstall WSL.

According to my experience, non-Chinese users should be able to do this without that tool, but ImageX. Microsoft provided a tutorial on creating ImageX configuration file, and in the tutorial they disclosed the Default Exclusion List for ImageX (same for DISM). All you need to do is copy down the default list and add the desired line to it. Then when applying the image, supply /Config yourfile.ini to ImageX and it'll ignore your specified directories.



This is a known problem with imagex in Windows 10 1607. There's a Microsoft KB article on it. The article doesn't say if Windows 10 1703 fixes it.

Microsoft's "solution" is to not install WSL before capturing the image. Your solution of excluding the lxss directory is better :-). Still a Pain In The ASCII to have to reinstall WSL.

  • The problem is, I didn't know the bug before capturing, and all I have is the WIM file after formatting the drive and attempting to restore (and noticed the error). – iBug Aug 12 '17 at 3:08

You can use the wimupdate in wimlib to remove the WSL, and then you will be able to successfully restore the image.

The specific command is as follows:

cat > update_commands.txt << EOF
delete --recursive /Users/{your_username}/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc

wimupdate {your_backup}.wim 1 < update_commands.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.