2

My question is continuation of post https://superuser.com/a/1435841

I had installed WSL, installed Ubuntu app from Microsoft Store, made smth into Ubuntu, then I backed it to tar archive by command

wsl –export Ubuntu C:\Programs\ubuntu.tar


Now I'm trying to restore Ubuntu to the state, that were backed up into archive.

I'm confusing what steps I should to do?

1) Install Ubuntu app from store
2) run "wsl --import -d Ubuntu C:\Programs\ubuntu.tar"

or

1) run "wsl --import -d Ubuntu C:\Programs\ubuntu.tat"
2) Install back Ubuntu app from Store

or I haven't need to install app from store?

But then i'm losing short way to type "ubuntu" in search and run ubuntu app


UPDATE: tried to move tar on another PC (Windows 10 Pro v1803), installed here wsl in powershell, trying to import and...

C:\Users\nameless>wsl --import Ubuntu C:\Ubuntu C:\disc\ubuntu.tar
Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore

Okay, in Windows 10 Pro v1903 that has been fixed!

Biswapriyo
  • 11,584
Mike
  • 123

1 Answers1

1

According to how I read the documentation, importing a WSL distribution is not connected at all to the Microsoft Store.

You do the import using the command of:

wsl --import <DistributionName> <InstallLocation> <Full path to .tar FileName>

From now on WSL knows about DistributionName, but the Microsoft Store doesn't.

To execute this distribution you will need the command of:

wsl --distribution <DistributionName>

This means that just running ubuntu.exe (or whatever) will not work, unless you add it to the PATH environment variable.

You might try to install the distribution from the Microsoft Store, then overwrite it, using its name (which you can also see using wsl --list). This might work so the imported distribution is both registered in the Microsoft Store and in the PATH (but I haven't tried it myself).

harrymc
  • 498,455