I've tried the steps here for using a ext4.vhdx file to create a new WSL2 instance, but I'm running into a problem.
The referenced answer:
- Set up WSL, as usual. Make sure you do the
wsl --set-default-version 2step.- Install the same distribution from the Microsoft Store that you had on the previous machine
- Run it for the first time, creating the same username as on the previous computer.
- Exit WSL
wsl --shutdownfrom PowerShell or CMD- Copy the old
ext4.vhdxover the newly created one. I'm guessing you know the location, since you backed it up on the old computer, but it's going to be in%userprofile%\AppData\Local\Packages\<distribution_package>\LocalState. If you don't find anext4.vhdx, and instead find arootfsfolder, then the distribution was created as WSL1.
So, this is what I tried, with one exception, but I get the following error:
The virtual machine or container was forcefully exited.
My one exception is that the previous version installed was Ubuntu 22.04.1.6.0, while my newly installed version is 22.04.1.7.0
Is there a way to get 22.04.1.6.0? Or another fix for my particular error?
The old machine is over-written by the new machine, so doing an wsl --export isn't an option.