pxlrbt / move-wsl

Easily move your WSL distros VHDX file to a new location.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot chose Distro in Interactive Mode

SebeeDev opened this issue · comments

I have only one distro and it just treats (Default) as part of a name, so I needed to use the Explicit way instead of Interactive one.
Output from Interactive Mode

$ ./move-wsl
1) Ubuntu-20.04(Default)
Select distro to move: 1
Enter WSL target directory: E:\WSL

Move WSL 'Ubuntu-20.04(Default)' to E:WSL? (Y|n) Y
Creating target dir "E:WSL" ...
Exporting VHDX to "E:WSL/Ubuntu-20.04(Default).tar" ...
There is no distribution with the supplied name.
ERROR: Export failed. E:WSL/Ubuntu-20.04(Default).tar does not exist.

Output from wsl -l command

PS Z:\> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)

@SebeeDev My bad. I took care of the german appendix (Standard) but forgot any other languages. Can you test whether version https://github.com/pxlrbt/move-wsl/releases/tag/1.1.1 works for you? It should ignore everything in brackets now.

Now this issue is solved

xxx@xxx-PC MINGW64 /e/WSL
$ ./move-wsl
1) Ubuntu-20.04
Select distro to move: 1
Enter WSL target directory: E:/WSL/U

Move WSL 'Ubuntu-20.04' to E:/WSL/U? (Y|n) Y
Creating target dir "E:/WSL/U" ...
Exporting VHDX to "E:/WSL/U/Ubuntu-20.04.tar" ...

But when there are no WSL distros installed it shows:

xxx@xxx-PC MINGW64 /e/WSL
$ ./move-wsl
1) Distributions              6) visiting
2) can                        7) the
3) be                         8) Microsoft
4) installed                  9) Store:
5) by                        10) https://aka.ms/wslstore
Select distro to move:

And here is wsl -l output:

xxx@xxx-PC MINGW64 /e/WSL
$ wsl -l
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

Now this issue is solved

Great this works now.

But when there are no WSL distros installed it shows:

Not sure whether it's worth handling this edge case. Should be obvious that you need an Distro installed to move it. Worst case here is that export fails.