[SOLVED] Add tailscale to startup of Linux VM

Hello all!

I’ve been playing with Tailscale and got it working perfectly, I mentioned it HERE.

I just wonder though, can I set it to start up automatically when the VM (in TrueNAS Core) is started up?

At the moment I have to do sudo tailscale up and then type in my VM password.



P.S. I also accidentally deleted a startup item, anyone know what it might have been and if it was important? Tailscale still works fine and dandy.

[edit] just checked the github, and there is a TailScale service installed as part of the installation.

Maybe check to see why the service does not auto start?

			$SUDO apt-get update
			$SUDO apt-get install -y tailscale
			if [ "$APT_SYSTEMCTL_START" = "true" ]; then
				$SUDO systemctl enable --now tailscaled
				$SUDO systemctl start tailscaled


Easiest is probably a SystemD unit file, like what was posted here:

Run command at startup, Fedora 25 - #4 by Dje4321

I know PLL recently messed about with SystemD in a thread, but not sure if he made any units in the thread that run after system starts.


Nevermind, see edit above Th thread goes on the suggest making a script to run the app, so you can change the script separate to changing the unit file/service/SystemD app.

Also, the “After=multi-user “ might need to change for a headless machine, but you can play around with it

Thank you Troop :+1: I’m going to give this a go shortly. Really appreciated as always :clap:

You are brilliant at these things as always, we have success!!! Thank you very much Troop! :+1: :+1:

Only two observations/questions:

Is this the normal way to make something autostart? I mean do you have to do it with other things, say if you wanted to use Steam, would you have to do the same or is that a bit more cleverer with Linux?

Also, are there always loads of updates for Linux (Ubuntu)? I only did the update a few days ago and there were 31 new ones!

1 Like

Not exactly…

Apps that run in the GUI, often have a settings page with a “start on boot” option, like steam has.

I’m surprised TailScale doesn’t have a checkbox to enable auto starting.

But creating a SystemD unit is very common for CLI apps, or scripts that people have made to do their own thing, or change setting to just how they like them.
I was surprised TailScale didn’t auto start as it does use SystemD.

There can be a Lot, and you can often click “view details” or such to see the list.
But often times, it will be the same libraries again and again, with small changes.

I don’t think I really paid much attention to which ones are Actually needed to fix security issues, and which are just minor improvements.

There is a package like “unattended-upgrades” that will just install updates in the background, suggesting a reboot every month or so, which might help smooth the experience? Rebooting occasionally is a good thing for applying patches, but is not needed as often as windows. And if you wanna sign the VM up with Ubuntu, you can get livepatching on a couple systems for free, so even fewer reboots needed.


Thank you for all of this Troop, really appreciate you taking the time to explain.

Isn’t that just my luck, to find an app/function that doesn’t make it easy to do the basics!

Thank you for that. Am I right in thinking the Linux community is more active with updates/improvements than Windows or Apple?

Thank you for that tip on auto updates, very much appreciated yet again :+1:

The Linux community sure is more active, but also less organised.

Windows (and Apple and android) have large teams working on fewer, common tools, and they wrap updates together in bundles patches.

Linux is a diverse collection of corporations and small single person developers, working on small apps.
So as a dev patches one thing, he upstreams the changes himself.

IIRC, Ubuntu then gather the updates and run them through testing systems, before letting them loose, but that might only be their own updates. Not sure.

But bigger teams do release less often

1 Like

Blimey, well I didn’t know that.

Quite impressive to think that both large and small entities are working on the same project, I must give Linux more of a look for any minor PC’s. I have to say the VM’s are really reliable so far…though that’s only based on 1 week’s on and off use.

Hey @ChrisA, I came across two videos about Tailscale and how to set it up with Pfsense (A open source Firewall that also does routing). Lawrence Systems create the first video, and the second video is by the person making the Tailsscale package for Pfsense. I thought they were exciting. What do you think?
[How to Setup The Tailscale VPN and Routing on pfsense - YouTube]

1 Like

Hi @Shadowbane , thank you very much for that. I have tinkered with PFSense and it’s pretty cool. I’m very amateur with networking so I bought a Unifi firewall instead (the cheap one), knowing that I might end up finding it too limiting.

Now I’ve used Tailscale (and made it actually work!) I’m really happy to hear it integrates with PFSense, well done them!

Hey @ChrisA, I purchased a Netgate appliance, the Netgate 5100, because an Unifi firewall is so limiting, but I bought one of their wave2 L2 switches. I bought one of their access points, but I haven’t set it up yet; I am in the middle of redesigning the Network rack and plan to add a new frame; I have run out of space on my current one. So I will keep the one I have and add a new one. This time the new one will be a lot bigger. Don’t worry; I know you like to read about other people’s network projects; I will set up a separate post and log my journey with pictures, of course.

1 Like

Hi @Shadowbane , wow, you must have some decent speed with a Netgate unit like that. I’ve got Unifi AP’s and the protect thing as well, that works with Unifi camera. Does the job for me, but I know that the firewall thing is not going to do some things for me, but we’ll see!

I’d be very interested to see your progress with your new network setup, do keep me posted! Good luck :+1:

1 Like

@ChrisA An unexpected bonus I received when I purchased my Netgate appliance is it runs Pfsense +, not the Community Edition. Right now, there isn’t any difference, but Netgate could decide to split some features for Pfsense + and leave them from the Community Edition. The only thing I regret is I didn’t spend $500 more and get a rack mount model, but at the time, I couldn’t stretch my budget, not when you consider all the other equipment I purchased.

@Shadowbane I’m very interested in seeing how your setup looks like, sounds like you’ve invested a lot of time and effort. I think you can be forgiven for saving $500 for what I guess is a bit more convenience and aesthetics?!