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

how to move the vhdx of wsl2 to other disk #412

Closed
gao4263 opened this issue Jun 13, 2019 · 42 comments
Closed

how to move the vhdx of wsl2 to other disk #412

gao4263 opened this issue Jun 13, 2019 · 42 comments

Comments

@gao4263
Copy link

gao4263 commented Jun 13, 2019

I install wsl2 , i learn that wsl2 use vhdx as store file, because C disk is small, so I want to move the vhdx file to other disk.

please tell me how to do it. thx

@craigloewen-msft
Copy link
Collaborator

You can do this using the wsl --import feature. Here's an example of me doing this setup.

image

If you run into any more issues please reopen this issue, but otherwise I believe your question is solved so I'll close this out for you. Thank you!

@s-usr
Copy link

s-usr commented Aug 27, 2019

You exported Alpine2 but imported Alpine3. Could you please clarify?

@craigloewen-msft
Copy link
Collaborator

@s-usr I exported my current running version of Alpine called Alpine2 and when importing I need to have another name to import, (since Alpine2 is already taken) so I imported the new distro as Alpine3.

@s-usr
Copy link

s-usr commented Aug 28, 2019

Thanks. It will be nice if we could keep the name as is, because this is not a filename; it is a distribution name.

@s-usr
Copy link

s-usr commented Aug 28, 2019

Hello... I got "Access is denied" on import. I checked the "Security" for the 'source' and 'destination'. I have administrator priviliges. There should be a trick to handle this. Please advise if you came across this error. Thanks.

@s-usr
Copy link

s-usr commented Sep 9, 2019

See microsoft/WSL#4451 as an update.

@LeeYunhang
Copy link

LeeYunhang commented Oct 15, 2019

@craigloewen-msft I have compeletely follow the way you provide, however it seems i lost personal files in my WSL2 distro. Is it a expected behavior or just a bug? :(

@LeeYunhang
Copy link

@craigloewen-msft I have compeletely follow the way you provide, however it seems i lost personal files in my WSL2 distro. Is it a expected behavior or just a bug? :(

I'm sorry, the distro's default user was changed to root, may i bring it back to old user?

@craigloewen-msft
Copy link
Collaborator

@mrcooder yes there is a way to do this in newer builds. What version of Windows are you using? If you're on the Windows Insiders fast ring then you should have access to this feature as we added it in Build 18980. You can find the details here.

@chiqui3d
Copy link

Hello @craigloewen-msft , there is already a way to install Ubuntu distro or any other distro directly on another hard disk, and I have to follow the import method?

@craigloewen-msft
Copy link
Collaborator

Easiest way to do it right now is using the import method. Adding the ability to install to another drive, or move to another drive is something we're tracking here: microsoft/WSL#449

@chiqui3d
Copy link

chiqui3d commented Jan 15, 2020

Thank you, but call me a fool. Because once exported, I don't know what to do anymore.

I checked the wsl -l -v versions and now I have 2:

  NAME            STATE           VERSION
* Ubuntu-18.04    Stopped         2
  Ubuntu18        Stopped         2

So I have unregister the previous version (Ubuntu-18.04) with
wsl --unregister Ubuntu-18.04

Now what do I have to do?

I've tried this

wsl.exe --distribution Ubuntu18

but I get the message:

The process does not have access to the file because it is being used by another process.

If I search for Ubuntu in Start Menu and run it, it reinstalls the version I have uninstalled.

So I don't understand very well, can you help me?


Okay, I just rebooted Windows, and now I can get in. I had to install Windows Terminal(Preview) to be able to enter the distro more easily.

@craigloewen-msft
Copy link
Collaborator

Yes you can run wsl -d Ubuntu18 to boot into it directly, or run wsl -s Ubuntu18 to set it to your default distro and then after that just wsl will launch you into it.

Glad that terminal resolved your probelm!

@siennathesane
Copy link
Contributor

Here is exactly what I did on 19035.1 and it worked without a reboot or errors.

  1. Run powershell.exe as Administrator
PS C:\WINDOWS\system32> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)

# mkdir S:\ISOs\

PS C:\WINDOWS\system32> wsl --export Ubuntu S:\ISOs\ubuntu-wsl.tar

# mkdir w:\VMs

PS C:\WINDOWS\system32> cd w:\VMs
PS W:\VMs> mkdir ubuntu-wsl
PS W:\VMs> wsl --unregister Ubuntu
Unregistering...
PS W:\VMs> wsl --import Ubuntu W:\VMs\ubuntu-wsl S:\ISOs\ubuntu-wsl.tar
PS W:\VMs> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)

