Press "Enter" to skip to content

Roon: remote access, auto-start without login with mounted samba share on Windows

The main limitation that always bothered me about Roon is how it is bounded to be used only inside your local LAN network. But what if I want to listen to my music everywhere I am? And why Roon Server runs as a user process and not as a service? What happens if my server needs a reboot and I’m not at home (so I cannot login to my user)?

In this article I’m going to illustrate how I solved all these kind of problem with my setup. My Roon Server does not run on a computer in my home because my network upload bandwidth is pretty poor, so I decided to install it on a Server in a datacenter to have a full gigabit speed wherever I am.

I’ll divide everything in 3 sections that are totally independent so that if you don’t need certain feature (ex. you don’t need to mount a samba share) you can just skip to the next sections.

Remote Access

To get remote access to your Roon Server we have to make it believe that all the client connected are in the same LAN. To achieve that, the most straightforward way is to use ZeroTier.

Create an account here https://www.zerotier.com/ , login, create a network with whatever name (ex roon_network) and copy the network id, we will need it later.

ZeroTier network

Now download the ZeroTier client and install it on the computer where you have Roon Server installed. Start it and the ZeroTier icon will appear on the taskbar, right-click on the icon and click “Join Network…”, type the network id and click “Join”. Then in your ZeroTier account, click on your network name to open the details and under the tab “Members” you will see all the ZT installation, to authorize them just tick the flag “Auth?”. Repeat this for every client that you will use to connect to your Roon server (Android is supported, too).

Mount samba share at boot without user login

This step is needed if all your music files are on a samba share and you want to start Roon as a service without having to login with your user.

If you samba share is connected, disconnect it.

Download SysinternalsSuite from Microsoft Website: https://docs.microsoft.com/it-it/sysinternals/downloads/sysinternals-suite

Extract the content of the archive in C:\SysinternalsSuite. Run cmd.exe as an Administrator and type:

cd C:\SysinternalsSuite
psexec -i -s cmd.exe
net use z: \\ip_of_shared_folder\share_name /user:share_user share_password /persistent:yes

This command will mount the folder with share name share_name and ip address ip_of_shared_folder on Z: with user share_user and password share_password.
On file explorer the drive will be mounted as disconnected, but it is not! You can open it and read/write to it.

Mounted share

Now copy the last command and paste it in a new file under C:\BootScripts\MountSambaShare.bat (or call it how you want).

With Task Scheduler

Open the Task Scheduler, click on “Create Task” and compile it like this:

  • General Tab -> Name: MountSambaShare
  • General Tab -> Change User or Group… -> Type “SYSTEM” -> Check Names -> Ok
  • General Tab -> Run whether user is logged on or not
  • Triggers Tab -> New … -> Begin the task: At startup -> Tick “Enabled” -> Ok
  • Actions Tab -> New … -> Browse… -> Select C:\BootScripts\MountSambaShare.bat -> Ok
  • Ok and close.

As a Windows service

If you don’t want to use the Task Scheduler but you prefer to create a service follow these instructions:

  • Download nssm from here: http://nssm.cc/
  • Create a folder named “nssm” under C:\Program Files\
  • Open the downloaded zip and copy nssm.exe under the folder you’ve just created.
  • Open a cmd (or Powershell) terminal with elevated rights. Navigate to the nssm folder “cd ‘C:\Program Files\nssm'” and start it “.\nssm.exe install

Now we are ready to create the service, compile as following:

  • Application Tab -> Path: select the bat files previously created
  • Details Tab -> Display Name: Samba Share Mount (or whatever)
  • Details Tab -> Startup type: Automatic
  • Service Name: Samba Share Mount (or whatever)
  • Install.

From now on the samba share will be mounted at startup even if you don’t login to your user.

Start Roon Server at boot without user login

This is the best possible way to start Roon before login. I know that you can setup an auto-login but you’ll need to write in clear your username and your password in the Registry which is a huge security problem and it’s not recommended in any way. Don’t do it.

First of all disable the auto start of Roon at login if you have it enabled (righ-click on Roon taskbar icon -> Launch at startup).

Right click on Roon desktop icon, click on “Properties”. Copy somewhere “Target:” and “Start In:” strings, we will need them later.

With Task Scheduler

Open the Task Scheduler, click on “Create Task” and compile it like this:

  • General Tab -> Name: RoonStart
  • General Tab -> Change User or Group… -> Type “SYSTEM” -> Check Names -> Ok
  • General Tab -> Run whether user is logged on or not
  • Triggers Tab -> New … -> Begin the task: At startup -> [Optional] Delay task for: 30 seconds ->Tick “Enabled” -> Ok
  • Actions Tab -> New … -> Program/Script: paste the “Target” string copied before. -> Start in: paste the “Start in” string copied before -> Ok
  • Ok and close.

As a Windows service

If you don’t want to use the Task Scheduler but you prefer to create a service follow these instructions:

  • Download nssm from here: http://nssm.cc/
  • Create a folder named “nssm” under C:\Program Files\
  • Open the downloaded zip and copy nssm.exe under the folder you’ve just created.
  • Open a cmd (or Powershell) terminal with elevated rights. Navigate to the nssm folder “cd ‘C:\Program Files\nssm'” and start it “.\nssm.exe install

Now we are ready to create the service, compile as following:

  • Application Tab -> Path: paste the “Target” string copied before
  • Application Tab -> Startup directory: paste the “Start in” string copied before
  • Details Tab -> Display Name: Roon Server (or whatever)
  • Details Tab -> Startup type: Automatic(delayed)
  • Service Name: Roon Server (or whatever)
  • Install.

Now you can reboot and verify from the Task Manager that Roon is started with user “SYSTEM”:

Be First to Comment

Rispondi

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

%d blogger hanno fatto clic su Mi Piace per questo: