-
Notifications
You must be signed in to change notification settings - Fork 848
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
Installing KB4565503 appears to cause "access is denied" when starting WSL2 (custom VHDX location) #5605
Comments
This too is happening to me after that update. Thank you for the suggestion of changing the ownership. Is there any danger in doing so? I'm assuming that they changed the ownership for some specific reason? |
The KB-article mentions some security related changes, but doesn't go into enough detail to make any definitive statements. I'm no expert, but I guess there's a case to be made that someone (already having gained broad access to your system) might modify the VHDX and add some malicious code in there which – when you start WSL – would run with higher privileges than it regularly would... Given what recently happened at Twitter, that person is probably be better off trying to socially engineer you out of some of your bitcoin though 🙂 |
In my case running ubuntu as administrator and then reopening it without admin resolved the issue. I did notice that the folder containing my vhdx had Administrators as owner |
Can you give us the steps to change the permissions to current user? Thank You. |
I didn't have to mangle permissions per se, as long as the instance is running I'm fine, so it looks like there's something that doesn't like starting up the instance without full control over the VHDX (I could also solve this by giving Users full control and not having to use an admin shell) From one admin powershell
and then from my regular non admin shell
then bouncing back to the admin shell
and in my regular shell
|
Ran into this same issue after the recent Windows update, the solution by @Uldiniad above worked. Seems like I only needed to start it once as administrator. Afterwards it went back to normal. Same situation with custom VHD location. |
I need to run it as administrator after every reboot. After running as admin, WSL works. But after I restart it goes back to the "access is denied" state until I re-run it as admin again. |
Happened for me exactly as described by @thijsputman - on rollback of KB4565503 WSL2 ubuntu worked fine. Ubuntu is installed at an alternate location. However, having read @Uldiniad 's comment I reinstalled KB4565503. I noticed that the owner of the ext4.vhdx (and the containing directory) did not change. But I couldn't start wsl from a standard (unelevated) prompt. I am now in @summatix 's situation - after every reboot I run wsl as administrator, then everything works fine. Windows version currently reporting as 10.0.19041.388. Ubuntu is 20.04. |
I have now used the suggestion from here - https://answers.microsoft.com/en-us/windows/forum/all/kb4565503-installed-then-wsl-2-failed-to-start/25794c4f-0b20-465e-bbdb-a8af3d9e0e88 - and assigned Full Control to Users and i'm good even without the workaround. |
I'm having the same issue as described by @summatix and @david-bakin . In addition, to be sure if the problem was with my Ubuntu with alternate locale (or with Ubuntu distro in general) i've installed a Debian from Microsoft Store without any changes. It worked but, when I restarted my system it stoped working and started showing the same error message. |
@david-bakin The link in your suggestion worked for me. Thanks for posting that. |
Same issue here. Getting Rather than uninstalling KB4565503, simply locating and granting my user full permission to the |
Another thing you can do to resolve this:
|
I have a similar but different variation of this issue. I had WSL1 installed with Ubuntu 18.04 (manually as my network is air-gapped) which I had not used in many months. I tried uninstalling Ubuntu, renaming the Ubuntu directory (the files didn't remove for some reason), re-installing Ubuntu, changing permissions on the directory to give users full control, disabling and re-enabling WSL (with restarts) including the WSL2 update, and removing the HKCU Lxss registry keys but to no avail. Seeing the messages here about admin vs non-admin windows, I confirmed I can run WSL in a non-admin window but not in admin window (after a brief interlude to disable the GPO someone put in place that disabled UAC elevation prompts to be able to get a non-admin window). I put the Lxss reg keys back, unregistered my Ubuntu distro from the non-admin window, re-applied the WSL2 update, converted to WSL2 default I do not currently have any distro installed but still cannot run WSL.exe at all from admin shell (cmd/PoSH/etc). My original Ubuntu installation was not VHDX and was not in the %appdatalocal% folder; it was a folder structure under c:\Ubuntu. So there's something outside the VHDX file permissions or even any distro installations that's causing my problem. For reference, I had a second internet connected computer (also Win 10 1909) I tried the Docker WSL2 update on and it works without issue from both admin/non-admin windows, but that machine never had WSL1/Ubuntu on it. |
I'm seeing this too. I cannot run wsl at all -- I get "access is denied". I tried uninstalling wsl, and noticed that it did not remove I notice (using procmon) it tries to start I am totally stuck at this point; short of a full OS reinstall I'm not sure what to do. |
@garyo The suggestion outlined in the link that David provided worked for me. Have you given it a try? |
Yes, I tried all the permission-related things, uninstall/reinstall, change ownership of wsl.exe and WindowsApps folders, etc. I finally (just a couple of minutes ago) got it working again though! I had to not only uninstall wsl from "Turn Windows Features On/Off", but also uninstall all of my distros and all WSL-related items from "Add/Remove Programs" and reset Docker to factory defaults. At that point, weirdly, it started working again! (Yes, even before reinstalling anything. So |
got access denied as administrator on every terminal (cmd and powershell as admin). Uninstall Ubuntu, try to resinstall, install success after reboot and got access denied again |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Environment
Steps to reproduce
Expected behavior
Being greeted by a Bash-prompt.
Actual behavior
Additional Info
The relation to KB4565503 is somewhat speculative: I installed the update this morning (CET) before starting my working day, at which point I was unable to start Ubuntu (worked fine yesterday).
The issue appears to be that ownership of the VHDX file got handed over to
SYSTEM
. Changing ownership back to my current user permanently resolves the issue. Alternatively, starting WSL2 from an elevated prompt resolves the issue without modifying the access rights of the VHDX.I've only got one copy of Ubuntu installed on my machine (via the Windows Store), so I'm unable to say if other distros are affected too.
I do have Docker Desktop (WSL2) installed (for which I've also moved the VHDX files). Docker Desktop doesn't appear to be affected by this issue; its VHDX files are still owned by the correct user.
See also this post on Microsoft Answers: https://answers.microsoft.com/en-us/windows/forum/all/kb4565503-installed-then-wsl-2-failed-to-start/25794c4f-0b20-465e-bbdb-a8af3d9e0e88
The text was updated successfully, but these errors were encountered: