linux

Arch Linux Microsoft 365 Drive: Mount Guide

Accessing your Microsoft 365 cloud files on Arch Linux doesn't have to feel like an uphill battle. Microsoft doesn't provide an official desktop client for Linux, which leaves users searching for reli

Arch Linux Microsoft 365 Drive: Mount Guide
In this story

Accessing your Microsoft 365 cloud files on Arch Linux doesn't have to feel like an uphill battle. Microsoft doesn't provide an official desktop client for Linux, which leaves users searching for reliable alternatives to bridge the gap between their workstation and the cloud. Whether you manage personal files or an organization's SharePoint-backed document library, you can integrate your cloud storage directly into your local file manager.

Two primary open-source pathways exist for this integration: using Rclone for flexible command-line mounting and synchronization, or using OneDriver for a file-system-level cache approach. Setting these up correctly gives you direct access without bloating your local disk.

Choosing Your Integration Method

Before typing commands into your terminal, decide how you want your files to behave on your Arch system.

  • Rclone Mount: Ideal if you want a robust, scriptable network file system mount that connects directly via the Microsoft Graph API. It doesn't store full copies locally by default, querying files on demand.
  • OneDriver: A specialized Linux client available on the Arch User Repository (AUR) that mounts your cloud files as a local filesystem, downloading files dynamically when you open them and caching them for offline use.

If you prefer a lightweight background daemon that respects standard Unix file permissions and works seamlessly with file pickers, Rclone remains the standard enterprise and power-user choice.

Installing and Configuring Rclone on Arch Linux

Rclone supports both personal Microsoft 365 accounts and enterprise school or work tenants.

First, update your package repositories and install rclone along with fuse3 to handle user-space mounting:

sudo pacman -Syu rclone fuse3

Next, initiate the interactive remote configuration utility:


Follow these configuration steps in the terminal prompt:

  1. Press n for a New remote.
  2. Name your remote (for example: m365drive).
  3. Type the number corresponding to onedrive (Microsoft OneDrive / SharePoint / Office 365).
  4. Leave Client Id and Client Secret blank unless you are using a custom Azure app registration.
  5. Choose your account type: select 1 for normal consumer/personal or 2 for business/enterprise (Office 365 / SharePoint).
  6. Opt out of advanced config by pressing n.
  7. Choose y to auto-configure using your web browser. If you are configuring a headless server or headless environment, choose n and follow the instructions to authenticate from a local machine with a browser.

Once your browser opens, log into your Microsoft 365 account and grant permissions. Return to your terminal, and Rclone will save the token.

Mounting Your Microsoft 365 Drive Locally

Create an empty local directory to serve as your mount point:

mkdir -p ~/M365Drive

Test your mount manually using the rclone mount command:

rclone mount m365drive: ~/M365Drive --vfs-cache-mode writes &

The --vfs-cache-mode writes flag is essential. Without it, applications that write directly to files (like LibreOffice or text editors) may fail because standard Linux file-locking and partial-write behaviors don't map natively to cloud storage APIs. With caching enabled, Rclone buffers modifications locally and uploads them safely in the background.

Automating the Mount with Systemd

To make your Microsoft 365 drive mount automatically upon system boot or user login, create a custom systemd user service.

Create the user systemd directory if it doesn't already exist:

mkdir -p ~/.config/systemd/user/

Create and open a new service file using your text editor:

nano ~/.config/systemd/user/rclone-m365.service

Paste the following configuration blocks into the file, making sure to replace your username and paths if necessary:

[Unit]
Description=Rclone mount for Microsoft 365 Drive
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount m365drive: %h/M365Drive --vfs-cache-mode writes --dir-cache-time 10m
ExecStop=/usr/bin/fusermount -u %h/M365Drive
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=default.target

Save the file and exit the editor. Then, reload the systemd user daemon and enable your new service:

systemctl --user daemon-reload
systemctl --user enable --no-block rclone-m365.service
systemctl --user start rclone-m365.service

Verify that the service is running correctly without errors by checking its status:

systemctl --user status rclone-m365.service

Common Mistakes to Avoid

Users migrating cloud storage workflows to Arch Linux often run into a few frequent pitfalls.

  • Mounting on a non-empty directory: Rclone requires the target folder to be completely empty before mounting. If local files exist inside ~/M365Drive prior to running the mount command, the operation fails or masks those local files.
  • Forgetting VFS caching: Omitting --vfs-cache-mode writes often causes document editors to throw cryptic I/O errors or save empty files because they cannot perform random-access write operations directly over the Microsoft Graph API.
  • Ignoring rate limits: Microsoft enforces strict API request thresholds on both personal and enterprise tenants. Avoid setting aggressive synchronization loops or indexing tools that hammer your mount with thousands of simultaneous stat calls.

Frequently Asked Questions

Can I access SharePoint document libraries alongside my personal drive?

Yes. During the Rclone configuration process, selecting the business account type (2) allows youet to pick between your personal OneDrive, shared libraries, and specific SharePoint team sites associated with your Microsoft 365 organization.

How do I safely unmount the drive?

If you need to disconnect your cloud storage manually, run the following command in your terminal:

fusermount -u ~/M365Drive

Never force-close the terminal running an active mount without unmounting first, as this can leave stale file handles in your Linux virtual filesystem.

Are my files available offline?

With the configuration outlined above, files are fetched on demand to save local disk space. However, any file you open, edit, or explicitly copy is cached locally by Rclone. For complete offline synchronization of an entire directory structure, consider using rclone sync or rclone bisync inside a cron job or systemd timer instead of a live mount.

What should I do if my authentication token expires?

Microsoft 365 security policies occasionally invalidate tokens or require re-authentication. If your terminal starts throwing unauthorized errors, simply run rclone config reconnect m365drive: in your terminal and complete the browser login prompt to refresh your session credentials.

SB

Written by

Samuel Baker

Samuel Baker approaches each story with intellectual curiosity and a commitment to fairness, earning the trust of readers and sources alike.

More from linux