Originally published January 4, 2020 @ 3:19 am
Microsoft’s WSL is interesting. I’d go as far as to say that I like it. The mistake here would be to forget that your Linux image is running under Windows, with everything this entails. Making a reliable backup of this thing proved harder than I expected.
I have Acronis True Image running on my Windows 10 laptop, doing a daily backup to a NAS share. This would’ve been perfectly sufficient for restoring any Unix or Linux system. Windows is another story, however.
Simply restoring the rootfs
folder of a damaged WSL Linux image doesn’t do the trick. When you launch the image following such a restore, it will tell you that it is performing an upgrade and will exit shortly thereafter without giving you any clues as to the cause of the problem.
So here’s what I ended up doing…
Install Chocolatey
Run cmd.exe
as admin and copy the appropriate command string from here. It should be something like this:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Install LXRunOffline:
choco install lxrunoffline
List registered images:
cd C:\tools\lxrunoffline LxRunOffline.exe l
Export image to file:
cd C:\tools\lxrunoffline LxRunOffline.exe e -n Ubuntu -f C:\zip\Ubuntu.tar.gz
Import image from file:
cd C:\tools\lxrunoffline LxRunOffline.exe i -n UbuntuNew -f C:\zip\Ubuntu.tar.gz -d C:\Users\username\AppData\Local\Packages\UbuntuNew
Experienced Unix/Linux System Administrator with 20-year background in Systems Analysis, Problem Resolution and Engineering Application Support in a large distributed Unix and Windows server environment. Strong problem determination skills. Good knowledge of networking, remote diagnostic techniques, firewalls and network security. Extensive experience with engineering application and database servers, high-availability systems, high-performance computing clusters, and process automation.