How to enable OneDrive in Ubuntu 24.04

Among the (many) new features in Ubuntu 24.04 LTS is the ability to access Microsoft OneDrive files using the Nautilus file manager.

Yup, no 3rd-party app downloads, no dodgy scripts to run, and no paid plans to cough up for. OneDrive file access is is part of GNOME 46 and available in all Linux distribution using it (which includes the latest Ubuntu LTS).

OneDrive file access in GNOME works the same way as the long-standing Google Drive integration: a Gvfs backend authorised through GNOME Online Accounts in the Settings app, which adds an entry to the Nautilus sidebar.

Once configured you can click that entry to ‘mount’ the remote share and browse, open, edit, move, and copy files to and from it just like it was a local folder. While there’s no sync or offline support (an internet connection is always needed) it “just works”.

But I have seen some confusion online about how to set it up.

So let’s go through it, step-by-step.

Accessing OneDrive Files in Nautilus

“I don’t see OneDrive listed”, people have said.

When you open the Settings app and select Online Accounts from the sidebar you are shown a list of various account types, including 3 different Microsoft ones:

  • Microsoft Personal
  • Microsoft 365
  • Microsoft Exchange

Microsoft Personal is used for e-mail, e.g., Outlook, Live, Hotmail. Log in using this one to enable desktop email clients like Thunderbird and Geary to fetch, check for, and send email using a Microsoft account, or use Microsoft Exchange for company email through Evolution.

For OneDrive file access choose the Microsoft 365 account type in Settings > Online Accounts.

Admittedly the dialog that opens looks complicated. There’s no mention of OneDrive or file access, only fields requiring client IDs and issuer info — it doesn’t sound relevant to regular users looking to access a few cloud files, does it?

Ignore everything and click “Sign in…”

But don’t panic; ignore ALL of the text fields and options in the dialog.

Yes, really.

Don’t enter anything in any of the fields just click the “Sign in” button.

This opens another dialog:

And click “Sign In…” again

Click the “Sign In…” button.

The Microsoft website will open in your default web browser, which is Firefox on Ubuntu. It can take a few seconds for the browser to startup if it’s not already open. Don’t be impatient and close the dialog yet.

Once the web page loads you will be able to log in using your Microsoft account credentials. If you have several accounts be sure to enter the one that is linked to the OneDrive files you want to access.

Next, confirm you’re trying to “sign in to GNOME” by clicking the “Continue” button to proceed:

You are trying to sign into GNOME

After you click “Continue” Firefox will (assuming you’ve not previously authorised it to do so) ask if you wish to allow Microsoft’s sign-in site to open goa-auth2 links.

Wait a second or so for the “Open Link” button to become clickable then click it:

Click the open link button to complete the authorisation

The Online Accounts window will zip back into focus. All being well, you will now see your Microsoft account details listed in the dialog, along with the Microsoft 365 logo, and a toggle to turn Files access on and off:

Success!

When this toggle is turned on a virtual mount icon with your account name beside it will appear in the sidebar of the Nautilus file manager.

In Nautilus, you can on this new sidebar entry to “mount” your OneDrive cloud storage.

You can then browse the contents of your OneDrive like it was a regular folder — albeit with a bit of lag if your network is slow and/or you have a lot of files up in the cloud:

The ‘remote server’ icon is your OneDrive mount

You won’t see file thumbnails for remote mounts by default as Nautilus is configured to only load thumbnails/previews for local files. Why? Because loading previews for remote files can slow things down, increase data usage, and so on.

You can manually change this behaviour in Nautilus‘ preferences:

You can ask Nautilus to render file thumbnails for remote mounts

Alas, changing this setting makes no difference for me. Image thumbnails still don’t load, not unless I open the relevant file (e.g., view an image in the native Ubuntu image viewer) first. It’s annoying but I don’t consider it a deal breaker.

And that’s it; you’ve now enabled OneDrive access in Ubuntu 24.04 LTS without needing to download anything else.

Tweaking things

You may want to tweak the Ubuntu Dock (Settings > Ubuntu Desktop) to hide unmounted drives or hide remote mounts from being shown. If not, get used to having a generic grey server icon taking up space in the dock.

You can also use toggle the Files switch in your Microsoft 365 account panel to disable/enable OneDrive access as and when you need it. Turning it off hides the mount icon in the Ubuntu Dock as well as the sidebar entry that shows in the Nautilus sidebar.

GNOME developers plan to buff some of the UI elements (and make prominent the ‘OneDrive’ element) in future releases. Whether those changes land in Ubuntu 24.04 LTS is unclear, but if they don’t at least you now know how to set it up.

If you find that you’re continually being signed out of your account between reboots, it’s a bug and a fix is on the way. In the meantime, there’s a simple workaround.