@pxlrbt
Copy link

pxlrbt commented Mar 20, 2020

If anybody is interested: I wrote a little bash and batch script for automating these steps.
https://github.com/pxlrbt/move-wsl

@Biswa96
Copy link
Contributor

Biswa96 commented Mar 20, 2020

If allowed, you can do it with just one reg add command.

@Neurrone
Copy link

Neurrone commented May 15, 2020

The instructions that @mxplusb provided worked really well for me, thanks!

I had to add a wsl --shutdown step before doing the import else it returned an error message saying that the operation timed out because the VM isn't responding. Probably caused by my usage of the WSL2 backend with Docker so that machines were still running even after unregistering.

Also, the default username that WSL uses needs to be reconfigured, otherwise it tries to log in as root with the command ubuntu config --default-user <some-user>

Hoping this gets included in the docs since this is extremely useful for SSDs especially.

@Lajovic
Copy link

Lajovic commented Aug 26, 2020

I saw a lot of scary answers with many steps and possible errors here, so I decided to just cut and paste the folder to a bigger HD.

Then I told windows to link both of the folders:
mklink /J C:\...\OldFolderName G:\...\GrowAllYouWantHereFolder

The second folder can have any name. No errors. No reboot. My SSD can breath again.

Btw, don't use powershell, use cmd for this one.

@unavaliabl3
Copy link

unavaliabl3 commented Sep 1, 2020

wsl --import --export command made a lot of disk io, can I just modify the registry of lxss?
I changed the registry key at

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{your linux uuid}\BasePath 

from default to \\?\D:\Path\to\ext4.vhdx , then move ext4.vhdx to that path, reboot WSL2, and it seems work well.

@minlare
Copy link

minlare commented Oct 9, 2020

A combination of @mxplusb and @Neurrone comments were the solution for me. Thanks

@banyh
Copy link

banyh commented Oct 14, 2020

My steps is a combination of @rekaerst, @Neurrone, and @mxplusb

  1. Backup current vhdx file
    from %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
    to D:\ext4.vhdx
    (Most important step. If you can't find correct vhdx file, you shouldn't go ahead)
  2. Remove current distro, like wsl --unregister Ubuntu-20.04
  3. Reinstall distro from Microsoft Store
  4. Export and import
    wsl --export Ubuntu-20.04 D:\wsl.tar
    wsl --unregister Ubuntu-20.04
    wsl --import Ubuntu-20.04 D:\Ubuntu-20.04 D:\wsl.tar
  5. Overwrite original vhdx file
    copy D:\ext4.vhdx D:\Ubuntu-20.04\ext4.vhdx
  6. Set default user
    ubuntu2004.exe config --default-user <username>

@Anutrix
Copy link

Anutrix commented Nov 8, 2020

@banyh Any side effects or do you lose any data?
I wanna try doing it for my kali-linux dist.

@sheep94lion
Copy link

Thanks. It will be nice if we could keep the name as is, because this is not a filename; it is a distribution name.

You can unregister the original distribution before import.

wsl --unregister Ubuntu-18.04

@iegorval
Copy link

My steps is a combination of @rekaerst, @Neurrone, and @mxplusb

  1. Backup current vhdx file
    from %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
    to D:\ext4.vhdx
    (Most important step. If you can't find correct vhdx file, you shouldn't go ahead)
  2. Remove current distro, like wsl --unregister Ubuntu-20.04
  3. Reinstall distro from Microsoft Store
  4. Export and import
    wsl --export Ubuntu-20.04 D:\wsl.tar
    wsl --unregister Ubuntu-20.04
    wsl --import Ubuntu-20.04 D:\Ubuntu-20.04 D:\wsl.tar
  5. Overwrite original vhdx file
    copy D:\ext4.vhdx D:\Ubuntu-20.04\ext4.vhdx
  6. Set default user
    ubuntu2004.exe config --default-user <username>

I have tried to follow these steps, but I got Error: 0x80070057 The parameter is incorrect. error on the last instruction. I am not very familiar with Windows or WSL2. Maybe you know what might be causing the error, and how to correct it? I am unable to link my subsystem to the original vhdx file even on the drive where it was originally located, unfortunately.

@unavaliabl3
Copy link

unavaliabl3 commented Feb 25, 2021

@iegorval Try checking file permission of ext4.vhdx in case you run those commands as the superuser. Also, don't forget to try to turn it on and off again.

