How to Mount Google Drive in Linux Using “Google Drive OCamlfuse” Client

google-drive-ocamlfuse is a FUSE-based file system written in Ocaml, which makes it possible to mount Google Drive on Linux Systems.

Features
  1. Gives full read/write access to ordinary files/folders.
  2. Provides read-only access to Google Docs, sheets and slides.
  3. Access to Trash (.trash) Directory.
  4. Duplicate file handling.
  5. Support for multiple accounts.

Installation of google-drive-ocamlfuse on Linux

1. Google-drive-ocamlfuse tool can be easily installed on Ubuntu 15.04, 14.10, 14.04, etc. and it’s derivatives by adding a PPA repository.

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

On Archlinux, you can easily install google-drive-ocamlfuse from the AUR package.

$ yaourt -S google-drive-ocamlfuse

For most of other Linux distributions, you have to compile it from source using following commands.

2. If you are running a different Linux distribution, you must compile it from source, for this you must have OPAM (an OCaml package manager) installed on the system.

$ sudo apt-get install ocaml camlp4-extra

Note: If the above process reports that OPAM could not be installed, as it is not provided by any package for your distribution, you have to compile and install it using following commands.

$ git clone https://github.com/OCamlPro/opam.git
$ cd opam
$ ./configure
$ make
$ sudo make install

3. Next install the C tools and libraries: m4, curl, fuse, and sqlite3. These dependencies packages are must installed on the system, in order to compile the executable. If you are using a .deb based distribution, you can easily install these libraries using following command.

$ sudo apt-get install m4 libcurl4-gnutls-dev libfuse-dev libsqlite3-dev

4. Once all above needed dependencies are installed, start and update the OPAM.

$ opam init
$ opam update

5. Now it’s time to install google-drive-ocamlfuse.

$ opam install google-drive-ocamlfuse

Usage of Google-drive-ocamlfuse

6. Firstly, you need to authorize google-drive-ocamlfuse with your Google account by running following command.

$ google-drive-ocamlfuse

As soon as you fire the above command, a page will open in default web browser and it will ask you to authorize and allow google-drive-ocamlfuse to access your Google Drive with your Google account. Enter your Email and Password.

Google Account

Google Account

7. Once you logged into your Google account, you need to accept the term and services.

Allow Application

Allow Application

8. You are asked to enter your Password once again.

Gmail Password

Gmail Password

9. Allow and give permission to application gdfuse OAuth2 to access your Google account.

Allow Access gdfuse OAuth2

Allow Access gdfuse OAuth2

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

34 Responses

  1. Jessica says:

    There is something strange about the way your code blocks are displaying; ~ is changed to – in my browser (Firefox)

  2. Martin says:

    Does anyone know how this method compares to eg grive/grive2? The latter methods, I’ve had bad experiences with, so I’ll try this new method now, thanks a lot for the article…

  3. Rob says:

    Is it possible to edit this to use lynx instead of “xdg-open”, “firefox” or “google-chrome”. Been following this to install on one of my headless servers which has no gui and therefore no graphical browser.

  4. Lim JH says:

    When I try to give ownership to avi, it says “user is not found” .Any idea?

  5. Thu Win says:

    This caused Linux Mint to stop booting!

  6. Jose Rivera says:

    Thanks a lot folks, very useful, even if I have no knowledge about Linux (sorry my English, I do not speak English).

  7. Jacques says:

    Hi,

    I have had to change:
    gdfuse#default /mnt/gdrive fuse uid=1000,gid=1000 0 0
    to:
    gdfuse#default /mnt/google_drive fuse uid=1000,gid=1000,user 0 0

    • Ravi Saive says:

      @Jacques,

      Thanks for sharing the tip, but could you tell us why it needed and how you came to know? it will help us to correct the article with correct explanation. So, that end users will know more better about the command.

  8. laudup says:

    Thank you very much for this tutorial. It is really very useful.
    The question is what to do if you only have the command line and no GUI (so no browser too ;-).

    Thank you.

  9. Boi Le says:

    google-drive-ocamlfuse on Lubuntu 14.04 is too slow. I tried to use vi to edit a text file in google-drive, when I pasted about 2KB text from clipboard, it took around 60 seconds. The same thing works smoothly on pCloud.com, it seems that pCloud do caching well.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.