I'm trying to migrate my WSL1 Ubuntu 18.04 distro from my old Dell laptop to my new HP laptop that has WSL2 setup. I've run through the following steps many times:
Export the distro on the old laptop (making sure to run Command Prompt in admin mode):
wsl --export Ubuntu-18.04 C:\Users\[myusername]\Ubuntu-18.04.tarMove the TAR file to the new laptop via a USB drive.
Import the distro on the new laptop (again making sure to run Command Prompt in admin mode):
wsl --import Ubuntu-18.04 C:\Users\[myusername]\Ubuntu-18.04\ C:\Users\[myusername]\Ubuntu-18.04.tar
Every time it fails with the generic message Unspecified error. I've tried adding the argument --version 1, then tried it with --version 2, no difference.
I've heard that this can happen if you run out of memory during the import process. I have 16 gigs of RAM and a quad core processor on the new laptop, plus the distro TAR file is only about 3.3 gigs, so that seems unlikely. Nevertheless I tried making a .wslconfig file in the home directory with absurdly generous provisions:
[wsl2]
memory=8GB
processors=4
swap=120GB
All to no avail, even with the --version 2 option. It just fails much more quickly. (Regarding that huge swap size, I have 405 gigs of free disk space, in case that matters.)
I've even gone to the trouble of upgrading Windows on my old laptop to version 2004, upgrading to WSL2 (while keeping my Ubuntu distro at version 1) and re-exporting the distro to see if that made a difference, but of course it didn't.
Keep in mind that I don't want to have to upgrade my Ubuntu distro to use WSL2 just yet if it can be avoided. I'll do it if it must be done, but this process is supposed to work smoothly even when migrating a WSL1 distro to a WSL2 system. What could be going wrong??