From my experience changing Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{randon uuid}\BasePath to new path of ext4.vhdx doesn't require wsl --export, wsl --unregister, distro config --default-user, etc. It should work without extra configuration.

@sonook
Copy link

sonook commented Apr 29, 2021

Hi All,

I have found different approach for this problem for moving existing installation to different drive.

Shutdown all VMs by following command
Run command: wsl --shutdown

Go to : regedit

Go to Registry Path for WSL2 installation.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\

Find your installation folder and change the basepath to desired drive and path.

Cut and Paste your ext4.vhdx from default path to desired drive.

Video representation of solution for movement of ext4.vhdx file to other location.

https://youtu.be/ON_dPAO4KZs

@chdelacr
Copy link

chdelacr commented Oct 5, 2021

If anybody is interested: I wrote a little bash and batch script for automating these steps. https://github.com/pxlrbt/move-wsl

This is very helpful, thanks so much. However, I'm getting NTFS errors due to illegal characters, even if the vhdx file is an ext4 one. Is anyone else experiencing this issue?

@deekshithanand
Copy link

Not Really sure if this is the proper solution. But for anyone looking, simply move it to another drive and not really care about the directories, I tried moving the ubuntu app(simply select move and chane the location ) in Windows App settings. It sort of worked and my ext4.vhd file got moved from C to D:/ drive ! (Correct me if am doing wrong!)

@YouveGotMeowxy
Copy link

Does the --import command delete the .tar file after it successfully does the import?

@Biswa96
Copy link
Contributor

Biswa96 commented Jan 20, 2022

Nope. At least it did not in my case 😜

@kolodi
Copy link

kolodi commented Mar 21, 2022

Hi All,

I have found different approach for this problem for moving existing installation to different drive.

Shutdown all VMs by following command Run command: wsl --shutdown

Go to : regedit

Go to Registry Path for WSL2 installation.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\

Find your installation folder and change the basepath to desired drive and path.

Cut and Paste your ext4.vhdx from default path to desired drive.

Video representation of solution for movement of ext4.vhdx file to other location.

https://youtu.be/ON_dPAO4KZs

This has worked perfectly for me. So I guess the export import is not required. Or is there some other considerations in this regard?

@chdelacr
Copy link

Hi All,
I have found different approach for this problem for moving existing installation to different drive.
Shutdown all VMs by following command Run command: wsl --shutdown
Go to : regedit
Go to Registry Path for WSL2 installation.
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Find your installation folder and change the basepath to desired drive and path.
Cut and Paste your ext4.vhdx from default path to desired drive.
Video representation of solution for movement of ext4.vhdx file to other location.
https://youtu.be/ON_dPAO4KZs

This has worked perfectly for me. So I guess the export import is not required. Or is there some other considerations in this regard?

I only would like to know if it is possible to perform this for an ext4 pen drive, or if it is exclusive for NTFS drives.

@raycheung
Copy link

Hi All,

I have found different approach for this problem for moving existing installation to different drive.

Shutdown all VMs by following command Run command: wsl --shutdown

Go to : regedit

Go to Registry Path for WSL2 installation.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\

Find your installation folder and change the basepath to desired drive and path.

Cut and Paste your ext4.vhdx from default path to desired drive.

Video representation of solution for movement of ext4.vhdx file to other location.

https://youtu.be/ON_dPAO4KZs

This helped me out! Thank you so much!

@Jammrock
Copy link

I wrote some PowerShell automation for @sonook's registry-based WSL2 disk move.

https://github.com/Jammrock/Move-WSL2NewDrive

Tested locally on Win11 using PowerShell 7. YMMV on Win10 and/or Windows PowerShell 5.1.

@arnavmehta7
Copy link

Nope. At least it did not in my case 😜

Hey, can you please tell me if I can delete mine tar file, Almost 60 gb has been freedup from my main drive. Can I now delete the .tar file after importing?

@vle003
Copy link

vle003 commented Nov 4, 2022

Hey, can you please tell me if I can delete mine tar file, Almost 60 gb has been freedup from my main drive. Can I now delete the .tar file after importing?

Sure, you can.

@vle003
Copy link

vle003 commented Nov 4, 2022

It's could be better if we can specify the path to store disk image when install WSL. The registry mod work well but you need to touch it everytime you install a new distro.

@jywangx
Copy link

jywangx commented Dec 19, 2023

