Squoggle

Mac's tech blog

Monthly Archives: December 2019

Mount OneDrive from Linux Mint

How to Mount OneDrive from Linux Mint

Don’t install Rclone from the standard repository. That version is too old.

Install Rclone:

cd ~/Downloads
wget https://downloads.rclone.org/rclone-current-linux-amd64.deb
sudo apt install ./rclone-current-linux-amd64.deb

Run the Rclone wizard:

rclone config

Select n to create a new remote:

$ rclone config
2019/12/04 20:47:41 NOTICE: Config file "/home/mac/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
n/r/c/s/q>

Name is something meaningful like ‘onedrive’:

name> onedrive

Select 22 for Microsoft OneDrive:

22 / Microsoft OneDrive
\ "onedrive"

You will be asked for a Microsoft App Client Id. Just hit Enter to accept the default and leave blank.

You will be asked for a Microsoft App Client Secret. Hit Enter to accept the default and leave blank.

You will be asked to edit advanced config. Type N

You will be asked to use auto config. Type y :

Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> y

Your browser should open now and ask you to sign into OneDrive. Put in your email address. Hit next then your password and check the box to keep signed in then the sign in button.

At this point I seem to be locked out of OneDrive as my sign in did not work on this computer.

I tried again and instead of doing auto config I did N to not do auto config.

Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
rclone authorize "onedrive"
Then paste the result below:
result>

I did the above and got a very long “token” that I was able to copy and paste into this machine.

It then asked me to choose a number from below. I selected 1 for OneDrive

Then it said it found 2 drives. Not sure why. I selected drive 0

Then I was able to exit Rclone by typing q:

Current remotes:

Name Type
==== ====
onedrive onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

Now create a new directory:

mkdir ~/OneDrive

Now mount OneDrive:

rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive

This will appear to hang your session but you can stop it by doing CTRL C

Now to start at boot up you canĀ open Startup Applications, and in Startup Applications click Add.

After clicking Add, use the following:

Name:    Mount OneDrive
Command: sh -c "rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive"