Mount OneDrive as a drive in Windows with Rclone.
Rclone allows us to mount cloud storage in our system, either as a drive or in a folder. This way we can access the cloud storage like a network drive, without the official client and without synchronisation. Rclone is available for different operating systems, so for example OneDrive can be used in Linux.
In this article, we will look at how we can use Rclone on Windows as well.
Video description
Download Rclone
Let’s start with the download. The Windows version comes as a ZIP archive, which we simply have to unpack. In the folder we then find the “rclone.exe”.
Configuring cloud storage in Rclone
We type “cmd” in the Explorer address bar. This opens a command prompt, using “rclone.exe” we start Rclone. A text menu appears. Here we select “n” for “New remote”.
In the first step we enter a name, e.g. “onedrive”. We will need this name later for access and integration into the system.
A long list of supported cloud storages follows. In principle, we can access all cloud storages with rank and name, also Google Drive, Seafile, HiDrive and other cloud services are supported. The basic procedure is the same.
We enter “31”, for “Microsoft OneDrive”.
This is followed by a query for the “client_id” and the “client_secret”. Good for us, we don’t have to enter anything here and confirm both with Enter.
We are then asked where our data is clouded. Here, we simply enter “1” for the region.
Fortunately, we can also simply answer the query for the advanced configuration with “n”, i.e. No. Then the authentication takes place, here we confirm with “Yes”. This opens a browser window. Here we may have to log in to OneDrive to authorise Rclone access.
Once this is done, we enter a “1” for “OneDrive Personal or Business” in “config_type”.
Rclone now suggests the “drives” it has found. Only one entry should appear here, which we confirm with “1”.
Two more confirmations follow, which we confirm twice with “Yes”.
Done! The configuration is now created and appears under “Current remotes” when “rclone.exe” is started.
Integrating OneDrive into Windows with Rclone
The configuration is now created, for access we now need to mount OneDrive. This can be done with one of the following commands:
rclone --vfs-cache-mode writes mount onedrive: * rclone --vfs-cache-mode writes mount onedrive: X:
The first variant mounts the cloud storage under a free drive letter. The second variant under the default. In this case, “onedrive” is the name we assigned in the configuration.
OneDrive is then available in the new drive. With CTRL-C we can cancel the command in the command prompt, the drive is then disconnected.
It is best to put the command in a batch file so that the long command does not have to be entered each time.
Mount OneDrive in folder
Besides mounting it as a drive, we can also specify a folder:
rclone --vfs-cache-mode writes mount onedrive: C:\_temp\
In this case, OneDrive is mounted below the specified folder.
Conclusion
As we have seen, Rclone is a perfect way to integrate cloud storage into the system. In principle, we don’t need a client. Local storage is also not used, as no files are synchronised locally. Of course, this only works if we also have internet.
The method also works with other cloud systems, only the configuration steps differ slightly.
Thanks, very useful tutorial. Just a few comments:
– you did not mention that WinFsp needs to be installed first
– for an inexperienced user (like myself 😉 it would be helpful to explain what you need to do with the Cmd window after the message “The service rclone has been started”. Should you just close the window, or will this end the rclone service?
– if you put the mount command in a batchfile, shouldn’t you put the full path to rclone in the command?
Thanks for your feedback. You are right about the things you mentioned. For the WinFsp thing, I had this already installed somehow and did not know that this was also required. Will do better! 🙂
useful information, the problem is i am not able to make it run in the background with a bat file to start the gui and mount the drive at system startup.
I have tried different techniques like using nssm or powershell script, but the mount is not working while using these. It works fine when i run my batch file directly, the only problem i see annoying command prompt. can you create a tutorial to show how i can setup auto start the gui and auto mount onedrive when system reboot, all done in background ?
Also would appreciate if you can do a tutorial on using this rclone to mount onedrive and use it with portainer and nextcloud. Thanks!
Hi, Tanks for the video!
I have one problem trying to mount:
‘cannot find winfsp’:
—————————————
C:\Users\berts\Downloads\rclone-v1.64.0-windows-amd64\rclone-v1.64.0-windows-amd64>rclone –vfs-cache-mode writes mount onedrive: *
2023/09/17 11:27:52 NOTICE: Assigning drive letter “Y:”
2023/09/17 11:27:52 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed: cgofuse: cannot find winfsp
———————————————–
So what’s missing?
I found my answer:
You need to install WinFSp.
You can download and install:
https://winfsp.dev/rel/