WSL: wsl mount vhd not working
Version
Microsoft Windows [Version 10.0.22000.556]
WSL Version
- WSL 2
- WSL 1
Kernel Version
5.10.102.1
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
wsl --mount --vhd workdata.vhdx
but if use Mount-VHD command, and mount with DiskPath will successful mount.
Expected Behavior
mount vhd successful
Actual Behavior
K:\>wsl --mount --vhd workdata.vhdx
拒绝访问。
Diagnostic Logs
No response
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (2 by maintainers)
I found the reason for wsl return access denied. if the vhd is created under the user profile directory , the vhd owner is
BUILTIN\Administratorsand access isNT AUTHORITY\SYSTEM. But if the vhd is created outside the user profile directory, the vhd access will changed toBUILTIN\Administrators, thenwsl --mount --vhdwill getaccess denied. when make a copy of that vhd the owner will changed to local user and mount will succeed.After fix vhd acl, the vhd can be mounted successfully.
my wsl is store version @benhillis
拒绝访问meansaccess denied