After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796064 - Cannot mount Google Drive without GOA
Cannot mount Google Drive without GOA
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: google backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Debarshi Ray
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2018-05-13 09:22 UTC by damianatorrpm@gmail.com
Modified: 2018-09-21 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description damianatorrpm@gmail.com 2018-05-13 09:22:54 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
Comment 1 Debarshi Ray 2018-05-14 08:41:31 UTC
It is certainly mountable via the CLI. What you need is an OAuth2 token for your account from GOA.
Comment 2 Ondrej Holy 2018-05-14 08:50:51 UTC
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
$
Comment 3 damianatorrpm@gmail.com 2018-05-14 16:21:27 UTC
[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
Comment 4 Ondrej Holy 2018-05-15 07:29:31 UTC
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
Comment 5 Debarshi Ray 2018-05-15 11:06:16 UTC
(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.
Comment 6 damianatorrpm@gmail.com 2018-05-17 05:47:49 UTC
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.
Comment 7 Debarshi Ray 2018-06-05 16:47:36 UTC
(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.
Comment 8 GNOME Infrastructure Team 2018-09-21 18:20:31 UTC
-- 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.