-
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
Cannot access btrfs drive from Windows #6711
Comments
Thanks for the reporting this @Hashbrown777. So I see the On top of that, when mounting disks manually with More details here. |
Hi @OneBlue The same is true of |
Ah yes, You could probably get the bug if you create a fake block device as a file in linux, and format that as btrfs, no need for |
@Hashbrown777 : Makes sense. Have you tried mounting your drive under (detailed explanations on the issue). |
@OneBlue |
Interesting, because it looks like you can access the parent folder, let's validate that this isn't a permission issue. Can you share the output of:
If your WSL user doesn't have access to that folder, adding: |
@OneBlue I think the easiest way for you check these suggestions is to test them yourself .{
$location = '/mnt/wsl'
$mount = "$location/test"
$device = '~/test.img'
'Mount?'
pause
bash -c (@"
sudo rm -rf $mount $device 2>/dev/null
fallocate -l 1G $device
sudo mkfs.btrfs -f $device
sudo mkdir $mount
sudo chown -R `$USER $mount
chmod ugo+rwx $mount
sudo mount \
-o ssd,noatime,space_cache,commit=120,compress \
$device \
$mount
sudo chown -R `$USER $mount
chmod ugo+rwx -R $mount
ls -la $mount $mount/..
df -T | grep 'btrfs'
"@ -replace '\r','')
'Test access?'
pause
explorer "\\wsl$\$(
wsl -l `
| %{ $_ -replace '\x00','' } `
| ?{ $_ -match '^.+(?=\s+\(Default\)$)' } `
| %{ $Matches.Values }
)$($mount -replace '/','\')"
explorer "\\wsl$\$(
wsl -l `
| %{ $_ -replace '\x00','' } `
| ?{ $_ -match '^.+(?=\s+\(Default\)$)' } `
| %{ $Matches.Values }
)$($location -replace '/','\')"
'Unmount?'
pause
bash -c "sudo umount $mount;rm $device"
explorer "\\wsl$\$(
wsl -l `
| %{ $_ -replace '\x00','' } `
| ?{ $_ -match '^.+(?=\s+\(Default\)$)' } `
| %{ $Matches.Values }
)$($mount -replace '/','\')"
} This will;
Let me know if you make any progress, ta |
@Hashbrown777 : Indeed I can repro the same behavior. I'll have a deeper look and update this issue when I'll have more info. |
@Hashbrown777: The root cause is an issue in the plan9 server running inside WSL. The problem was that when a mountpoint is accessed, the code would check for the device on which the file is, and fail if no matching mountpoint is found in /proc/self/mountinfo (and that appears to be the case for btrfs mounts). The reason for that logic is to prevent access to drvfs shares ( /mnt/X ) from the linux 9p server. So we made a code change to not disallow file accesses on this scenario, which solves this issue. |
The fix is incoming, but will be in the next Insider switch. |
Do we know when this might be coming? Is the fix in the [wsl] kernel we can compile ourselves? I've pulled the latest kernel from git since Win11 dropped on my insider machine, re-installed btrfs-progs, tried accessing through When is "the next Insider switch", @bpulliam. Is there a timeframe for it "work[ing] its way through the Windows release pipeline" @OneBlue? |
Still non-functional in Win 11 21H2 Insider Build 22000.168 Any updates? |
@Hashbrown777: Unfortunately the fix still hasn't made it to insider builds. It will hopefully be in the next one. |
Yesterday I received a So now the host machine has access to the btrfs mounts via P9, but I can't see a way to let other machines on the network see it. I'm guessing there's no way for the host to re-share, forward, or expose WSL2 shares? I was hoping to leverage the efficiency you guys have made with the direct P9 and not have to host samba or tunnel through ssh.. I'm having other issues with disks disconnecting, and such, but they're not related to this issue. |
There aren't any plans to do something like that right now. \wsl.localhost only resolves in the current machine and isn't at all exposed at the networking level. Exposing this to other machines would require an actual networking protocol, with all the authentication & security requirements that this would imply. Overall if you wish to share a wsl mountpoint to other machines, I'd recommend looking at ssh tunnels or samba as you mentioned (nfs and sftp might also be valid options, maybe with better performance if you want to remotely access those mountpoints from wsl). |
@OneBlue Sorry to comment on a closed issue, but did this fix make it to non-insider builds (running 22000.376)? I'm experiencing the same error. Using a raid1 mirror if that matters. |
@PEELER: Yes the fix should be on that build. If you're seeing this issue can you detail repro steps and share logs ? |
Thanks for the quick response! https://aka.ms/AAfe74a The terminal commands are as follows:
Start Ubuntu 20.04:
When navigating to \\wsl.localhost\Ubuntu-20.04\mnt\wsl\mymnt, get the error "attempt to access invalid address." |
This happens to me as well! |
Thanks for the logs @jpeeler. Actually, it turns out that the fix is not on your build yet, sorry for the miscommunication. To work around this, you could install the latest WSL from the store, which has the fix. |
Yes, that did solve the problem. Unfortunately, using the same hardware with an older (but up to date) install I get the error as presented on #7527. If you're willing to continue to assist, I can upload logs there just as I did here. (Edit: commented on the issue with a workaround.) |
Interesting, can you share the output you get with logs ? I'd be curious to have a look at it. |
I had this issue as well and can confirm installing WSL Preview fixed the issue. I can now see the @ and @home etc. from within File Explorer (whereas before I could only access those directories via WSL itself.) Thank you! |
Environment
Steps to reproduce
wsl --mount \\.\PHYSICALDRIVE1 --bare
sudo mkfs.btrfs /dev/sdc
sudo mount -o ssd,noatime,space_cache,commit=120,compress /dev/sdc /mnt/test
chown $USERNAME:$USERNAME /mnt/test; chmod ugo+rwx /mnt/test
\\wsl$\Debian\mnt\test
in explorerWSL logs: wsl.etl.log
Expected behavior
Windows has access to the btrfs drive.
Actual behavior
"is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.
Attempt to access invalid address."
The exact same issue was reported on the original blogpost about
--mount
but the fix issshfs
-specificThe text was updated successfully, but these errors were encountered: