On Windows 10 Pro and 11 Pro I have installed and activated Ubuntu-20.04 and Debian. Using the documentation from MS on switching those distros to a secondary drive, everything seemed to work fine. Until the WSL import command. It outputs "Access is denied". I’ve tried Windows Terminal, PowerShell, and even WebStorm; I get the same output.
I am running with elevated privileges but to no avail. The export works fine, I use a different name as the source file to ensure I restore the name to its original name. The wsl.conf editing looks good, everything lines up… until the import command.
I am at a loss. I’ve exhausted all research. Can anyone help me resolve this so I can run these from my F: drive?
Cheers,
RN
4
Answers
You just have to put a filename in the end, like:
Suppose you want to import an exported distribution "ubuntu.tar".
Try to cd at the location of the .tar file before executing the wsl –import command in PowerShell (running as standard user), for example:
Executing the wsl –import command with an absolute path didn’t work for me, but the above mentioned method did.
Just in case this is an ongoing issue for anyone, you need to run
wsl --import
not just from an Administrator account, but you need to run Powershell/cmd as Administrator, for example by right-clicking a pwsh.exe icon/shortcut and clicking "Run as administrator". If you’re running as a standard user and "Run as administrator", the import will install the distro for the admin user you’ve chosen to run as.The full syntax is:
The import syntax is as following, you should be carefull about install dir and imported tar file’s arguments order: