Error code: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
Windows Version
Microsoft Windows [版本 10.0.26100.4061]
WSL Version
2.5.7.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
6.6.87.1-1
Distro Version
archlinux and kali-linux
Other Software
No response
Repro Steps
wsl --install archlinux wsl -d archlinux wsl --shutdown wsl --manage archlinux --move D:\WSL2\archlinux wsl -d archlinux wsl --shutdown wsl --manage archlinux --move D:\WSL2archlinux wsl -d archlinux
Expected Behavior
[root@username ~]#
Actual Behavior
(base) PS C:\Users\username\Desktop> wsl -d archlinux 无法将磁盘“D:\WSL2ArchLinux\ext4.vhdx”附加到 WSL2: 拒绝访问。 错误代码: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
The emergence of this problem is accidental But its occurrence frequency is a bit high
Diagnostic Logs
No response
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
Diagnostic information
.wslconfig found
Detected appx version: 2.5.7.0
Detected user visible error: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
Detected user visible error: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
Detected user visible error: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
Detected user visible error: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
Detected user visible error: Wsl/Service/CreateInstance/MountDisk/HCS/E_ACCESSDENIED
I tried to use this command to solve " icacls "D:\WSL2archlinux" /reset /T ", but the system crashed after a while.
Thank you for reporting this @zyfpga. Interestingly I can't reproduce this.
Did you run the commands in the same Terminal, one after the other, or are did you run them "in parralel" ?
@OneBlue I'm very sorry that I couldn't describe my process in detail.At first, I was running it in the same terminal. After closing it and reopening my computer, I found this problem.It is not to run commands one after another in the same terminal.
Fixed in 2.6.0
I'm sorry to bother you, @OneBlue. I miss the problem that I ran the commands in the same Terminal. And now, I don't know how to address it.