Help starting Rclone mount as Windows Service

What is the problem you are having with rclone?

I want to run Rclone mount at system startup. Only one user on the system. When running New-Service from the docs I get the following error New-Service: A positional parameter cannot be found that accepts argument 'mount'.

Run the command 'rclone version' and share the full output of the command.

rclone v1.68.1

  • os/version: Microsoft Windows 11 Pro 23H2 (64 bit)
  • os/kernel: 10.0.22631.4249 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.23.1
  • go/linking: static
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

AWS S3

The command you were trying to run (eg rclone copy /tmp remote:tmp)

New-Service -Name Rclone -BinaryPathName "C:\Users\USERNAME\AppData\Local\Microsoft\WinGet\Packages\Rclone.Rclone_Microsoft.Winget.Source_8wekyb3d8bbwe\rclone-v1.68.1-windows-amd64\rclone.exe mount s3:BUCKET S: --network-mode --vfs-cache-mode full"

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[s3]
type = s3
provider = AWS
access_key_id = XXX
secret_access_key = XXX
region = il-central-1
location_constraint = il-central-1

[test]
type = s3
provider = AWS
env_auth = true

welcome to the forum,

well, in the example, the fullpath of the config file is specified, the fullpath of the log file is specifed.

  • make sure the command works on the command line.
  • use a debug log, --log-level=DEBUG

The command itself works as expected. I just can't set it up as a Windows Service due to the error above.

When the command is run directly from the terminal with the debug level you asked for this is the output:

2024/10/06 01:12:31 DEBUG : :local: detected overridden config - adding "{fbZPM}" suffix to name
2024/10/06 01:12:31 DEBUG : fs cache: renaming cache item ":local,encoding='Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot':C:/Users/USERNAME/AppData/Local/rclone/vfsMeta/s3/BUCKET" to be canonical ":local{fbZPM}://?/C:/Users/USERNAME/AppData/Local/rclone/vfsMeta/s3/audiobook-dedup2"
2024/10/06 01:12:31 DEBUG : Network mode mounting is enabled
2024/10/06 01:12:31 DEBUG : Mounting on "S:" ("\\server\\s3 BUCKET")
2024/10/06 01:12:31 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/10/06 01:12:31 DEBUG : S3 buckeBUCKET: Mounting with options: ["-o" "attr_timeout=1" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "--VolumePrefix=\\server\\s3 BUCKET"]
2024/10/06 01:12:31 DEBUG : S3 bucket BUCKET: Init: 
2024/10/06 01:12:31 DEBUG : S3 bucket BUCKET: >Init: 
2024/10/06 01:12:31 DEBUG : /: Statfs: 
2024/10/06 01:12:31 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Readlink: 
2024/10/06 01:12:31 DEBUG : /: >Readlink: linkPath="", errc=-40
2024/10/06 01:12:31 DEBUG : /: Getxattr: name="non-existant-a11ec902d22f4ec49003af15282d3b00"
2024/10/06 01:12:31 DEBUG : /: >Getxattr: errc=-40, value=""
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
The service rclone has been started.
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Statfs: 
2024/10/06 01:12:31 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /Desktop.ini: >Getattr: errc=-2
2024/10/06 01:12:31 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /Desktop.ini: >Getattr: errc=-2
2024/10/06 01:12:31 DEBUG : /AutoRun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /AutoRun.inf: >Getattr: errc=-2
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /Desktop.ini: >Getattr: errc=-2
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /Desktop.ini: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /Desktop.ini: >Getattr: errc=-2
2024/10/06 01:12:31 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:31 DEBUG : /: Opendir: 
2024/10/06 01:12:31 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:31 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:31 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:31 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:31 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:31 DEBUG : /AutoRun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:31 DEBUG : /AutoRun.inf: >Getattr: errc=-2
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Opendir: 
2024/10/06 01:12:32 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:32 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:32 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:32 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:32 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Opendir: 
2024/10/06 01:12:32 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:32 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:32 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:32 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:32 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Opendir: 
2024/10/06 01:12:32 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:32 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:32 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:32 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:32 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Opendir: 
2024/10/06 01:12:32 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:32 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:32 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:32 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:32 DEBUG : /: >Releasedir: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2024/10/06 01:12:32 DEBUG : /: >Getattr: errc=0
2024/10/06 01:12:32 DEBUG : /: Opendir: 
2024/10/06 01:12:32 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2024/10/06 01:12:32 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2024/10/06 01:12:32 DEBUG : /: >Opendir: errc=0, fh=0x0
2024/10/06 01:12:32 DEBUG : /: Releasedir: fh=0x0
2024/10/06 01:12:32 DEBUG : /: >Releasedir: errc=0

worked for me

New-Service -Name Rclone -BinaryPathName 'c:\data\rclone\rclone.exe mount wasabi01:zork S: --network-mode --vfs-cache-mode=full -vv'

status   Name               DisplayName                           
------   ----               -----------                           
Stopped  Rclone             Rclone
sc start rclone

SERVICE_NAME: rclone
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
        PID                : 25076
        FLAGS              :
dir s: /b
org
xyz
1 Like

This one is a classic :slight_smile:

I should have used an Admin session instead of gsudo.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.