This works with the latest version of rclone which is 1.50 at the moment:
OneDrive for Business is basically sharepoint, it works by the rclone setup as described here:
https://rclone.org/onedrive/ (check the limitations!)
So basically you run in a terminal:
Then type n, then type a name and choose option 22 after (this may change, but the onedrive option is meant here).
Then hit enter twice (client id and secret are not needed) and then n for no advanced config.
Then enter y for autoconfig (your browser should open and it's convenient if you're logged in, it will redirect and show a succes message in the browser.
Go back to the terminal and choose 1 for onedrive.
This should show you a drive, choose 0.
Next message, choose y to confirm, the next y too.
Now you have the config setup, so you can mount the share as:
rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive
where onedrive is the name of the share you created and ~/OneDrive is the folder in your home directory where you mount it.
If something goes wrong with mounting, you can umount with:
fusermount -uz ~/OneDrive/
You may have noticed that shared folders are not there.
It's not supported in rclone at the moment for the business version.
To work around that, you can use WebDAV config to mount it.
More on that can be found here:
for vendor choose sharepoint so your config looks something like:
type = webdav
url = https://domain.sharepoint.com/personal/firstname_lastname_domain_com/Documents
vendor = sharepoint
user = [email protected]
pass = encryptes_pass
The issue here is that you would need to add this for every share.
Unfortunately Microsoft didn't deem it necessary to support Linux so my advice is and was to stay away from their products and use the ones that work out of the box.
Update: the mentioned gist is this, I haven't tested it but added it here for convenience and completeness, it should handles shares :
# User service for Rclone mounting
# Place in ~/.config/systemd/user/
# File must include the '@' (ex [email protected])
# As your normal user, run
# systemctl --user daemon-reload
# You can now start/enable each remote by using rclone@<remote>
# systemctl --user enable --now rclone@dropbox
Description=rclone: Remote FUSE filesystem for cloud storage config %i
ExecStartPre=-/usr/bin/mkdir -p %h/mnt/%i
/usr/bin/rclone mount \
--vfs-cache-mode writes \
--vfs-cache-max-size 100M \
--log-level INFO \
--log-file /tmp/rclone-%i.log \
--umask 022 \
ExecStop=/bin/fusermount -u %h/mnt/%i