Mounting Google Drive On Xfce Or MATE Desktops (Ubuntu, Linux Mint)

Gnome offers an easy way to access your Google Drive files from your Linux desktop - open Online Accounts, add your Google account and you'll be able to transfer files from / to your Google Drive directly from the Files (Nautilus) application. KDE Plasma 5 was includes similar Google Drive integration, and Cinnamon supports this as well.

But what about other desktop environments? There are ways of mounting Google Drive on any desktop environment, and this article includes 2 such options: installing and using Gnome Settings (Control Center) and Gnome Online Accounts in other desktop environments, like Xfce or MATE, or using Google Drive OCamlFUSE, a tool that achieves something similar to Gnome Online accounts, but without all the Gnome dependencies.


Using any of these 2 options, you'll be able to access Google Drive directly from your file manager of choice. It should work with Thunar, Nemo, Caja, and others. You'll be able to add new files to your Google Drive, delete or modify existing files, etc.

Compared to the Gnome Online Accounts method, Google Drive OCamlFUSE offers more flexibility, it doesn't have Gnome dependencies, but appears to be slower. That may depend on the way one uses Google Drive though, so this may not be accurate. In any case, try it and judge for yourself.

There are also various unofficial Google Drive clients, from command line clients (like grive2) to complete desktop solutions which include file manager integration (like Insync, which costs $29.99 per Google account / one time fee). This article is about mounting Google Drive on Linux desktops that don't have a built-in way of doing this though, and not about all those Google Drive clients.

The instructions below include some Ubuntu (Xubuntu, Ubuntu MATE, etc.), and Linux Mint (MATE, Xfce) specific installation commands. The tools (Google Drive OCamlFUSE and Gnome Online Accounts) themselves should produce the same result on any Linux distribution though.

Mounting Google Drive using Gnome Online Accounts in Xfce, MATE and others


To mount Google Drive using Gnome Online Accounts / Gnome Settings (Control Center) in desktop environments such as Xfce, MATE, and others, you'll need to install the gnome-control-center and gnome-online-accounts packages. They include multiple Gnome dependencies - if you don't want this, you can check out the Google Drive OCamlFUSE option below.

Open a terminal and type this command to install them:

sudo apt install gnome-control-center gnome-online-accounts

Gnome Settings is hidden and doesn't show up in the menu on non-Gnome desktop environments. So if you use Xfce, MATE or some other desktop environment you won't see Gnome Settings or Gnome Control Center in your menu. To run it, we'll need to use a terminal and add XDG_CURRENT_DESKTOP=GNOME before the executable, like this:

XDG_CURRENT_DESKTOP=GNOME gnome-control-center

Now go to Online Accounts, click Google and add your Google account:

Gnome Online Accounts on Linux Mint 19 MATE

Gnome Online Accounts on Xubuntu 18.04

Immediately after adding your Google account to Online Accounts, you should see your Google Drive folder in the file manager (Caja, Thunar or whatever file manager you may be using):

Google Drive mounted in Caja (default MATE file manager) using Gnome Online Accounts / Linux Mint 19 MATE
Google Drive mounted in Caja (default MATE file manager) using Gnome Online Accounts / Linux Mint 19 MATE

Google Drive mounted in Thunar (default Xfce file manager) using Gnome Online Accounts / Xubuntu 18.04
Google Drive mounted in Thunar (default Xfce file manager) using Gnome Online Accounts / Xubuntu 18.04

Using Google Drive OCamlFUSE to mount Google Drive in Linux


Google Drive mounted using google-drive-ocamlfuse is available using Thunar / Xubuntu 18.04

Another way of mounting Google Drive in Linux (for any desktop environment) is by using Google Drive OCamlFUSE. This tool implements a FUSE filesystem over Google Drive, and includes features such as full read/write access to regular files and folders, multiple accounts support, and more. As opposed to using Gnome Online Accounts, this does not come with specific Gnome dependencies.

In Ubuntu (Xubuntu, Ubuntu MATE, Lubuntu, etc.) or Linux Mint (Xfce, MATE) you can install Google Drive OCamlFUSE by using the official stable PPA:

sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update
sudo apt install google-drive-ocamlfuse

Users of other Linux distributions: see the installation instructions from here.

Now you'll have to authenticate google-drive-ocamlfuse with your Google account. To do this, run google-drive-ocamlfuse in a terminal, without appending any options, like this:

google-drive-ocamlfuse

A new tab should open in your default web browser, which asks you to allow google-drive-ocamlfuse to access your Google account. You'll need to allow it and proceed to the next step.

Next, you'll need to create an empty folder in your home directory, which will be used as your Google Drive folder. Something like GoogleDrive should do it. Note that all the instructions below assume you're using ~/GoogleDrive as your Google Drive mount point (if you use a different mount point, remember to change it in all the commands that follow).

After creating this folder in your home directory, run the command below to mount Google Drive to this folder, like this:

google-drive-ocamlfuse ~/GoogleDrive

You'll also need to add google-drive-ocamlfuse with the mount point as an argument to your startup applications. You can access your startup applications as follows:

  • Xfce: launch Session and Startup from the menu, go to the Application Autostart tab and click Add
  • MATE: launch Startup Applications and click Add

After clicking Add, use the following:

  • Name: google-drive-ocamlfuse
  • Command: sh -c "google-drive-ocamlfuse ~/GoogleDrive"

It's similar for pretty much any desktop environment as long as it has a way of adding applications to startup.

Instead of adding google-drive-ocamlfuse to startup, you can also automatically mount it in various ways, as explained here.

For advanced google-drive-ocamlfuse configuration you can check out this page.

8 comments:

  1. Thanks for the article / tutorial. Very helpful indeed.

    ReplyDelete
  2. I don't recommend installing google-drive-ocamlfuse.
    It wouldn't allow me to delete folders in my Google Drive account so I went to remove it.
    That was a mistake. It KILLED my ethernet connection. Perhaps it removed something it wasn't supposed to.
    Buggy piece of shit.

    ReplyDelete
  3. Thank you very much for these very useful and clearly delivered explanations !
    I chose the first method with gnome-control-center and thir would run immediatly.
    As we say in frence : merci mille fois !

    ReplyDelete
  4. I get this error when I enter this command:
    XDG_CURRENT_DESKTOP=GNOME gnome-control-center

    Unable to init server: Could not connect: Connection refused
    Unable to init server: Could not connect: Connection refused

    (gnome-control-center:36994): Gtk-WARNING **: 12:47:49.030: cannot open display:

    ReplyDelete
    Replies
    1. Without knowing any details, I guess you can try to run it like this and see if this gets it too run:

      DISPLAY=:0 XDG_CURRENT_DESKTOP=GNOME gnome-control-center

      Delete
  5. ocamlfuse worked as described by you perfectly for me in XFCE/Mint --- but I've been using it for an hour so far :) THanks for the information

    ReplyDelete
  6. Nice tip about ocamlfuse... that's what i'm searching...

    ReplyDelete