My steps is a combination of @rekaerst, @Neurrone, and @mxplusb

  1. Backup current vhdx file
    from %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
    to D:\ext4.vhdx
    (Most important step. If you can't find correct vhdx file, you shouldn't go ahead)
  2. Remove current distro, like wsl --unregister Ubuntu-20.04
  3. Reinstall distro from Microsoft Store
  4. Export and import
    wsl --export Ubuntu-20.04 D:\wsl.tar
    wsl --unregister Ubuntu-20.04
    wsl --import Ubuntu-20.04 D:\Ubuntu-20.04 D:\wsl.tar
  5. Overwrite original vhdx file
    copy D:\ext4.vhdx D:\Ubuntu-20.04\ext4.vhdx
  6. Set default user
    ubuntu2004.exe config --default-user <username>

Thanks!

@WangFengtu1996
Copy link

create mklink using cmd.exe for ext4.vhdx

@afifurrohman-id
Copy link

afifurrohman-id commented Jan 30, 2024

Hi All,

I have found different approach for this problem for moving existing installation to different drive.

Shutdown all VMs by following command Run command: wsl --shutdown

Go to : regedit

Go to Registry Path for WSL2 installation.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\

Find your installation folder and change the basepath to desired drive and path.

Cut and Paste your ext4.vhdx from default path to desired drive.

Video representation of solution for movement of ext4.vhdx file to other location.

https://youtu.be/ON_dPAO4KZs

Testing on Current Windows 11, This is most simple way without needing to change config and default user.

@AuroraMaster
Copy link

AuroraMaster commented Aug 24, 2024

What should I do if the registry is lost? I only have VHDX and exe files, and I have customized a rag.

[HKEY_USERS\S-1-5-21-2094937328-1482775198-4211468522-500\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{0bcb98b4-3ac6-457d-b574-1a61ceeb0d2c}]
"State"=dword:00000001
"DistributionName"="Debian"
"Version"=dword:00000002
"BasePath"="\\\\?\\F:\\Debian"
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000

But it prompts an error

<3>WSL (14) ERROR: CreateProcessParseCommon:757: getpwuid(0) failed 2
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\VMware\bin\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate c:\Users\Administrator\AppData\Local\Programs\cursor\resources\app\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate c:\Users\Administrator\AppData\Local\Programs\cursor\resources\app\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate c:\Users\Administrator\AppData\Local\Programs\cursor\resources\app\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Python311\Scripts\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Python311\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\veighna_studio\Scripts\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\veighna_studio\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Python39\Scripts\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Python39\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Common Files\Oracle\Java\javapath
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\system32
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\Wbem
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\WindowsPowerShell\v1.0\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\OpenSSH\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Common Files\Autodesk Shared\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\dotnet\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\MT
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Microsoft SQL Server\120\DTS\Binn\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Wolfram Research\WolframScript\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\sys
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\JBIDE\shell
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\PowerShell\7\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nvm
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nodejs
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Git\cmd
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Huawei\ohpm-repo\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\.bun\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\doxygen\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Graphviz\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\ffmpeg\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate G:\PostgreSQL\16\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\7-Zip
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Rust\.cargo\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\scoop\shims
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\JetBrains\IntelliJ IDEA 2020.1\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\JetBrains\GoLand 2020.1\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\JetBrains\PyCharm Professional Edition with Anaconda plugin 2020.1\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Fiddler
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\go\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Azure Data Studio\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Bandizip\
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nvm
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nodejs
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate F:\Debian
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\Microsoft VS Code\bin
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\AppData\Local\JetBrains\Toolbox\scripts
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\JBIDE\shell
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nvm
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate D:\nodejs
<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\Administrator\.bun\bin
Processing fstab with mount -a failed.
Failed to mount C:\, see dmesg for more details.
Failed to mount D:\, see dmesg for more details.
Failed to mount E:\, see dmesg for more details.
Failed to mount F:\, see dmesg for more details.
Failed to mount H:\, see dmesg for more details.
Failed to mount I:\, see dmesg for more details.

<3>WSL (14) ERROR: CreateProcessEntryCommon:334: getpwuid(0) failed 2
<3>WSL (14) ERROR: CreateProcessEntryCommon:505: execvpe /bin/sh failed 2
<3>WSL (14) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

[已退出进程,代码为 1 (0x00000001)]

<3>WSL (14) ERROR: UtilTranslatePathList:2866: Failed to translate

These are all valid environment paths
Suspect uid is wrong。

How to find or restore the correct DefaultUid

@crramirez
Copy link
Contributor

crramirez commented Aug 24, 2024

Short answer:

wsl --import-in-place <new_distro_name> <path_to_vhdx>

For the DefaultUid, edit the /etc/wsl.conf add

[user]
default=username

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