21 September 2026

Mounting Google Drive on Ubuntu 26.04 with rclone

(Notes captured from a Kagi Assistant thread...)

Ubuntu 26.04 LTS ships GNOME 50, which removed the built-in Google Drive mount — the old GVfs backend was dropped because it depended on unmaintained libgdata/libsoup2.4. The community replacement (fluhus's PPA backend) works, but the most robust distro-agnostic option is rclone mount.

Why not apt or snap?

  • Ubuntu's apt package is rclone 1.60.1 — from 2022. It's frozen for the entire LTS release.
  • The snap blocks rclone mount entirely ("Fatal error: mounting is not supported when running from snap") due to its FUSE sandbox.

Instead, install the current binary directly — rclone is a single static Go binary, and it updates itself via rclone selfupdate (manual command; wrap it in a systemd timer or cron if you want it scheduled):

cd /tmp
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
mkdir -p ~/bin
install rclone-*-linux-amd64/rclone ~/bin/rclone

Creating your own Google OAuth client ID

rclone ships with a shared client ID, but Google rate-limits it across all rclone users — so the official docs recommend creating your own. It takes about five minutes and only needs doing once. For more on Google's OAuth policies and how test-mode projects work, see my companion page on the subject.

Step 1: Create a new Google Cloud project

  1. Go to the Google Cloud Console at https://console.cloud.google.com/ and sign in with your Google account.
  2. Click the project picker at the top of the page (next to the "Google Cloud" logo) → New Project.
  3. Give it a name (e.g. rclone) — you can leave the auto-generated Project ID as-is — and click Create.
  4. Once created, make sure the new project is selected in the project picker; everything below happens inside it.

Keep this project dedicated to rclone — it makes the credentials easy to find later, and isolates anything you enable from other projects.

Step 2: Enable the Google Drive API

APIs & Services → Library → search for Google Drive API → Enable.

Step 3: Configure the OAuth consent screen

APIs & Services → OAuth consent screen:

  • Choose External (the only option for personal accounts) and continue.
  • Fill in an app name (e.g. rclone) and your email as the support/contact email.
  • Add your own Google account as a test user — required, since the project stays in test mode.

No Google verification needed — test mode is fine for personal use as long as your account is a test user.

Step 4: Create the OAuth client

APIs & Services → Credentials → Create Credentials → OAuth client ID:

  • Application type: Desktop app
  • Click Create, then copy the Client ID and Client Secret.

A note on the companion page

The OAuth policy notes referenced above live on a GitHub Pages site, and two things are worth knowing when publishing one:

  • Initial deployment takes a while. After pushing the site and enabling Pages, the build and propagation can take several minutes to a few hours before the URL resolves and serves content. Don't panic if it 404s at first.
  • Verify the site with Google Search Console. For Google to index and reference the page, verify ownership in Google Search Console. The easiest method for a GitHub Pages site is the HTML tag: Search Console gives you a <meta name="google-site-verification" content="..."> tag, which you add to the page's <head>, push, and click Verify. Since you control the source directly, this is more convenient than a DNS TXT record — and it survives Pages rebuilds as long as the tag stays in your template.

Configuring the remote

Run rclone config as your normal user (never sudo — the token belongs in your config, not root's):

n) new remote → name: GDrive → storage: drive
client_id:     <paste your Client ID>
client_secret: <paste your Client Secret>
scope:         1 (full access)
root_folder_id: leave blank

The OAuth verification dance

During setup you'll hit Google's security screening:

  1. rclone opens a browser to Google's consent page.
  2. Google warns "Google hasn't verified this app" — expected, because your project is in test mode rather than published/verified.
  3. Click Advanced → Go to rclone (unsafe) — it's safe; you're authorizing your own project to access your own Drive.
  4. Approve, and the token is saved to the config.

The config lives at ~/.config/rclone/rclone.conf (check with rclone config file) — a plain text file containing your OAuth tokens, created 0600. Back it up like a password file; copying it to another machine carries the tokens with it.

Test mount

mkdir -p ~/GDrive
rclone mount GDrive: ~/GDrive --vfs-cache-mode writes --daemon

--vfs-cache-mode writes is essential for Drive — many apps fail writing directly to the mount without it.

Running automatically at login: a systemd user unit

Drop --daemon (systemd backgrounds the process itself) and create ~/.config/systemd/user/rclone-gdrive.service:

[Unit]
Description=rclone mount of Google Drive
AssertPathIsDirectory=%h/GDrive
After=network-online.target

[Service]
Type=notify
ExecStart=%h/bin/rclone mount GDrive: %h/GDrive \
    --vfs-cache-mode writes \
    --dir-cache-time 12h \
    --cache-dir %h/.cache/rclone
ExecStop=/bin/fusermount -u %h/GDrive
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Then:

systemctl --user daemon-reload
systemctl --user enable --now rclone-gdrive.service
systemctl --user status rclone-gdrive.service

Useful commands:

systemctl --user stop rclone-gdrive      # unmount
systemctl --user restart rclone-gdrive   # after config changes
journalctl --user -u rclone-gdrive -f    # live logs

To stop a manually-daemonized mount first: fusermount -u ~/GDrive (lazy variant: -uz if a file handle is stuck).

Type=notify means systemd waits until the mount is genuinely ready; Restart=on-failure recovers from network blips. If you want the mount alive even with no login session, add sudo loginctl enable-linger $USER.

Keeping it updated

~/bin/rclone selfupdate        # run occasionally; it's a one-shot command

Or schedule it — a systemd user timer with OnCalendar=weekly works nicely. Note a running mount keeps the old code until restarted.

No comments: