-
Notifications
You must be signed in to change notification settings - Fork 855
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
Getting Windows 10 to realize the new location for the Linux distro #4451
Comments
Can you share the steps that you're taking to import your WSL distro and the exact error message you're seeing? Have you tried re-importing the distro using the tar file? EDIT: Looking at this again, with that build number you do have access to WSL 2. Please see our install instructions on setting it up. Since you have a .vhdx file it looks like you're importing it as a WSL 2 distro, make sure you're using WSL 1 if you don't have the Virtual Machine Platform component enabled. You can do that by running |
Thanks much. I have joined the Insider program, but installation of the latest build failed twice by now. I will attempt again. Once the installation works, I will have access to WSL2, and I will post an update then. |
*** For the benefit of others who might come across this case *** On the fourth trial, Windws 10 update-as part of the 'Insider Program'-worked and I got build 18975. I was now able to successfully update WSL to version 2. WSL version 2 requires the 'VirtualMachine' feature. Coincidentally, I read that the VM feature might need to be enabled in the BIOS settings. I rebooted my 'Lenovo' laptop pressing F2 until I got the BIOS menu. Sure enough, under "Configuration" the "Intel Virtual Technology" was disabled. I enabled that, saved, and exited. As the laptop restarted, I went to C:\Users\user\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState, highlighted and deleted the folders "rootfs" and "temp". Open PowerShell as an Administrator:
If you get the error message "VHD must be uncompressed", uncompress the folder "C:\Users\user\AppData\Local\Packages" and its descendants. File Explorer | Point to the folder | Properties | Attributes / Advanced | Uncheck "Compress to save disk space". If you get the "Permission Denied" error, get permissiosn through File Explorer | Properties | Security or:
Open CommandPrompt as an Administrator. This is because PowerShell does not understand 'mklink'.
Test also through PowerShell and the Debian icon under Windows Start. Reboot. Test one more time through the CommandPrompt, PowerShell, and the Debian icon under Windows Start. Everything should be fine. You now have a functional Linux distribtion with "C:\Users\user\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState" pointing to "D:\Linux". You can now delete "Linux.bak" under "C:\Users\user\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4". In all of the above, 'user' is your username. Hope this helps! |
In the version above, "user" (that is your username) did not come out. This is meant to be "grant user (OI)(CI)(F) inheritance and full access permissions". See https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls. |
I'm getting this same issue trying to import ubuntu-19.04 with the wsl command. No matter where in I try to install the distro to, I get access denied. |
@craigloewen-msft And Im executing powershell as an Administrator. |
Hello folks, here is the best solution for that issue: 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. |
After moving the Linux distro (see MicrosoftDocs/WSL#412), I got "access denied" when importing. This is probably because I do not have WSL2. I cannot get WSL2 because I have build 10.0.18362. Gettign the latest build failed because of the limited space on C.
When importing did not work, I unzipped the Linux distro at L:
I do not want to reinstall the app because the installation will again go to C:\users...\AppData\Packages\LocalState...
How do I get Windows to realize that the Linux distro is at L: (through D:\Linux.vhdx) not at C:\users... anymore? Can anybody share the Environment Variables after the distro has been moved?
As noted earlier, if I run 'bash' from the Power Shell, I get the message
But I do not want to install again, because the installation will go to C. I already have the full distro at L.
Thanks.
The text was updated successfully, but these errors were encountered: