POSTS / Mount Alist on Windows 11 with Rclone
AList is a file list/WebDAV program that supports multiple storages.
Here’s an example chirmyram, which is a repo for sharing resources drived by alist.
Install Rclone and WinFsp
With help of Scoop, we can easily install most tools without burden of setting PATH.
$ scoop search rclone
Results from local buckets...
Name Version Source Binaries
---- ------- ------ --------
rclone 1.68.2 main
rclone-browser 1.8.0 extras
$ scoop search winfsp
Results from other known buckets...
(add them using 'scoop bucket add <bucket name>')
Name Source
---- ------
winfsp-np nonportable
Setup Remote in Rclone
$ rclone config
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
Enter name for new remote.
name> chirmyram
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
...
54 / Uptobox
(uptobox)
55 / WebDAV
(webdav)
56 / Yandex Disk
(yandex)
57 / Zoho
(zoho)
...
Storage> 55
Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a value.
url> https://al.chirmyram.com/dav/
...
6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
(rclone)
7 / Other site/service or software
(other)
vendor> 7
Option user.
User name.
In case NTLM authentication is used, the username should be in the format 'DomainUser'.
Enter a value. Press Enter to leave empty.
user> alist
Option pass.
Password.
Choose an alternative below. Press Enter for the default (n).
y) Yes, type in my own password
g) Generate random password
n) No, leave this optional password blank (default)
y/g/n> y
Enter the password:
password:
Confirm the password:
password:
Option bearer_token.
Bearer token instead of user/pass (e.g. a Macaroon).
Enter a value. Press Enter to leave empty.
bearer_token>
Edit advanced config?
y) Yes
n) No (default)
y/n>
Configuration complete.
Options:
- type: webdav
- url: https://al.chirmyram.com/dav/
- vendor: other
- user: alist
- pass: *** ENCRYPTED ***
Keep this "chirmyram" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
Current remotes:
Name Type
==== ====
chirmyram webdav
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
Mount Remote WebDAV to Windows 11
rclone mount chirmyram:/ Z: --cache-dir <Path to Cache Dir> --vfs-cache-mode writes
Note that the rclone mount
command actually starts a process that never stops, which stalls current terminal.
We want it to run more quietly and be able to start automatically.
Make it a Startup Task
As directly run rclone
will start a process running the mount service, we could use Start-Process
to make it not stall current shell.
Start-Process -NoNewWindow -FilePath "$env:USERPROFILEscoopshims\rclone.EXE" -ArgumentList "mount chirmyram:/ Z: --cache-dir `"$env:USERPROFILEDocumentsAListCache`" --vfs-cache-mode writes"
Write that script into a PS1 file then use schtasks
to create a scheduled task.
sudo schtasks /create /tn "RcloneMount" /tr "powershell -WindowStyle Hidden -File %USERPROFILE%DocumentsScripts\rclone_mount.ps1" /sc onlogon
To test the task, use Win+R
then run taskschd.msc
. Find the task just added and test it with right click option.
(Unfortunately, the task still start a terminal window and will be killed if window is closed.)
So we turn to nssm for a more comfortable experience.
$ scoop search nssm
Results from local buckets...
Name Version Source Binaries
---- ------- ------ --------
nssm 2.24-103 main
Then run nssm
GUI to add the script as a service.
$ sudo nssm install RcloneMount
Fill the form like this:
Path: <Absolute Path to Rclone>
Startup directory:
Arguments: mount chirmyram:/ Z: --cache-dir <Absolute Path to Cache> --vfs-cache-mode writes
Click Install service
to finish install that service then start it.
$ sudo nssm start RcloneMount
Finally we find a way without creating a script to run rclone mount
. ✌