Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving WSL2 (Windows 10, build 18917) virtual harddisks are not yet supported #90

Closed
noctarius opened this issue Jun 17, 2019 · 12 comments

Comments

@noctarius
Copy link

Using lxrunoffline with a WSL2 environment, the rootfs is not found for moving it, which is obviously because it's in a virtual hard disk.

C:\>LxRunOffline.exe m -n Ubuntu -d z:\wsl
[ERROR] Couldn't open the directory "\\?\C:\Users\...\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\".
Reason: The system cannot find the file specified.

The actual virtual hard disk image path is: C:\Users\...\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx

Happy to help with more information to support WSL2 :)

@noctarius noctarius changed the title WSL2 virtual harddisks are not yet supported WSL2 (Windows 10, build 18917) virtual harddisks are not yet supported Jun 17, 2019
@DDoSolitary
Copy link
Owner

DDoSolitary commented Jun 17, 2019

Thanks for reporting. I was quite busy in the past few months so I'll focus on dealing with the backlog accumulated during that time (like #81) to provide a better support for WSL1 and introduce support for WSL2 some time later.

@teepean
Copy link

teepean commented Jun 28, 2019

I converted an existing machine and it runs with a following command line:

LxRunOffline.exe run -w -n BionicX /setdefaultuser user1

@DDoSolitary
Copy link
Owner

@teepean In theory the run command should work because it simply calls WslLaunchInteractive() which is provided by Windows. However, why did you append /setdefaultuser user1 in your command? It's not a valid argument and will be simply ignored.

@teepean
Copy link

teepean commented Jun 28, 2019

However, why did you append /setdefaultuser user1 in your command? It's not a valid argument and will be simply ignored.

That is a good question. Looks like I have used it with lxrun and for some reason used it with lxrunoffline.

@noctarius You should try running WSL2 with the following command:
LxRunOffline.exe run -w -n Ubuntu

@noctarius
Copy link
Author

Not trying to run a WSL2 shell, I tried moving it, in which the rootfs cannot be found, since it's a single file and not a directory anymore.

Maybe I wasn't clear enough.

@noctarius noctarius changed the title WSL2 (Windows 10, build 18917) virtual harddisks are not yet supported Moving WSL2 (Windows 10, build 18917) virtual harddisks are not yet supported Jun 28, 2019
DDoSolitary added a commit that referenced this issue Jul 6, 2019
@DDoSolitary
Copy link
Owner

Basic WSL2 support is ready now. Please note that features related to reading/writing the contents of the VHDX image will not be supported. You can use the official wsl tool instead in that case.

@noctarius
Copy link
Author

Nice! Thanks a lot, moving support is all what is necessary :) 👍

@xeijin
Copy link

xeijin commented Jul 28, 2019

@DDoSolitary stupid question but a WSL2 distro which has been run through lxRunOffline won't work on older builds of Windows 10, right?

@DDoSolitary
Copy link
Owner

@xeijin WSL2 distros won't work on older builds that don't support WSL2. FWIW you can always convert a WSL2 distro back to WSL1 using wsl --set-version.

@DDoSolitary DDoSolitary mentioned this issue Jul 30, 2019
@kapilgorve
Copy link

kapilgorve commented Apr 29, 2020

TLDR: Convert your distro to v1 . Then move and convert again to v2.
I added a small note on how to do this.
https://www.jskap.com/notes/how-to-move-wsl2-disto/

@DDoSolitary
Copy link
Owner

DDoSolitary commented Apr 29, 2020

@kapilgorve Moving A WSL2 distro with the latest version of LxRunOffline is expected to work. Please let me know if it doesn't.

@kapilgorve
Copy link

Right I had an older version installed. I will try with latest version. If there are any issues. I will post here. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants