Remote (browser-based) setup from another machine (Windows)

Windows Installation

This is crucial as nowhere its written how to progress and verify remote setup from Windows

[RCLONE WINDOWS DOWNLOAD](https://rclone.org/downloads/)
  1. Download rclone for windows and run the rclone.exe

  2. After downloading, open cmd and type rclone. It should show something like this -

C:\Users\R>rclone
Usage:
  rclone [flags]
  rclone [command]
 
Available commands:
  about       Get quota information from the remote.
  archive     Perform an action on an archive.
  authorize   Remote authorization.
  backend     Run a backend-specific command.
  bisync      Perform bidirectional synchronization between two paths.
  cat         Concatenates any files and sends them to stdout.
  check       Checks the files in the source and destination match.
  checksum    Checks the files in the destination against a SUM file.
  cleanup     Clean up the remote if possible.
  completion  Output completion script for a given shell.
  config      Enter an interactive configuration session.
  convmv      Convert file and directory names in place.
  copy        Copy files from source to dest, skipping identical files.
  copyto      Copy files from source to dest, skipping identical files.
  copyurl     Copy the contents of the URL supplied content to dest:path.
  cryptcheck  Cryptcheck checks the integrity of an encrypted remote.
  cryptdecode Cryptdecode returns unencrypted file names.
  dedupe      Interactively find duplicate filenames and delete/rename them.
  delete      Remove the files in path.
  deletefile  Remove a single file from remote.
  gendocs     Output markdown docs for rclone to the directory supplied.
  gitannex    Speaks with git-annex over stdin/stdout.
  hashsum     Produces a hashsum file for all the objects in the path.
  help        Show help for rclone commands, flags and backends.
  link        Generate public link to file/folder.
  listremotes List all the remotes in the config file and defined in environment variables.
  ls          List the objects in the path with size and path.
  lsd         List all directories/containers/buckets in the path.
  lsf         List directories and objects in remote:path formatted for parsing.
  lsjson      List directories and objects in the path in JSON format.
  lsl         List the objects in path with modification time, size and path.
  md5sum      Produces an md5sum file for all the objects in the path.
  mkdir       Make the path if it doesn't already exist.
  mount       Mount the remote as file system on a mountpoint.
  move        Move files from source to dest.
  moveto      Move file or directory from source to dest.
  ncdu        Explore a remote with a text based user interface.
  obscure     Obscure password for use in the rclone config file.
  purge       Remove the path and all of its contents.
  rc          Run a command against a running rclone.
  rcat        Copies standard input to file on remote.
  rcd         Run rclone listening to remote control commands only.
  rmdir       Remove the empty directory at path.
  rmdirs      Remove empty directories under the path.
  selfupdate  Update the rclone binary.
  serve       Serve a remote over a protocol.
  settier     Changes storage class/tier of objects in remote.
  sha1sum     Produces an sha1sum file for all the objects in the path.
  size        Prints the total size and number of objects in remote:path.
  sync        Make source and dest identical, modifying destination only.
  test        Run a test command
  touch       Create new file or change file modification time.
  tree        List the contents of the remote in a tree like fashion.
  version     Show the version number.
 
Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services

After you get this result, you can move onto your linux headless machine.

Linux Installation (Headless)

I’ll assume:

  • You SSH into the server
  • You have a browser on another machine
  • This is a personal OneDrive (business is almost identical)

Install rclone on the headless server

curl https://rclone.org/install.sh | sudo bash

Check:

rclone version

Start rclone config (headless-safe)

rclone config

You’ll see:

No remotes found - make a new one
n) New remote

Follow the prompts exactly like this:

n

Name (example):

onedrive

Storage type → choose Microsoft OneDrive
(usually number 41 on linux, but type the number shown)

41

Client ID

<Enter>   (leave blank)

Client Secret

<Enter>   (leave blank)

Region

1   (Microsoft Cloud Global)

Advanced config

n

Auto config (IMPORTANT)

n

This is the important headless part


First Time Authorization (WINDOWS)

On your local machine (with a browser)

Make sure rclone is installed and preferably the same version. We have already done this check during the Windows installation

Run:

rclone authorize "onedrive"

*Note: This has to be "onedrive" and not your remote name as you are verifying onedrive.

A browser window will open.


Log in to Microsoft

  • Sign in to your OneDrive account
  • Accept permissions
  • When done, the terminal will print something like:
{
  "access_token": "eyJ0eXAiOiJKV1Qi...",
  "token_type": "Bearer",
  "refresh_token": "0.AAA...",
  "expiry": "2026-02-04T12:34:56.789Z"
}

⚠️ Copy the entire JSON block
(include { and })


Paste it back into the headless server

Back on the server SSH session:

Enter a value:

Paste the full JSON → press Enter.


4️⃣ Finish config

You’ll then see:

y) Yes this is OK

Type:

y

Verify

rclone lsd onedrive-ondemand:

==Note: Here, you are supposed to use the remote name you gave to your directory==

If folders show up → auth succeeded


Common mistakes (quick save)

  • ❌ Copying only the access token
    ✅ Must paste the entire JSON

  • ❌ Running authorize on a different rclone version
    (usually still works, but best to match)

  • ❌ Using authorize onedrive: (wrong)
    ✅ Correct: rclone authorize "onedrive"


Re-Authorize from another machine (WINDOWS)

This step is ONLY done if you have already authorized your onedrive once already. It will only then paste the link to go to

rclone on your linux machine when you try to edit your remote will print something like:

Please go to the following link:
https://login.microsoftonline.com/...

On your laptop/desktop:

  1. Open that link in a browser
  2. Log in to your Microsoft account
  3. Accept permissions
  4. You’ll be redirected to a blank page with a long URL

📋 Copy the entire URL


Paste the redirect URL back into the server

Back in SSH:

Paste the redirect URL here:

Paste → Enter.


Select the OneDrive account

If you have only one:

1

If multiple drives exist, pick the one you want.


Confirm

y

🎉 OneDrive is now configured.


Test it (important)

rclone lsd onedrive-demand:

You should see folders like:

-1 2024-10-01  Documents
-1 2023-05-12  Music

If you do — you’re done with auth ✅


Mounting

Create a mount point

sudo mkdir -p /mnt/onedrive
sudo chown $USER:$USER /mnt/onedrive

Mount OneDrive (on-demand, streaming-friendly)

rclone mount onedrive: /mnt/onedrive \
  --vfs-cache-mode minimal \
  --vfs-read-chunk-size 16M \
  --vfs-read-chunk-size-limit 128M \
  --dir-cache-time 72h \
  --poll-interval 1m \
  --buffer-size 16M \
  --timeout 1h
  • NOTE: THIS COMMAND IS BEST USED AS A BACKGROUND SERVICE BECAUSE RUNNING THE COMMAND RUNS IN THE FOREGROUND Test:
ls /mnt/onedrive

Open a file → it downloads only when accessed.


If this is a server, you really want this.

Create service file

sudo nano /etc/systemd/system/rclone-onedrive.service

Using rclone to mount your onedrive as your network drive.

  • Make a .service file in /etc/systemd/system/
  • I named it rclone-music.service
[Unit]
Description=Rclone OneDrive Music Mount RClone
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=ubuntu
ExecStart=/usr/bin/rclone mount onedrive-ondemand:"MAIN/Public/Music/Albums" /mnt/music \
  --vfs-cache-mode full \
  --vfs-cache-max-size 5G \
  --vfs-cache-max-age 12h \
  --vfs-read-chunk-size 32M \
  --vfs-read-chunk-size-limit 128M \
  --dir-cache-time 30m \
  --poll-interval 5m \
  --buffer-size 32M \
  --allow-other \
  --timeout 1h \
  --disable-http2 \
  --umask 002
ExecStop=/bin/fusermount -uz /mnt/music
Restart=on-failure

[Install]
WantedBy=multi-user.target

This is ideally the rclone-music.service file.


Enable & start

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable rclone-onedrive
sudo systemctl start rclone-onedrive

Check:

systemctl status rclone-onedrive

Common Guidelines

  • Wrong user → config is per-user
  • Running as root later → root won’t see your config
  • Transcoding apps → force full downloads
  • Wi-Fi + flaky connection → increase --timeout

Headless Guidelines

🔐 Running as root vs user

If you run rclone as root later (cron, systemd):

  • Root has a different config file

  • Either:

    sudo rclone config

    or point explicitly:

    rclone --config /home/user/.config/rclone/rclone.conf

🕒 Long-running mounts

If you plan to mount:

rclone mount gdrive: /mnt/gdrive \
  --daemon \
  --vfs-cache-mode full

For servers, systemd is better than screen or tmux.


🔄 Service accounts (Google Drive, advanced)

If this is for:

  • Servers
  • Automation
  • Multiple users

Service accounts are worth it — slightly more setup, way more stable.


Sanity checklist

  • ✅ Internet access from server
  • ✅ Correct remote name (remote: matters)
  • ✅ Config file permissions
  • ✅ Using same user that configured rclone