GNOME Bugzilla – Bug 796064
Cannot mount Google Drive without GOA
Last modified: 2018-09-21 18:20:31 UTC
impossible to mount via command: gvfs-mount google-drive://address@gmail.com/ does not work, currently the only option is via gui. Question has been asked around the net multiple times: https://unix.stackexchange.com/questions/236014/mount-google-drive-on-command-line-using-gvfs-google
It is certainly mountable via the CLI. What you need is an OAuth2 token for your account from GOA.
Yea, it works, you just need that token (ie. have properly setup your google account over gnome online accounts). $ gio mount -l ... Volume(1): ondrej.holy@gmail.com Tpe: GProxyVolume (GProxyVolumeMonitorGoa) ... $ gio mount google-drive://ondrej.holy@gmail.com $
[tux@fed28 ~]$ gio mount google-drive://ondrej.holy@gmail.com/ gio: google-drive://ondrej.holy@gmail.com/: Invalid mount spec doesn't ask for passport. is there a more detailed instruction? https://www.google.bg/search?q=gio+mount+google+drive&oq=gio&aqs=chrome.0.69i59j69i57j69i61j35i39j0l2.1026j0j7&sourceid=chrome&ie=UTF-8
Google backend is not able to obtain oauth2 token itself, therefore you have to setup your Google account over GNOME Online Accounts first. This step you can't probably do over command line. Or is that possible (even theoretically), Rishi? However, consequently, you can use "gio mount" for already set up account (you have to see the corresponding volume over "gio mount -l", otherwise you will get "Invalid mount spec" error). See: https://wiki.gnome.org/Projects/GnomeOnlineAccounts/Debugging#Integration_with_GtkFileChooser_and_Nautilus
(In reply to Ondrej Holy from comment #4) > Google backend is not able to obtain oauth2 token itself, therefore you have > to setup your Google account over GNOME Online Accounts first. This step you > can't probably do over command line. Or is that possible (even > theoretically), Rishi? > > However, consequently, you can use "gio mount" for already set up account > (you have to see the corresponding volume over "gio mount -l", otherwise you > will get "Invalid mount spec" error). Yes, exactly as Ondrej said. Getting an OAuth2 token from Google involves using a fully-featured web browser, so in that sense it's not possible to do it entirely through the command line.
Is it possible to obtain that token without gnome-settings? it has been asked already a few times online as lxqt (pcmanfm) / cinammon file manager use gvfs and do not contain gnome-settings.
(In reply to damianatorrpm@gmail.com from comment #6) > Is it possible to obtain that token without gnome-settings? It is certainly possible for someone to write their own code to get an OAuth2 authentication token from Google for accessing Drive. Note that getting a token involves human interaction through a web browser, which means you need a GUI; which is why that part is not baked into GVfs' Google backend. Depending on how you get the token, you need to tell GVfs about it. On GNOME, GVfs' GOA volume monitor monitors accounts added to GOA, and exposes anything that can be mounted by GVfs as a GVolume. The details of how to mount it, the account details including the tokens, etc. are hidden behind the GVolume abstraction. When you try to mount it, those details are passed to the relevant GVfs backend behind the scenes, and it just works. That was a summary of the link that Ondrej posted in comment 4. :) > it has been asked already a few times online as lxqt (pcmanfm) / cinammon > file manager use gvfs and do not contain gnome-settings. Well, it's up to them to provide their equivalent of GVfs' GOA volume monitor, or they can use GOA.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/336.