olNGIb4NkK5r2x7x4oG3GpEzizVpnY6KNCck9cym

Mount Team Drive using rclone as a service on Windows

Mount Team Drive using rclone as a service on Windows

This tutorial will show you how to mount Google Team Drive or Google Shared drives using rclone running as a service on Windows.

As you may know that you can run rclone as a daemon on Linux, which means that rclone is running in the background. But that feature is not available on Windows, so we need to use third-party software call nssm to make rclone running in the background as a service.

With rclone running as a service, rclone will run when Windows run this means you don't need to run rclone manually every time you restart Windows.

Prerequisites

  • Windows 8 to 10, Windows Server 2012 R2 to 2019
  • Rclone
  • Nssm
  • Winfsp

Configure rclone

  1. Download rclone for windows from the following link https://rclone.org/downloads/
    If your system is 64-bit download rclone 64-bit else download the 32-bit and extract it to C:\rclone

  2. Open a command prompt or cmd (press win+r and type cmd) and run rclone config

    cd C:\rclone
    rclone config
    rclone config
  3. Type n to create a new configuration and type whatever name for remote name, for example teamdrive

  4. For the type of storage to configure, type 15 for Google Drive (rclone v1.54.0) the number may differ on another rclone version

    rclone google drive
  5. Press enter for client_id>, client_secret>, scope> and service_account_file>

    rclone config steps
  6. Type n for Edit advanced config? (y/n) and type y for Use auto config?, a new browser window will open, login using your google account

    rclone auto config google drive
    rclone login google drive
  7. Back to the command prompt and type y for Configure this as a team drive? and choose your team drive by typing the number

    rclone team drive
  8. Type q to exit rclone configuration

    You can verify the rclone configuration file is created by going to "C:\Users\<YOUR USERNAME>\.config\rclone", there should be a file named rclone.conf

Configure NSSM to install rclone as a services

  1. Download and install Winfsp from this link https://github.com/billziss-gh/winfsp/releases/latest

  2. Download NSSM from this link https://nssm.cc/download and extract to C:\nssm

  3. Open cmd as Administrator and open NSSM service installer GUI by typing the following command

    cd C:\nssm\win64
    nssm install rclone-teamdrive
    Open nssm service installer

    You can change rclone-teamdrive to whatever service name you like.
    Note: change the nssm folder to C:\nssm\win32 if you using windows 32-bit

  4. On NSSM service installer GUI window use the following setting and click Install service

    Path: C:\rclone\rclone.exe
    Startup directory: C:\rclone
    Arguments: mount teamdrive: X: --vfs-cache-mode full --config "C:\Users\<YOUR USERNAME>\.config\rclone\rclone.conf"
    nssm install rclone as services

    teamdrive: is rclone remote configuration name
    X: is the drive letter where team drive will be mount, you can change to another drive letter

    nssm install rclone successfully
  5. Run rclone service by typing the following command

    nssm start rclone-teamdrive
    nssm start rclone as services

    Or your can start manually by Opening Services window by typing services.msc on run (win+r), locate and click rclone-teamdrive and then click start to run rclone mount as a services

    rclone in services
  6. Verify the mount by opening windows explorer and check for drive X:

    rclone mount in windows

Additional NSSM command

  • Editing rclone service

    nssm edit rclone-teamdrive
  • Deleting rclone service

    nssm remove rclone-teamdrive

    After that restart your windows

  • For another nssm command, you can type

    nssm help

Useful links

Rclone Documentation : https://rclone.org/docs/
Winfsp Documentation : https://github.com/billziss-gh/winfsp
NSSM Documentation : https://nssm.cc/usage

Related Posts

Post a Comment