OneDrive on Linux

Brass Contributor

I would like to use OneDrive on Ubuntu, May be working with all or some folders. Since there is no office OneDrive client in Linux, I've searched online and found "rclone" but not sure how secure it is or is there any other alternative out there?

30 Replies
AFAIK, Microsoft has not shared any plans to support Linux in regards of ODFB. However, it seems there is an open source project about OneDrive Consumer support in Linux: https://askubuntu.com/questions/804301/how-to-sync-onedrive-business-office-365-on-linux
Thank you, I’ll check it.

@muratkazanova 

I am the maintainer of the free OneDrive Client for Linux, which supports OneDrive Personal, OneDrive for Business, OneDrive for Office365 and Sharepoint, and fully supports Azure National Cloud Deployments for those that require it. It fully supports shared folders - both OneDrive Personal and OneDrive Business Shared Folders.

 

For further information & details:

This is an actively maintained client which was originally forked from the 'skilion' client (which unfortunately most of the Internet still references). The 'skilion' client was abandoned in 2018.

 

Hi @abraunegg!

 

I've stumbled on this post this morning as I'm trying to "mirror" my Win10 laptop to a Linux machine (using Windowsfx disto, to save all my bad habits :lol:).

I've installed your software and managed successfully to sync from OneDrive to the Linux laptop (using onedrive --synchronize --single-directory command) but I'm now wondering:

  1. if the sync is automatically done in the background when I edit files in the local storage,
  2. if I have to create and customize the config file,
  3. if I also need to create the sync_list file,
  4. if I need to run onedrive as a system service to get automatic sync.

Sorry for the dummy questions, but I'm a bit new to Linux and all those things still look a bit of "magical dust" to me!

 

Thanks in advance for your help!

@jlgarnier 

Glad you found the tool useful 🙂

 

In regards to your questions:

onedrive --synchronize --single-directory

 

What this does is perform a single sync, of the single directory specified. Once the sync has finished, thats it.

 

> 1. If the sync is automatically done in the background when I edit files in the local storage

 

With your existing command, no - there is no automatic sync occurring. However, if you switch '--synchronize' for '--monitor' this will continually sync until you exit the application - ie - sync automatically.

 

> 2. If I have to create and customize the config file

 

Generally you do not need to do this unless you want to change some of the default options. Best read the help / man page for assistance on the configuration options.

 

> 3. If I also need to create the sync_list file

 

Generally no - you do not need to create this file, unless you want to be super specific about what needs to be synced

 

> 4. If I need to run onedrive as a system service to get automatic sync

 

That is generally the best way to configure automatic and constant sync in the background to occur.

 

Feel free to create questions on GitHub (https://github.com/abraunegg/onedrive/) as this is where most questions & a wealth of knowledge in closed cases sit.

If you're looking for something a bit more polished and powerful, check out ExpanDrive

 

It has deb/rpm/AppImage packages and runs on nearly all linux distros. There is a desktop edition as well as a server edition that runs headless. Mounting specific sharepoint sites, remote paths, etc are all supported as well as offline mode and async writes. Also built to withstand reboots, transient networks, etc.

@muratkazanova 

 

I have been using InSync (paid) and no problems at all

https://www.insynchq.com/

> '--monitor' this will continually sync until you exit the application - ie - sync automatically.

Can this be daemonized, like for example with PM2 process manager which can in turn be made to run on startup?

@muratkazanova 

 

Expandrive has the ability to connect to Onedrive and Sharepoint and create a virtual mounted drive. You do not have to sync files to your computer to use them. It operates like a mapped network drive in Windows (without a drive letter of course) or a mounted drive on a Mac. Expandrive is not free and I have no association with the company. But I do have a license of my own. You can try it for free and even keep using it for free once the trial expires. However, after the trial expires you will only be able to use it for something like 20 minutes and then have to restart it.

 

Expandrive also connects to may other platforms including SFTP (which allows a Windows client to map a drive letter to a Linux SFTP server). It has Windows, Linux and Mac clients.  Even when you have a native client for a specific app (Say OneDrive or Dropbox in Windows), Expandrive can be useful to just create a mapped drive and not have to worry about managing synced folders.

@jrlowservices i prefer to use insync as the software is pretty intuitive. also expandrive would disconnet too often even with the paid version. 

@jsmpvSomething about "polished and powerful": Be aware, that there is no offline sync feature in the linux version. I complained about that already over a year ago, but all I get are empty promises, that this feature will be implemented soon.

honestly, rclone is the best solution if you want to mount OneDrive as a directory and only selectively cache files rather than download your whole OneDrive library. rclone is sufficiently secure, it doesn't have its own server code so it can't report your password or drive contents back to the devs or anything. It works almost exactly like on Windows except for the personal vault in my experience

Example 'null' [do NOT use in production or other than general convenience]

For DEV or Prodo use: Look below at 1 - 3.B.1 

null: ============

Download Google Chrome Beta or Dev (keep the paths and SSH key separate- a tmp user account is my usual go to on fedora) In the browser - click you can mount it as a separate drive on your file system. No sudo required. @muratkazanova 

end null ========

Adv Look: =======

Before that trick and one I still leverage for cloud computation and clusters: 

1 Set up a desktop controller, ie. FTP, SQL, Kube, etc. <- you get it ->

2 SharePoint server - Hint SharePoint online works just fine 😃

3.A.0 - Set up a share file with some- python, or- json, or- java, or- etc.

3.A.1 To add security/api's (running a workflow to the 'www') 

3.B.0 For local or dev: 'curl' is best practice -

3.B.1 SharePoint_CLI on github - Hint look for ms365 under the topic 'Microsoft'

End Adv Look ========

Close:

If your still out there in the wild working on this - I can dev a framework to fit the use case and tarball it for you but I would need to know the logic just so I could make it useful, mine is pretty "neat-o", I can snap up something fairly quick if needed

Safe travels - KS

Amazing work! After reading this I went there and deployed the docker setup. Syncing is going on and looks really good so far. Kudos @abraunegg
There is also a really good Office 365 app I use on Ubuntu called "Office365WebDesktop" if you just need occasional access to your onedrive folder (and a huge plus all O365 apps).

@boatguypat 

How do I mount a onedrive link on a server without a graphic environment ? I cannot have one. I cann only access the server via ssh, as root.

 

 

@philip_38 sorry that i cannot help with. 

https://github.com/abraunegg/onedrive its all in CLI - no need for GUI @philip_38