-
Notifications
You must be signed in to change notification settings - Fork 855
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
Mount Google Drive File System to WSL #2999
Comments
I currently have Windows 10 build 16299. I installed Google Drive File Stream, and my Google Drive is visible as I: under Windows. When I launch a WSL bash shell, this is getting automatically mounted as "/mnt/i". While I also get the "Function not implemented" error, I have found that I can nevertheless change into subdirectories and read/write files via DrvFS to Google Drive, I can even do "ls -l" on a specific file without getting any errors. I just can't read directory entries, which obviously makes the filesystem a little difficult to use! Running strace shows that getdents() is the system call which is failing:
If just this syscall could be fixed for the Google Drive File Stream filesystem, it might work perfectly. |
I am encountering the same issue! |
This issue is probably also similar to "ls: reading directory '.': Invalid argument (share mounted via drvfs) #1954" For me:
Quoting @SvenGroot from that issue,
Which is unfortunate, as the list doesn't include FAT32, though this was in June last year. |
@YenForYang By FAT I meant the FAT driver in Windows. WSL definitely works with FAT32, and all the FAT variations Windows supports. I do expect this is another case where the Google Drive file system driver is missing some support or behaving in an unexpected way. |
Any update on this? This would be killer if I could work with the files on my G Drive via WSL. |
This will be really nice to have! |
I found that if you share the drive over the network, you can mount the share from different computer and run commands within drive folders without problems. But I was unable to mount it using localhost, it knows that you're trying to mount the local drive and just mounts it as regular drive. Edit: |
Here is a way to mount GFS in WSL based on https://superuser.com/questions/1353169/getting-sshfs-working-on-wsl-or-finding-an-alternative The trick is to use https://www.nsoftware.com/sftp/netdrive/ to ssh to GFS from Windows and convert it to a filesystem that can be mounted under WSL.
|
I switched to RaiDrive, haven't gotten any problems yet. And upload speeds are way better than using Google File Stream. |
from: Riyad Muradov
I agree the performance is much better than SFTPNetDrive. I got the following error on the last command:
However, just using the windows drive worked fine: |
Just fixed the same exact thing on my own Win10/WSL Ubuntu with @chris2crawford 's solution. I would prefer to access GFS directly because of its ability to cache files. Has anyone feature requested this to GFS? |
Hi guys, I have a simple way to do this, even this way is not actually to mount the drive. But basically, you can read or write on it. I just wanted to copy a file from WSL into the Google Drive file stream. (For example, G: \ My drive \ hobby)
Yes, you can invoke the windows cmd on the WSL. |
With recent WSL you should be able to go the other direction too under powershell with something like:
Another (similar in spirit) way to go would be set up It is also possible to use some nested IFS ideas as suggested earlier. Nothing wrong with that in principle, but going that way is stacking one (at least potential) path to failure upon another. If it "works" so much the better, but just be aware there are a lot of unknown/untested/unsupported moving parts involved going that route. Going through interop is at least in theory a solution that should work by design. |
I came here because of this very disappointing answer: https://askubuntu.com/questions/1094020/how-can-i-access-my-google-drive-or-external-hard-from-windows-bash |
This issue is now more than 1.5 years old. Practically this is a complete showstopper for me to use WSL (1 or 2). I tried using RaiDrive but the performance was much too slow for any real work. Sharing GDFS via SMB also did not work. Did anyone find a working solution? |
@steinbergnet and @Masterxilo - As per @SvenGroot's response above, this issue is likely caused by GDrive misbehaving. You might want to file an issue on Google. I advise this reluctantly - I hate it too when vendors seem to point fingers - but WSL just treats drives as ... well ... drives. If the drive behaves, one can access the drive from WSL: And I don't want to sound biased, but if GDrive isn't able/willing to make this change, you might perhaps have to consider other cloud file sync providers. |
From what I see it looks like you are accessing a local directory on
your C: drive that might be mirrored to OneDrive, but not OneDrive itself.
I tried accessing my OneDrive (mounted as separate drive) and it
failed the same way as GDFS.
…On Fri, Oct 18, 2019 at 6:25 PM Rich Turner ***@***.***> wrote:
@steinbergnet <https://github.com/steinbergnet> and @Masterxilo
<https://github.com/Masterxilo> - As per @SvenGroot's response above
<#2999 (comment)>,
this issue is likely caused by GDrive misbehaving. You might want to file
an issue on Google.
I advise this reluctantly - I hate it too when vendors seem to point
fingers - but WSL just treats drives as ... well ... drives. If the drive
behaves, one can access the drive from WSL:
[image: image]
<https://user-images.githubusercontent.com/961950/67110973-ce453880-f188-11e9-93ae-f384d5277244.png>
And I don't want to sound biased, but if GDrive isn't able/willing to make
this change, you might perhaps have to consider other cloud file sync
providers.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2999?email_source=notifications&email_token=AF3TABGHZVGT773POV5MSDTQPHPN3A5CNFSM4ET4PJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBVAVSA#issuecomment-543820488>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF3TABBGEY7D2KOF6H6RL33QPHPN3ANCNFSM4ET4PJ2A>
.
|
That's "not wrong". These third-party IFS problems can be solved on the Windows driver side. Here's hoping that happens. There is a credible counter line of reasoning though. The IFS isn't misbehaving on Windows, and working on Windows is a pretty good definition of working. In the case of Google Drive, a constructive path forward would be to try to convince them to officially support Linux. Or for someone highly motivated to do it for them. If one took this and this one could probably get there with effort.
Made me look. Works here. Leads credibility to thesis it ought work on 9p, becuase same thing modulo implementation detail. |
@therealkenc That's the wrong Google Drive system. Drive FIle Stream is for GSuite accounts and opening files pulls from the server on-demand, instead of downloading everything and syncing. https://www.google.com/drive/download/ [wsl 1] |
Ah. Don't have one of those. So you're faced with the double whammy of no one without a GSuite account able to repro let alone suggest a fix. Most unfortunate. [edit] You're still showing the 9p fail, not the |
Given that GSuite is a paid for product, I think it does not do any harm to open a support ticket with them. |
Let's be realistic. Google Drive is not misbehaving. It works as designed
as a drive
under Windows. The fact that WSL2 somehow does not handle it correctly can
hardly be considered a bug, especially since WSL2 is still in development.
Clearly the problem lies somewhere in the WSL2/9P code.
Since Microsoft is propagating WSL it should have a look at this issue.
…On Sat, Oct 26, 2019 at 11:17 PM Andreas Gnau ***@***.***> wrote:
Given that GSuite is a paid for product, I think it does not do any harm
to open a support ticket with them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2999?email_source=notifications&email_token=AF3TABFMHJ7LWPLZVGMWZ5LQQSXXHA5CNFSM4ET4PJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKRCVA#issuecomment-546640212>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF3TABF2R5727WQDY3BWIALQQSXXHANCNFSM4ET4PJ2A>
.
|
WSL as a file system client is a bit more strict about how a file system needs to behave than Windows in general. This goes both for WSL 1 and WSL 2, because while the mechanism of actually getting to the files is quite different, the actual code that interacts with the file system is mostly the same. For example, we require file systems to support one of a few directory information classes that we use to enumerate directories. Windows has more information classes than the ones that WSL supports, but they don't provide the information WSL requires. DrvFs is the component of WSL that interacts with native Windows file systems. In this context, that also refers to the 9p server used to access Windows files on WSL 2. DrvFs was originally designed to access only NTFS. We've long since updated it to support the various flavors of FAT supported by Windows, CDFS, and SMB (with the main target being a Windows SMB server sharing an NTFS volume). Everything that works besides that is pretty much just lucky, not officially supported. I would definitely not mind taking a look at GDrive to see what we do that mystifies it, and if it's something we can work around, but that's pretty much only possible if I can get it under a debugger. To do that, I need access to a machine from someone who as an account, since it's a paid service so I don't have one. |
Dear Sven,
I really appreciate you taking a look. I have had some success with
RaiDrive, but its performance lags behind GFS, and occasionally I get the
blue screen, for example, when starting up emacs from the shared drive.
Email me at [email protected] to arrange for remote access to my
account.
--Chris
…On Tue, Oct 29, 2019, 18:27 Sven Groot ***@***.***> wrote:
WSL as a file system client is a bit more strict about how a file system
needs to behave than Windows in general. This goes both for WSL 1 and WSL
2, because while the mechanism of actually getting to the files is quite
different, the actual code that interacts with the file system is mostly
the same. For example, we require file systems to support one of a few
directory information classes that we use to enumerate directories. Windows
has more information classes than the ones that WSL supports, but they
don't provide the information WSL requires.
DrvFs is the component of WSL that interacts with native Windows file
systems. In this context, that also refers to the 9p server used to access
Windows files on WSL 2. DrvFs was originally designed to access only NTFS.
We've long since updated it to support the various flavors of FAT supported
by Windows, CDFS, and SMB (with the main target being a Windows SMB server
sharing an NTFS volume). Everything that works besides that is pretty much
just lucky, not officially supported.
I would definitely not mind taking a look at GDrive to see what we do that
mystifies it, and if it's something we can work around, but that's pretty
much only possible if I can get it under a debugger. To do that, I need
access to a machine from someone who as an account, since it's a paid
service so I don't have one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2999?email_source=notifications&email_token=ACYGBEVHHX3REKV3AYO6NYLQRC2GTA5CNFSM4ET4PJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECSJJXY#issuecomment-547656927>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYGBEX4RFJCAODHGNWZEVLQRC2GTANCNFSM4ET4PJ2A>
.
|
Thanks for the details Sven; your write-ups are always appreciated.
I have been half-meaning to ask for some time (but didn't) whether it is possible/practical to loosen our definition of "requires" for a few (probably common) pain points. For example I took a run once at getting Dockany mounted on WSL. Didn't work; they don't implement But this said, can we reasonably or realistically survive without (in this arbitrary example)
Understood. You don't say which ones, but, similar to the link information example, nothing too schmancy (high |
And today it seems to work again (with no updates applied):
|
Here is a workaround that provides some minimal shell capabilities for GDrive. I needed to inspect a file on Google Drive Stream using G:\>"c:\Program Files\Git\bin\bash
<REDACTED> MINGW64 /g
$ ls
'$RECYCLE.BIN' 'My Drive' 'Shared drives'
<REDACTED> MINGW64 /g
$ ls My\ Drive/*.JPG
'My Drive/IMG_2039.JPG' 'My Drive/IMG_2040.JPG' 'My Drive/IMG_2041.JPG' |
Not sure if this matters for anyone but "Google Drive for desktop" seems to work well for my gmail Google account. Drive File Stream did not work in the past. This seems to be a new successor to Drive File Stream that works for all Google accounts. In other words, a G Suite account is no longer required to test this functionality. I have tested the current WSL version that's required for WSLg with "Google Drive for desktop" and it works! 😄 |
So it looks like "Google Drive for desktop" access now works for WSL2 but USB/serial ports don't. Accessing these hardware resources works on WSL1 but "Google Drive for desktop" doesn't. I need both 😩. Since I looked at this issue last, however, it seems Google have re-enabled "Backup and Sync" - they seem to flip-flop a lot on their drive offerings. This means that the synced files are directly accessible on WSL1 with hardware port access. "Google Drive for Desktop" can be run in parallel - maybe this was obvious but this now covers all use cases for me. |
Hello everyone, following the idea of @nelsonjchen and @traversjames, if this still matters. But this is truly annoying when using google drive. I think the simple approach is to install [backup and sync](https://www.google.com/drive/download/ basically the same thing with few functionalities. Google drive download per use vs the files being available locally in backup and sync, which allows to access them using the mount of the windows drive in wsl. |
WSL 1 compatibility was fixed in the latest Dokan release. Google Drive will ship this version in a coming version. |
I upgraded to Google Drive for Desktop yesterday. I cannot access /mnt/g/. Using WSL2 and Ubuntu 20.04LTS |
The initial issue works for me (did nothing special, someone must have fixed things). Unfortunately, there's another minor issue now: For all files seen from my Google Drive (paid version), Ubuntu under WSL sees Inode #2. This causes find(1) to complain about file system loops that aren't real. For example:
|
@sglaser this is an known issue and will be fixed after the version 50 will be fully deployed. |
Google Drive version 50 is released and should cover all issues mentioned here. |
Trying to mount my gdrive on WSL2 using rclone and getting this.
Appreciate any help on the issue.
|
@madzayasodara I don't think you can mount with your WSL2-distro rclone package. You'd need to mount with the rclone.exe in Windows and then should be able to access it inside your WSL2 distro. |
I also have my gdrive mounted as a network drive, which I have mounted using mountain duck, but cannot access it from my WSL2.... Then when I mount it in WSL, a weird never-ending mirrowing happens.
|
Ok I mounted gdrive as a drive using the new Google Drive and then mounted in WSL2 |
@Liryna I just migrated to Google Drive version 51.0.9.0 on Windows 10. I am on WSL 2. G drive shows up on
I can navigate to the drive with no problem:
Am I doing something wrong? Thanks! |
@vinhdizzo could you share the exact command line you used to mount the drive ? |
@Liryna when I launch bash, the G drive is already mounted as
|
@vinhdizzo what happens if you try to mount by using the same commande line in other answers? |
@Liryna Here's what I get:
C drive is OK:
That was the only command I saw in the thread that is based on Google Drive and not other third party tools. Did you want me to try anything else? Thanks! |
@vinhdizzo please give a try to: |
@Liryna sorry I did try that first but forgot to paste it. This is what I get:
|
this works for me, but sometimes it helps to unmount first, e.g. umount /mnt/g (as root ofcourse) |
I've no idea when this started working (it wasn't the last time I checked - perhaps 6 months ago) but today it's working fine. Within my WSL Ubuntu I navigated to /mnt/ and there was my G drive (mapped as G:), and from there I went to /mnt/g/My Drive/ and all my files were there as expected. Happy Customer 😄 👍 |
This only works for your personal documents. If you want to use a Shared Drive, it is completely inaccessible. In fact, it is unusable from anything other than explorer. I tried several different tools in addition to WSL, and they all either displayed nothing, or just a .lnk to some inaccessible location. |
I use WSL plus shared drives using Google Drive for Desktop. But it only works for shared drives in my own organization, not shared from other companies. Not sure why.
|
Just want to signal: I updated WSL from v1 to v2. Before, when I fired up the Google Drive app, I found G: automatically mounted at /mnt/g (this allowed me for example to right click > open windows terminal with wsl in any folder within G:). Now, with WSL2, it doesn't work anymore. Mounting manually with |
Hello,
I always start Windows Explorer from WSL2/bash using the mounted Google
Drive file system.
Since the last WSL Update this week I started to get this error message
after running
WSL for a few hours when I run explorer from bash:
$ explorer.exe G:
<3>WSL (2209) ERROR: UtilBindVsockAnyPort:295: bind failed 38
Rebooting will fix the issue, but it will reappear after a few hours.
Any ideas how to fix this?
Is there a way to downgrade WSL to the previous version?
|
I have used Debian to search files on G drive successfully but suddenly it stopped working. Tried Google drive restart without luck: literakl@DESKTOP-590U5T0:/$ ls -l /mnt/ Edice Windows 10 Home |
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! |
@bitcrazed I plan to follow your recommended instructions to backup
/home/<user>
and installed packages from #2955.However, I would like to compress the backup in a tar.gz archive per these instructions, and I would like to store that archive in my Google Drive File System (GDFS). My GDFS is located in my windows file system in the G: drive. However, when I try to view this drive, I am met with the following:
Upon trying to save an archive in that location, I see a similar error message:
Is there a proper way to mount the Google File System from windows? Or perhaps a way to mount this drive directly on WSL? I checked the File system on G: and it says it is "FAT32". Any advice is greatly appreciated!
The text was updated successfully, but these errors were encountered: