How-to: Mount Google Drive as a network drive in antiX

Forum Forums General Tips and Tricks How-to: Mount Google Drive as a network drive in antiX

This topic contains 3 replies, has 3 voices, and was last updated by PPC Jul 8-8:16 am.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24054
    Member
    Avatar
    PPC

    There are some paid and free applications to use Google Drive in Linux.
    You can use a application like “odrive” (that works almost like Google Drive application for windows) or you can mount or unmount Google drive like it was, for example, a USB thumb drive. This is the way I like to use it in my Linux OS (antiX and MX) and also my android devices…

    Short tutorial on using Google drive as a mountable “net drive” available in any file manager (Rox or SpaceFM, for example):

    1-instalation

    You can install the needed file using 2 differents ways. One an adaptation of offical instructions (from https://github.com/astrada/google-drive-ocamlfuse/wiki/Installation)
    Note: followint the original instructions adds ubuntu PPA files to antiX, which, generally speaking can break your antiX instalation

    If you don’t want to do this, the procedure is even simpler: Open your internet browser and download the deb files you want to install from https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa/+packages (I used the files available under the name ” google-drive-ocamlfuse – 0.7.6-0ubuntu1~ubuntu16.04.1 ” , in the line that said “Xenial”, you can choose the 32 or the 64 bits deb file), download the file, open it in your file manager and install it using gdebi. If you do so, please jump right to the configuration section below…
    PS: I checked out the files and they appear to simply install a man page and 1 executable file, which seem quite harmless…

    If you want to follow the official and long procedure do this:

    -Open the terminal and run: sudo apt install software-properties-common dirmngr
    -As root, create the file /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list and write the following lines… You can do this running this command in the terminal- sudo leafpad /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list

    Then add this 2 lines (copy and paste them in your text editor, then save the file):

    deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
    deb-src http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main

    -Then you need to add the key otherwise the command apt update will not take the new sourcelist into account:
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AD5F235DF639B041

    If you get a message like this: gpg: keyserver receive failed: Server indicated a failure Then do: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AD5F235DF639B041

    – Run, from the terminal: sudo apt update

    – Run, from the terminal: sudo apt install google-drive-ocamlfuse

    2- Configuration ( adapted from https://github.com/astrada/google-drive-ocamlfuse):
    The first time, you can run google-drive-ocamlfuse without parameters:

    – From the terminal run: google-drive-ocamlfuse

    This command will create the default application directory (~/.gdfuse/default), containing the configuration file config (see the wiki page for more details about configuration). And it will start a web browser to obtain authorization to access your Google Drive. This will let you modify default configuration before mounting the filesystem.
    On the browser window that opens Log on to you google account and aprove access to your account by this application (usually enter your credentials and click “ok” or “allow” when asked a question- a new webpage confirming the procedure was successful will be displayed)

    – Then you can mount the filesystem:

    First (one time only) you have to create a mountpointname, for example, in your home folder create a folder named “gdrive”. – Example how to do this- In the terminal run: mkdir ~/gdrive
    – To mount the filesystem: run: google-drive-ocamlfuse mountpoint [mountpointname]
    ex: if using the above example, the command should be: google-drive-ocamlfuse mountpoint ~/gdrive

    A folder called gdrive will appear as mounted on your file manager. If you enter it, you’ll have access to all your google drive files…

    3- Extra information:
    If you use android devices with the same google account, you’ll probably get a warning to confirm if you really allowed ocamlfuse to access your account- that’s normal.
    -If you have more than one account, you can run: google-drive-ocamlfuse -label label [mountpoint]
    Using label to distinguish different accounts. The program will use the directory ~/.gdfuse/label to host configuration, application state, and file cache. No file is shared among different accounts, so you can have a different configuration for each one.

    -To unmount the filesystem, close any file manager window displaying Google Drive and issue this command, from the terminal: fusermount -u [mountpoint]
    (if using the above example just run: fusermount -u ~/gdrive

    4- Conclusion and suggestions:
    After the initial installation and configuration you can just run the command to mount Google Drive file system Ex: google-drive-ocamlfuse mountpoint ~/gdrive
    (it takes about 12-30 Mb of RAM, way less than running google drive in a web browser, also it’s very fast, even on slow computers.)
    Files in google docs format are listed as .desktop files. Open those .desktop files and copy and paste the link inside in your browser address bar to be able to read/edit them.
    When you are done using using Google Drive, if you want, just run the command to unmount the filesystem. Ex: fusermount -u ~/gdrive
    You can create scripts for this and put them in your desktop, for example, to automate the procedure even more you can add google drive’s mount command to the start of antiX, if can spare the RAM it continually uses (read on-line how to do this).

    TIP: Mount/unmount google drive via GUI– add the above mount command to the SpaceFM menu. That way you simply click the menu and Google Drive mounts almost instantly, just like if it was a normal SpaceFM “function” out of the box, and you can run it without even using the (many times dreaded) terminal.
    To do it open SpaceFM, click the “tools” menu then “add new command”. In the new window enter the name you want to give to your command (like “Google Drive”), click OK, and in the next window enter or paste the command to mount google drive and click OK. Now, every time you click the tools menu in SpaceFM, you can simple click the “Google Drive” menu and it automatically gets mounted.
    You can also similarly add the unmount command (to add a new command to the menu click “tools” and then right click on the menu entry (ex: “Google Drive”), choose “new command”, give it the name you want (Ex: “Unmount Google Drive”), click OK, then enter/paste the unmount command in the next window and click OK.
    Note: you’ll have to close the SpaceFM tab displaying google drive to be able to unmount it (or you’ll get a error message saying it’s being used).

    PS: I installed this multiple times in antiX 19 beta 1, trying the several permutations I list above and they all run just fine (that’s why this post has so many edits). If you don’t want to install the deb file (because it comes from Ubuntu and you are afraid it will break your system), you can even extract the executable file and use it directly, adapting the above mount command to run directly from the file’s location….

    P.

    • This topic was modified 3 months, 2 weeks ago by PPC.
    • This topic was modified 3 months, 1 week ago by PPC.
    • This topic was modified 3 months, 1 week ago by PPC.
    #24096
    Forum Admin
    dolphin_oracle
    dolphin_oracle

    interesting, thanks!

    #24255
    Member
    Xecure
    Xecure

    Thank! this is very interesting! I will bookmark your post.

    #24308
    Member
    Avatar
    PPC

    @dolphin_oracle and @Xecure- Thanks for the comments, guys… Do you thing this would be handy for enough users to deserve to come available for installation in antiX Control Centre /MX?
    I’m not aware how many users complain about using Google Drive in Linux… I managed to get it going as a network drive in MX, using a Gnome app (I even wrote in a thread about how to do that), but it was a way more complex process than this. If this was just: go to Control Centre- Install “Google Drive as a network drive” – Log on your Google Account on the browser window that pops up and allow access – use Google Drive from Rox/Space-fm (automaticaly adding the Space-Fm menus I mentioned or menu entries to mount/unmount it…), it would be even easier than using the official Gdrive Windows application, even on very low specs machines…

    P.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.