Skip to content

mount.drvfs fails to mount virtualbox shares #2896

Closed

Description

Hi,

mounting any "native" drive with a command like the following works fine:

mount -t drvfs D: /files

However I run Windows 10 in Virtual Box and want to mount a shared Folder, it will mount using the above command without any errors.
But then no access is possible:

ll /files/
ls: reading directory '/files/': Invalid argument
total 0

How would I be able to access that share from within the Ubuntu shell?
Is there another way of doing it or is it a bug in mount.drvfs?

(I also tried installing guest addtions on WSL and mount -t vboxsf ... but as I expected, that won't work either)

EDIT:
Actually I can cd into a subdirectory at that mount.
But still can't list the content using ls also echo * doesn't seem to work it just echos a literal '*'.
Issuing a git status inside a git repo within that share will show every file as changed.
This doesn't seem to provide any useful functionality.

Activity

  1. therealkenc commented on Jan 31, 2018

    @therealkenc

    Similar to #2163 #579 and ill-fated #1962 etc. drvfs supports some NT filesystem drivers (ntfs.sys, cdfs.sys, yadda) but not some other third party drivers. Work around for the time being would be to export your filesystem in the host OS with SMB/CIFS and then mount -t drvfs '\\host\share'.

  2. lqueryvg commented on Apr 21, 2018

    @lqueryvg

    This seems very strange to me.

    I've already mounted the virtualbox share onto the Windows 10 VM via the Windows vboxsf driver (installed with guest additions) - I can see it as "Z:" and see all of the files within. Given that the files are already available to Windows, why should WSL need it's own virtualbox driver in order to see the files ? This approach would mean that WSL is going to need it's own driver for every single filesystem type, even though Windows can already see the files.

  3. jgrocha commented on Feb 17, 2019

    @jgrocha

    Same problem here. Windows 10 is my guest operating System. I'm running WIndows 10 on top of VirtualBox. I have a VirtualBox shared folder (from my host operation system) available as \\vboxsrv\jgr mounted as G:.

    On Windows 10 bash:

    jgr@berlin:~$ sudo mkdir /mnt/g
    jgr@berlin:~$ sudo mount -t drvfs '\\vboxsrv\jgr' /mnt/g
    jgr@berlin:~$ ls -l /mnt/g
    ls: reading directory '/mnt/g': Invalid argument
    total 0
    jgr@berlin:~$ sudo umount /mnt/g
    jgr@berlin:~$ sudo mount -t drvfs G: /mnt/g
    jgr@berlin:~$ ls -l /mnt/g
    ls: reading directory '/mnt/g': Invalid argument
    total 0
    jgr@berlin:~$
    
  4. cjbarth commented on Feb 27, 2019

    @cjbarth

    Here is a workaround:

    1. Share the folder you want to access in WSL from you Mac via Preferences -> Sharing -> Share Using SMB.
    2. Connect to the share using Explorer (probably easiest to map a network drive and remember the credentials).
    3. From the WSL terminal, sudo mkdir /mnt/h
    4. From the WSL terminal, sudo mount -t drvfs H: /mnt/h
  5. sbraz commented on Mar 19, 2019

    @sbraz

    Hello therealkenc, are there any plans to support this in the near future? Having to share the folder from the host is a bit cumbersome.

  6. therealkenc commented on Mar 19, 2019

    @therealkenc

    I don't work at MSFT and don't know the answer to that anymore than anyone else here (and even if I did, the WSL team doesn't provide roadmaps). Actually I submitted #2163 not because I have any particular desire to mount WebDAV drives (I really don't), but in the hopes someone would take a look and make WSL more tolerant of various installable filesystem drivers (starting with closed source filesystems written at MSFT).

    Another way to attack this would be to take a look at the VirtualBox guest addition driver, debug what is going wrong, and add support for WSL. Doable.

  7. ziggy90127 commented on Feb 24, 2020

    @ziggy90127

    Cygwin mounts virtualbox shares without doing anything. Why is WSL struggling with this?

  8. mrnerdhair commented on Oct 8, 2020

    @mrnerdhair

    On WSL2, I would guess that this is caused by the same phenomena as dokan-dev/dokany#932.

  9. therealkenc commented on Feb 16, 2021

    @therealkenc

    Update from #6556, the mount succeeds on WSL1 19042.746, but still no list stuff. That supposition above from Reid just above is almost certainly correct. Ref #6063.

  10. ziggy90127 commented on Feb 16, 2021

    @ziggy90127

    Cygwin mounts virtualbox shares without doing anything. Why is WSL struggling with this?

    Well, it's been a year, and apparently this is still an issue. I'd like to hear from a Microsoft employee when they plan on addressing this issue.

  11. microsoft-github-policy-service commented on Feb 1, 2024

    @microsoft-github-policy-service
    Contributor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions