Windows Mount as System service

Team, I know this has been asked multiple times but I have not found any concret solution nor answer.

I have pCloud service (I believe issue is not relevant to storage provider) and im using nssm to create service:

nssm stop rclone2
nssm remove rclone2 confirm
nssm install rclone2 c:\rclone\rclone.exe 
nssm set rclone2 AppParameters mount pcloud:/ X: --config rclone.conf --cache-dir .\cache\ --volname pCloud --dir-perms=0777 --file-perms=0777 --vfs-cache-mode full -o --uid=65972  --default-permissions
nssm set rclone2 AppDirectory C:\rclone\
nssm set rclone2 AppStdout C:\rclone\rclone.log
nssm set rclone2 AppStderr C:\rclone\rclone.log
nssm set rclone2 AppStopMethodSkip 6
nssm set rclone2 AppStopMethodConsole 1000
nssm set rclone2 AppThrottle 5000
nssm start rclone2

What works: create/delete/rename file/folder
What does not work: modify/update existing files

Of course all issues are gone if I will mount pCloud as current user and use as current user. If I will switch account to other one drive is no longer visible.

Is there a way to get fully functional drive/netdrive available to all logged users at once?

if you run rclone mount as system user, then all users should see it.

If rclone is mounting as SYSTEM then all users are seeing it, but:

What works: create/delete/rename file/folder
What does not work: modify/update existing files

ok, i re-read your post. looking into it.

--default-permissions - not supported on windows.

I have solved this other way. I believe this has something related to WIndows permissions it self and Im not specialist but I have doubts it can be solved as a service at all.

I in a wider context - I wantned to automate mounting my pCloud system wide for all users but as I said - moutnting it with SYSTEM user have some drawbacks. That is why I have created task in windows scheduler who runs commnad to mount for each user after logon. I have nearly completed all steps to automate it with usage of Ansible including downloaoding rclone itself.

might run one instance of rclone serve webdav and for each user do a map drive.

Why doesn't it work to modify/update existing files? Is that a limitation of rclone or winfsp?

once finished and tested, would be helpful to post it.

I have no idea - this is my second attempt to rclone on windows. I believe that at the first time I have read about some limitations with SYSTEM user but this time I have not found it - just faced it. Maybe its something worng with my solution - I have no idea.

Do You have this setup (system wide mount) working correctly?

rclone.txt (3.3 KB)

This is my solution to deploy rclone on WIndows hosts in unattended way with usage of Ansible.

This file is a playbook and should have yaml extention.

Important thing - Im not experienced Ansible user so this for sure could be done better/safer/easier but it works :slight_smile:

have you considered my idea of running a single instance of rclone serve webdav
windows map drive per user.

in this way, only needing a single vfs file cache for all users.

Im also not experienced rclone user - As soon as I will unserstood what exacly this means I will be able to comment on this :slight_smile:

Yesterday evening I was "mastering" Ansible solution - hopefully today I will test Your proposed solution

rclone serve webav remote:emulates a webdav server
and windows operating system itself can mount a webdav server as local storage.

DEBUG : rclone: Version "v1.57.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "serve" "webdav" "wasabi01:zork" "--vfs-cache-mode=full" "--file-perms=0777" "--dir-cache-time=1m" "--vfs-cache-poll-interval=1m" "--vfs-cache-max-age=1m" "--cache-dir=D:\\rclone\\cache\\zork" "--log-file=.\\log.serve.webdav.zork.txt" "--log-level=DEBUG" "--log-file=.\\log.serve.webdav.zork.txt" "--log-level=DEBUG"]
DEBUG : Creating backend with remote "wasabi01:zork"
DEBUG : Using config file from "c:\\data\\rclone\\scripts\\rclone.conf"
INFO  : S3 bucket zork: poll-interval is not supported by this remote
DEBUG : vfs cache: root is "D:\\rclone\\cache\\zork"
DEBUG : vfs cache: data root is "\\\\?\\D:\\rclone\\cache\\zork\\vfs\\wasabi01\\zork"
DEBUG : vfs cache: metadata root is "\\\\?\\D:\\rclone\\cache\\zork\\vfsMeta\\wasabi01\\zork"
DEBUG : Creating backend with remote "D:/rclone/cache/zork/vfs/wasabi01/zork"
DEBUG : fs cache: renaming cache item "D:/rclone/cache/zork/vfs/wasabi01/zork" to be canonical "//?/D:/rclone/cache/zork/vfs/wasabi01/zork"
DEBUG : Creating backend with remote "D:/rclone/cache/zork/vfsMeta/wasabi01/zork"
DEBUG : fs cache: renaming cache item "D:/rclone/cache/zork/vfsMeta/wasabi01/zork" to be canonical "//?/D:/rclone/cache/zork/vfsMeta/wasabi01/zork"
INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
NOTICE: S3 bucket zork: WebDav Server started on http://localhost:8080/
rclone ls wasabi01:zork
       28 file.txt

net use z: \\localhost@8080\davwwwroot
The command completed successfully.

dir z:
 Volume in drive Z has no label.
 Volume Serial Number is 0000-0000

 Directory of Z:\

01/27/2022  02:08 PM    <DIR>          .
01/27/2022  02:08 PM    <DIR>          ..
01/27/2022  02:09 PM                28 file.txt
               1 File(s)             28 bytes
               2 Dir(s)  57,925,574,656 bytes free

Tested Your solution.

  1. Permissions works fine when using SYSTEM user for system wide mounting
  2. Despite using cache and --vfs-cache-mode full I cannot watch movies which are approx >50MB (?)

This will be sligthly off topic but I have noticed

2022/01/27 21:08:55 INFO  : vfs cache: cleaned: objects 79 (was 79) in use 0, to upload 0, uploading 0, total size 191.197Mi (was 191.197Mi)

and with usage of

"--log-file=.\\log.serve.webdav.zork.txt" "--log-level=DEBUG"

It should be quite easy to write some sort of monitoring tool to read last log line with "INFO" and parse it and display red/green icon in toolbar. This should be easy with .NET ( again - Im not a programer but I wrote some small tool in this ages ago and maybe I will try to it again)

and if we could tune frequency of this update would be splendid and would answer my other question on this forum -> How do I know when file trasfers are completed - #2 by asdffdsa

yes, that i what i expected, and nice to need only one rclone cache for all users.

cannot see into your computer screen.
need to see a full rclone debug log, or at a minimum, the top 30 lines.
and you need to look into the debug log for errors and messages pertaining to the exact file that failed to play.

yes, off topic,

i think i answered your other question in that other topic.
if not, then best to post there.

failed.txt (64.0 KB)
working.txt (659.0 KB)

I have run mounting twice to separate runs of failed and working playback

nothing to do with rclone.

  1. edit registry entry

from default value of 50000000 which is 50MB
up to the largest value for a 32-bit integer 2147483647

  1. restart webdav service.

It did the trick but some other limitation occured :slight_smile: When I play 1.5GB file it downloads it fully first (maybe its the way Windows Webclient works?). I have changed --vfs-cache-mode=writes but it didnt changed behaviour.

Thank You for Your time and support :slight_smile: Maybe I will spent some time still today to check if mentioned offtopic is in my range.