-
Notifications
You must be signed in to change notification settings - Fork 822
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
Permission Denied For Folders in Mounted VHDX/VHD in WSL #1199
Comments
@benhillis This used to work pre-Anniversary edition. Are there any plans to get it working again? |
This was working till yesterday. Today's update screwed it up! @fpqc |
Interesting, I'll sync up with a couple people and see what is up here. |
@ghazi94 - What build were you running before yesterday's update? |
@benhillis The case I am thinking of was where you mounted the vhdx as VolFS (mount to a folder inside LXSS, for example) rather than DriveFS, but it was a similar problem. |
@benhillis I will update the build number before and after the update as soon as I reach home (It's my personal pc) |
I got here because I got the same problem as @ghazi94... Using the latest normal version worked until yesterday. I've got a windows update today and now it is broken. Don't know the version numbers. |
@benhillis Current build is 14393.321 |
The permissions seem to be identical between my VHD and physical partition, but WSL cannot access the VHD. PS T:\> [Environment]::OSVersion
Platform ServicePack Version VersionString
-------- ----------- ------- -------------
Win32NT 10.0.14942.0 Microsoft Windows NT 10.0.14942.0 VHDWindows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS T:\> icacls T:\
T:\ BUILTIN\Administrators:(F)
BUILTIN\Administrators:(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
NT AUTHORITY\Authenticated Users:(M)
NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M)
BUILTIN\Users:(RX)
BUILTIN\Users:(OI)(CI)(IO)(GR,GE)
Successfully processed 1 files; Failed processing 0 files dave@universal:~$ df -h /mnt/t
Filesystem Size Used Avail Use% Mounted on
T: 997M 15M 983M 2% /mnt/t
dave@universal:~$ mount | grep '/mnt/'
C: on /mnt/c type drvfs (rw,noatime)
G: on /mnt/g type drvfs (rw,noatime)
T: on /mnt/t type drvfs (rw,noatime)
dave@universal:~$ ls -l /mnt/t/
ls: cannot access /mnt/t/$RECYCLE.BIN: Permission denied
ls: cannot access /mnt/t/System Volume Information: Permission denied
ls: cannot access /mnt/t/usertest: Permission denied
total 0
d????????? ? ? ? ? ? $RECYCLE.BIN
d????????? ? ? ? ? ? System Volume Information
d????????? ? ? ? ? ? usertest
dave@universal:~$ touch /mnt/t/test.txt
touch: cannot touch ‘/mnt/t/test.txt’: Permission denied Physical PartitionG:\ BUILTIN\Administrators:(F)
BUILTIN\Administrators:(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
NT AUTHORITY\Authenticated Users:(M)
NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M)
BUILTIN\Users:(RX)
BUILTIN\Users:(OI)(CI)(IO)(GR,GE)
Successfully processed 1 files; Failed processing 0 files dave@universal:~$ df -h /mnt/g
Filesystem Size Used Avail Use% Mounted on
G: 7.9G 29M 7.8G 1% /mnt/g
dave@universal:~$ mount | grep '/mnt/'
C: on /mnt/c type drvfs (rw,noatime)
G: on /mnt/g type drvfs (rw,noatime)
T: on /mnt/t type drvfs (rw,noatime)
dave@universal:~$ ls -l /mnt/g/
total 64
drwxrwxrwx 0 root root 0 Oct 4 13:53 $RECYCLE.BIN
d--------- 0 root root 0 Oct 4 15:20 System Volume Information
dave@universal:~$ touch /mnt/g/test.txt
dave@universal:~$ ls -l /mnt/g/
total 64
drwxrwxrwx 0 root root 0 Oct 4 13:53 $RECYCLE.BIN
d--------- 0 root root 0 Oct 4 15:20 System Volume Information
-rwxrwxrwx 1 root root 0 Oct 14 10:41 test.txt |
I also see the problem on my VHD drive as described above (all files/directories have messed up permissions), but my physical drive also seems to have some problems (even though most of the directories are fine):
|
@mheden - What you are seeing is actually expected. hiberfil.sys, pagefile.sys, and swapfile.sys are protected files. |
@benhillis But all VHDs shouldn't be protected? #1199 (comment) |
@Manouchehri I'm surprised you're able to see VHD's at all in bash. I thought we only exposed fixed NTFS drives. |
Moved to #1220 since I think I've found another issue. |
Same permission problems on 14951 and VHD drive automounted at boot (via VHDAttach):
I could remember it worked some build ago. |
The last working version is: 14393.0 (Uninstalling KB3194798 removes also the issue) |
@ivivanov-bg Good stuff! Thanks for rolling back to all those timebombed updates. How'd you do it? |
As I'm NOT on the insider program - this was the only update for windows which was installed - so - uninstalling it through the control panel (the old school one) and rebooting. As all my stuff is on VHDX disk - accessing it in WSL is very very important to me - so I guess I have to live for a while without this update. (Let's hope it won't be for very long) |
Wrong Id - the one that was uninstalled is actually: KB3194798 |
thanks a lot @ivivanov-bg !! |
Ditto problem here. No longer able to access a mounted VHDX drive.. So unfortunate the little things that stop us from being productive. What did that KB update do? |
Yeah .... especially when an update messes up a working application 👎 |
Unrelated.. (but really.. it's related), the latest Insider Preview update, which took 2 hours to install had made the OS almost unusable. I can no longer sign into my domain account when it's off the network. I get a "password changed by a different device" error when entering my password . Which is untrue as I can verify my domain account other ways. |
@benhillis Windows says that mounted vhdx is fixed drive. PS C:\> Get-Disk | Format-List FriendlyName,Model,BusType,Location,Path
FriendlyName : Virtual HD
Model : Virtual HD
BusType : ATA
Location : PCI Slot 0 : Adapter 0 : Channel 0 : Device 0
Path : \\?\ide#diskvirtual_hd______________________________1.1.0___#5&2d5f53a1&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
FriendlyName : Msft Virtual Disk
Model : Virtual Disk
BusType : File Backed Virtual
Location : C:\temp.vhdx
Path : \\?\scsi#disk&ven_msft&prod_virtual_disk#2&1f4adffe&0&000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PS C:\> Get-Disk | Get-Partition
DiskPath: \\?\scsi#disk&ven_msft&prod_virtual_disk#2&1f4adffe&0&000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 E 1048576 127 GB IFS
DiskPath: \\?\ide#diskvirtual_hd______________________________1.1.0___#5&2d5f53a1&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 500 MB IFS
2 C 525336576 126.51 GB IFS
PS C:\> Get-Disk | Get-Partition | Get-Volume
DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining Size
----------- --------------- ---------- --------- ------------ ----------------- ------------- ----
NTFS Fixed Healthy OK 465.62 MB 500 MB
E NTFS Fixed Healthy OK 126.89 GB 127 GB
C NTFS Fixed Healthy OK 100.48 GB 126.51 GB
PS C:\> mkdir E:\test1,E:\test2,E:\test3 | Out-Null
PS C:\> bash -c "ls -l /mnt/e"
ls: cannot access /mnt/e/System Volume Information: Permission denied
ls: cannot access /mnt/e/test1: Permission denied
ls: cannot access /mnt/e/test2: Permission denied
ls: cannot access /mnt/e/test3: Permission denied
total 0
d????????? ? ? ? ? ? System Volume Information
d????????? ? ? ? ? ? test1
d????????? ? ? ? ? ? test2
d????????? ? ? ? ? ? test3 |
Any progress on this ?? |
It's still not labelled as an Issue yet! |
Problem for me as well. used to work fine on Anniversary Update |
Anyone tried the latest updates: KB3200970 and KB3176929 ? |
Yes .. its still present @ivivanov-bg |
anyone any idea if this will ever be fixed ? I see it's still present in KB3213986 |
Still an issue as of 14393.693 (all updates installed but pending reboot for KB3216755). Any news, anyone? |
@TheRealDuckboy - Only security and critical fixes for WSL will be pushed out to the 14393 build. All of the major updates are currently only available to the Windows Insider builds (see our release notes). These updates will also make it to the |
@sunilmut -- just verifying -- did you notice that this is not a regular bug report, it's a regression report? If a hotfix to Anniversary inadvertently breaks part of WSL, what's your policy on fixing it? I would advocate that such fixes should be prioritized if at all possible -- y'all want people applying your hotfixes, and they're not going to if hotfixes introduce regressions and start being perceived as risky. |
@aseering - No, I did not notice that. I would agree with you assessment. Thanks for bringing it to my notice. Not much has gone for WSL in KB article(s). So, probably something outside of WSL changed that broke this (my initial view). Let me run this internally with the team. |
I had a word about this with the team. It appears that this is a known issue, and, regressed because of an update outside of WSL. Irrespective, we understand that this is a regression. Unfortunately, and as I have been informed, the bug bar to get this fixed in |
@sunilmut are you sure this is fixed in CU? It wasn't in CU a while back. This broke right before RTM of AU. |
@fpqc That's what I have been informed by @SvenGroot. If someone here is willing to try it out in a recent Insider build, we can know for sure. |
@sunilmut Installation and extraction works, but when you try to run bash.exe, it fails with error: Repro steps: Create an empty vhdx, attach it, create a new volume formatted with ntfs, create %localappdata%\lxss, and mount the vhdx on that directory. Then lxrun /install. The installation and extraction works fine, but you get the error when you go to set up your unix accounts and also if you try to run bash.exe. |
I can confirm that this issue is still not resolved by the latest insider build. Same issue as mentioned in the description. |
Fixed in 15025. |
Oxbadfca11: really? i just checked and i'm still getting the permission denied issue.... i'm pretty sure i'm on the latest version.... did you do anything else? |
@dbsavage I checked below with build 10.0.15042 I clean installed
Everything OK. |
Oxbadfca11 - that's totally it.... my bad, apologize for jumping on this thread and not realizing it was for the preview builds.... |
I started running into "Permission denied" issues once I upgraded to the Creators Update (everything was working fine before), then I started seeing things like:
I found a strange "Deny" entry in the folder's permission in Windows Explorer (Right Click > Properties > Security > Advanced) denying my account "Special" access. Below it was an identical looking "Allow" entry. Removing the "Deny" entry allowed Bash to access the directory again. I'm not sure where that entry came from, but I don't think it's related to WSL (it does seem new with the Creators Update though). I just wanted to share that troubleshooting step here since I initially thought it was a WSL issue. I could still access the directory normally from Explorer, so it might only crop up for people using Bash. |
Following up on this thread. Are people still seeing similar failures on the 1803 build? |
@benhillis It's not really practical to even test this anymore, since it's not just mounting a vhdx on lxss but you'd have to mount it on the app's directory. I would like to see an option to launch an lx environment off an ntfs vhdx for portability, but doing it the way we did at the beginning is pretty much a dead end now. |
@benhillis No more permission problems on my end on 1803. It also follows my wsl.conf properly as other DrvFs mounts do. |
Hey @benhillis - reopening because Heath Yates is running on 1803 and posted this on Reddit, and pinged us on Twitter re. same. Handing-off to @tara-raj to triage with y'all. |
That's #2779 |
Confirmed, Heath Yates's issue is not related to this one, but to #2779 and is "by design". Closing again. |
Great, thanks for taking a look @therealkenc & @SvenGroot :) |
I have created a VHDX/VHD (GUID/MBR type) file in Windows 10.
It is mounted as an NTFS formatted drive with drive letter X:. When I open the bash (Ubuntu on Windows 10/WSL), I am able to
cd /mnt/x
However, when I do ls, i get permission denied for all the files. Also, I am not able to create directory even with sudo. Same problem with chmod, chown, etc.
I have also tried to grant permissions to everyone through icacls in Windows through command line as well as through the GUI.
Attached the screenshots below:
Windows Explorer
### Bash
### Bash - Displaying permissions
I think the problem is that the way NTFS gets mounted on Windows. The mounted mode is being treated as a read-only mode by the Ubuntu Bash.
The text was updated successfully, but these errors were encountered: