浪人
DE | EN
Linux on the Surface Go — Bonus: OneDrive with Rclone
tech

Linux on the Surface Go — Bonus: OneDrive with Rclone

Back to Blog
2 min read

Linux on the Surface Go — Bonus: OneDrive with Rclone

Another bonus article in the series — setting up OneDrive so it feels familiar like on Windows, without an official client.

The Goal

On Windows, OneDrive integrates seamlessly into Explorer via Files On-Demand: the complete folder contents are always visible, but files are only downloaded when you actually open them. No full local clone, no wasted storage space. This exact behavior should be reproduced on Linux.

There is no official OneDrive client for Linux. Rclone — a widely-used open-source tool for mounting cloud storage — handles this use case well. Combined with the --vfs-cache-mode full option, the mounted OneDrive folder behaves exactly like Files On-Demand on Windows.

An Honest Note Upfront

OneDrive is currently still my central repository for all kinds of files — it’s what simply accumulated over years of Windows use. In the medium term, I’ll replace it. I’m already using Syncthing for Obsidian vaults — there will be a dedicated article describing that setup across multiple devices and operating systems. For now, Rclone is the pragmatic solution to make the transition smooth.

Installation & Configuration

Rclone is included in Ubuntu’s standard package sources:

sudo apt install rclone

After that, a OneDrive remote is configured. Rclone’s interactive setup handles the OAuth process — it opens a browser window for Microsoft login and stores the token locally:

rclone config

Follow the instructions:

  • New remote → assign a name, e.g. onedrive
  • Storage type → select Microsoft OneDrive
  • Leave Client ID and Secret empty (Rclone uses its own app registration)
  • Follow the browser-based OAuth login — worked out of the box for me
  • Confirm OneDrive type (personal, business, etc.) and select the correct drive

Mounting OneDrive

Create a mount point and do a quick test:

mkdir ~/OneDrive
rclone mount onedrive: ~/OneDrive --vfs-cache-mode full &

--vfs-cache-mode full is the crucial flag — it enables full read/write caching so files are treated like local files even though they’re only downloaded on access. The folder structure is immediately visible, individual files are loaded when opened.

Unmount with:

fusermount -u ~/OneDrive

Autostart on Login

To make the mount point automatically available on every login, a systemd user service is recommended — more reliable than a .desktop autostart entry for something that requires a network connection:

mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/rclone-onedrive.service << EOF
[Unit]
Description=OneDrive (rclone mount)
After=network-online.target

[Service]
ExecStart=rclone mount onedrive: %h/OneDrive --vfs-cache-mode full
ExecStop=fusermount -u %h/OneDrive
Restart=on-failure

[Install]
WantedBy=default.target
EOF

systemctl --user enable rclone-onedrive
systemctl --user start rclone-onedrive

After that, ~/OneDrive is mounted and ready on every login — completely hands-off.

What Works, What Doesn’t

The behavior comes very close to Windows Files On-Demand. The folder structure is always present, files are transparently loaded on access, and changes are synced back to OneDrive. The file manager and all other apps work with the mounted folder like local storage.

What’s missing compared to Windows are sync status badges — there’s no visual indicator on files whether they’re locally available or still in the cloud. This is a cosmetic limitation of how GNOME handles mount points, not a specific Rclone issue.

Everything else works flawlessly — and for a transitional solution, that’s more than enough.