Putting Tailscale on the Steam Deck(tailscale.com)
tailscale.com
Putting Tailscale on the Steam Deck
https://tailscale.com/blog/steam-deck/
11 comments
Probably because Tailscale needs to manipulate networking hence needs root, so user units won't work easily.
systemd user-scoped services are great for other software though, especially running syncthing to sync game saves between the Steam Deck and a PC
Also great for running an SSH Agent, since they aren't coupled to some magic invocation in some bashrc but will always be started when the user session starts and cleanly terminated when you log out (or linger if you set that up)
Holy shit, that is an incredible idea!
Here's a sample:
https://git.sr.ht/~whynothugo/dotfiles/tree/c0bf9296c6ca8661...
Note that the ordering is important so that `SSH_AUTH_SOCK` is passed down to other services.
https://git.sr.ht/~whynothugo/dotfiles/tree/c0bf9296c6ca8661...
Note that the ordering is important so that `SSH_AUTH_SOCK` is passed down to other services.
You can order them using user targets.
Ie, create a ssh-agent.target and have the default target depend on it.
Now your ssh-agent is guaranteed to be online when the default target comes up.
Ie, create a ssh-agent.target and have the default target depend on it.
Now your ssh-agent is guaranteed to be online when the default target comes up.
His method already does that. Creating a target for a single service is very much overkill. Though creating a target like setup or pre-default and putting in there might be a fine idea if you have other services you want to run that way.
But, since the unit is already setting a fixed path for the agent, I would just put that path in my .profile and call it a day. Having systems do environment variable injection seems too fragile to me, especially for static variables.
But, since the unit is already setting a fixed path for the agent, I would just put that path in my .profile and call it a day. Having systems do environment variable injection seems too fragile to me, especially for static variables.
I mostly do the injection to keep EVERYTHING related to the agent in a single file.
But yeah, `environment.d` or `.profile` would be simpler. I mostly opted to keep everything in one place.
But yeah, `environment.d` or `.profile` would be simpler. I mostly opted to keep everything in one place.
This isn’t entirely accurate, Tailscale works just fine in userspace networking mode[0]. It’s a bit of a faff to setup, but it works.
[0] https://tailscale.com/kb/1112/userspace-networking/
[0] https://tailscale.com/kb/1112/userspace-networking/
The main disadvantage about userspace networking in this case in particular is that SMB mounting in the kernel can't use it.
Tun devices need root.
Xe is a treasure. This whole piece is a treasure. I will never read timer job without thinking "spicy cronjob" ever again.
Anybody rig up anything weird on their deck yet?
Anybody rig up anything weird on their deck yet?
Xe here! Fun fact: the original draft of that article went on a slight diatribe on what "spicy" means in that context. I think it was something like this:
> When I add something to my daily notes, if it's most directly related to another thing then I will try to describe it as a "spicy" or "diet" version of that other thing. "Spicy" means that there were things added and "diet" means things were removed. A systemd timer is a spicy cronjob because you can do a lot more with it than cron can on its own. An OpenRC service is a diet systemd service because you can do a lot more with systemd than with OpenRC. Think about how to describe things you don't really understand like this in your notes. It will help you a lot.
> When I add something to my daily notes, if it's most directly related to another thing then I will try to describe it as a "spicy" or "diet" version of that other thing. "Spicy" means that there were things added and "diet" means things were removed. A systemd timer is a spicy cronjob because you can do a lot more with it than cron can on its own. An OpenRC service is a diet systemd service because you can do a lot more with systemd than with OpenRC. Think about how to describe things you don't really understand like this in your notes. It will help you a lot.
For some reason "spicy" also makes me think more opinionated? I like it. (There's also probably a place for "boneless skinless" in the arsenal somewhere)
There are quite a few gems in the Tailscale blog. I've come back to their posts about NAT traversal (https://tailscale.com/blog/how-nat-traversal-works/) and how Tailscale works (https://tailscale.com/blog/how-tailscale-works/) a few times, not necessarily for the technical content but for how well they're written.
> Xe is a treasure
Its pretty crazy how frequently her personal blogs and company articles come up when I'm looking for answers the past several months. Sure, most of what I'm looking for is Nix related, but shes written (and recorded) a ton of useful material. Its saved me so much time / frustration. Thanks Xe!
Its pretty crazy how frequently her personal blogs and company articles come up when I'm looking for answers the past several months. Sure, most of what I'm looking for is Nix related, but shes written (and recorded) a ton of useful material. Its saved me so much time / frustration. Thanks Xe!
You're welcome! I wish I could do more of this as my dayjob, but that's just not in the cards for now. Most of what I do now as devrel is things focused on Tailscale and doing the production work (writing, making slides, filming, compositing, editing and publishing) for whatever conference talks I get accepted to.
This article jumps through so many weird hoops to avoid reinstalling Tailscale on (relatively rare) system OS updates and while I appreciate the author's creativity and dedication to user experience - just write a script. Your actual _settings_ / config / user data doesn't get overwritten, it's just the stuff in /usr so reinstalling means everything is exactly back to where it was before
Every system update (which again, is rare, Steam Client updates are much more common and don't change the OS), I SSH in and run `sudo ./reinstall-software.sh`.
Example script:
https://gist.github.com/anaisbetts/194def8511823c2290dbb9ecf...
Every system update (which again, is rare, Steam Client updates are much more common and don't change the OS), I SSH in and run `sudo ./reinstall-software.sh`.
Example script:
https://gist.github.com/anaisbetts/194def8511823c2290dbb9ecf...
I think the last point gives away the reason. He wants to make it a packaged thing that users can install with very little knowledge. The blog post is more as an insight into a dev process than it is a 'howto' for others - although obviously it's that as well!
Bingo! This post was originally intended as an "engineering log" to work you through my thought process as I attacked putting Tailscale on the thing. It was also an exercise in trying to document how to think laterally and abuse second and third order properties of immutable operating systems to get them to do what you want.
Also as an aside, please use they or she to refer to me. I try to not be intrusive about it, but you are making a factual error by referring to me as "he".
Also as an aside, please use they or she to refer to me. I try to not be intrusive about it, but you are making a factual error by referring to me as "he".
Eurgh, that's embarrassing. Also annoying that I can't now edit the comment.
Thank you for correcting me, this is not a problem you should have to deal with.
Thank you for correcting me, this is not a problem you should have to deal with.
You're welcome. I've unfortunately gotten used to it. With this kind of thing you either be polite and accept things with grace or you become a bitter sad person. It is really hard to stop myself from becoming bitter about all of this. I wish reality was better and that I didn't have to be literally an expert in so many things to be taken seriously.
Is there a way to put your pronouns on your Blog username or near the beginning? It would make things easier for anyone who doesn't know you.
Far too often tech people (myself included) make the false assumption that most everyone in this space identifies as He/Him.
Far too often tech people (myself included) make the false assumption that most everyone in this space identifies as He/Him.
I can look into that, but it may be a good idea to just stop assuming that tech is full of dudes. I'd need to think about how to do it without being an asshole about it, which is kind of hard. I may just make it show up only when hacker news is the referer.
Very cool, I know it looked like an aside but it really was cool to see all of that information in the blog post!
I've had my deck since launch and have gone through several OS updates, it's not super common but I wouldn't call it relatively rare.
The only reason I noticed every update is because it kept wiping the screen keyboard I installed, because I couldn't get the built in one working at first. It wasn't until later that I found out the actual steam client has to be running in the desktop environment for the built in keyboard to work.
The only reason I noticed every update is because it kept wiping the screen keyboard I installed, because I couldn't get the built in one working at first. It wasn't until later that I found out the actual steam client has to be running in the desktop environment for the built in keyboard to work.
I love that the steam deck appears to be the new hacker machine. This is literally the kind of computer I dreamed about having when I was a kid.
I didn't know about the Steam Deck. A sleek handheld gaming console with PC hardware running Arch Linux under the hood. Looks like it even supports multiple operating systems. Didn't think I'd ever see something like this. As expected, it's held back by the massive power consumption of PC hardware. Imagine an Apple M1 Steam Deck...
I'd really like a handheld programming device. I wonder how easy it is to write software with it.
I'd really like a handheld programming device. I wonder how easy it is to write software with it.
>As expected, it's held back by the massive power consumption of PC hardware.
Massive power consumption.. ? I've never seen it report more than 20W being discharged from the battery (this is easily found in the menu) even during gaming
>I wonder how easy it is to write software with it.
I'd call it borderline unusable for that unless you use a physical keyboard with it
Massive power consumption.. ? I've never seen it report more than 20W being discharged from the battery (this is easily found in the menu) even during gaming
>I wonder how easy it is to write software with it.
I'd call it borderline unusable for that unless you use a physical keyboard with it
> Massive power consumption.. ? I've never seen it report more than 20W being discharged from the battery
For comparison, this is the same peek power consumption of the M1 base SoC. A debate could be had if the M1 would be faster overall (I don't think it would be in games if Rosetta is involved), but it's not going to lower power consumption.
For comparison, this is the same peek power consumption of the M1 base SoC. A debate could be had if the M1 would be faster overall (I don't think it would be in games if Rosetta is involved), but it's not going to lower power consumption.
> Massive power consumption.. ?
Yes. All reviews I looked up complained about battery life. Some cited figures of 1-2 hours when playing demanding games. Is that wrong?
I assumed it had higher power consumption than the Apple M1 computers since they have a reputation for insane battety life. Not sure exactly how many watts they draw.
> I'd call it borderline unusable for that unless you use a physical keyboard with it
Well, I've written code using my phone... Can't be worse than that, can it?
Yes. All reviews I looked up complained about battery life. Some cited figures of 1-2 hours when playing demanding games. Is that wrong?
I assumed it had higher power consumption than the Apple M1 computers since they have a reputation for insane battety life. Not sure exactly how many watts they draw.
> I'd call it borderline unusable for that unless you use a physical keyboard with it
Well, I've written code using my phone... Can't be worse than that, can it?
Yeah, battery life varies greatly. More demanding games are in that ballpark. Sometimes you can squeeze more out by reducing the graphics settings and ensuring you have a set framerate cap. Older and less demanding titles get a lot better battery life. It can get 6 hours in something less demanding IME.
You can also easily use a physical keyboard and mouse with the Steam Deck either through Bluetooth or any old USB C hub. Video out works too and it supports MST so it's possible to do multiple external monitors even though it has a single USB C port (can't be done with M1!). It has a full fledged desktop mode that's basically just a normal distro with KDE. By default you can't use pacman to install Arch packages but you can easily enable it if you want. Flatpaks are easily installable by default though.
I'm not sure M1 would be much more efficient playing AAA games either. Some of the battery life advantage is just the fact that they have more room for more battery.
You can also easily use a physical keyboard and mouse with the Steam Deck either through Bluetooth or any old USB C hub. Video out works too and it supports MST so it's possible to do multiple external monitors even though it has a single USB C port (can't be done with M1!). It has a full fledged desktop mode that's basically just a normal distro with KDE. By default you can't use pacman to install Arch packages but you can easily enable it if you want. Flatpaks are easily installable by default though.
I'm not sure M1 would be much more efficient playing AAA games either. Some of the battery life advantage is just the fact that they have more room for more battery.
I also suggest being wary of early reviews of battery life. Later software updates introduced useful features that can improve battery life, such as 40 Hz refresh mode and FidelityFX Super Resolution (FSR).
Most early reviews wouldn't have taken that into account.
Most early reviews wouldn't have taken that into account.
M1 machines do have better battery life (i think the m1 chip itself is 10W?) And a bigger battery by virtue of being in an ipad or a full laptop, as opposed to being crammed in a handheld. There's also the advantage of being an arm64 machine over a bloated x86_64, notorious for the complexity and power draw
But also you have to consider that m1 macs don't offer you 8 zen3 cores and 8 rdna 2 gpu units. Apple device are notorious for being less powerful than the competition, but making it up in software, which you can't really do when the task is gaming, since that is basicaly as close as a full synthetic benchmark you can get.
Disregarding the arm/x86 compat layer that would be needed to play most games and its overhead, getting anywhere as close to steam deck framerate would probably take about 25 W worth of m1 chips. For 20 W, this thing is actually a beast. Like seriously, it runs Elden Ring (almost) well.
But also you have to consider that m1 macs don't offer you 8 zen3 cores and 8 rdna 2 gpu units. Apple device are notorious for being less powerful than the competition, but making it up in software, which you can't really do when the task is gaming, since that is basicaly as close as a full synthetic benchmark you can get.
Disregarding the arm/x86 compat layer that would be needed to play most games and its overhead, getting anywhere as close to steam deck framerate would probably take about 25 W worth of m1 chips. For 20 W, this thing is actually a beast. Like seriously, it runs Elden Ring (almost) well.
The Steam Deck is x86 despite being a handheld for compatibility with PC games.
There is already a compatibility layer software-wise (Proton to run Windows games on Linux), adding one more compatibility layer for hardware this time will add more problems to run games.
So unfortunately until PC game developers massively start to support ARM architectures, we're stuck with x86.
There is already a compatibility layer software-wise (Proton to run Windows games on Linux), adding one more compatibility layer for hardware this time will add more problems to run games.
So unfortunately until PC game developers massively start to support ARM architectures, we're stuck with x86.
> So unfortunately until PC game developers massively start to support ARM architectures, we're stuck with x86.
No. All it needs is someone other than Apple to do what Apple did with the M1 - people have shown that you can run games perfectly fine in Rosetta [1].
[1] https://www.macwelt.de/ratgeber/Das-M1-Macbook-Pro-als-Gamin...
No. All it needs is someone other than Apple to do what Apple did with the M1 - people have shown that you can run games perfectly fine in Rosetta [1].
[1] https://www.macwelt.de/ratgeber/Das-M1-Macbook-Pro-als-Gamin...
Running games under Rosetta comes with a performance hit. A small hit, sure, but it definitely appears to be a large enough hit to kill the M1's power efficiency advantage. It's not far fetched that the AMD SoC in the deck is more powerful efficient than M1 with Rosetta, even, especially since M1's GPU performance in games is notably below par.
> Apple M1 Steam Deck
Yea. Not being able to play 99.9% of PC games due to only supporting 1 proprietary graphics API would be great.
Yea. Not being able to play 99.9% of PC games due to only supporting 1 proprietary graphics API would be great.
Oddly enough I was just talking to some friends about my plan for the Steam Deck and my confusion on its update process - since the source code showed both partition image updates and pacman updates.
My day 1 goal is to get the system working with tailscale and games over NFS. Second is getting that managed by home-manager as a OK workaround for the A/B update system.
The long term project is to get the stock OS recreated in NixOS. Testing the system using a newer kernel for better Btrfs and Zen performance and faster gamescope (Wayland micron compositor) updates seems like a really interesting project.
My day 1 goal is to get the system working with tailscale and games over NFS. Second is getting that managed by home-manager as a OK workaround for the A/B update system.
The long term project is to get the stock OS recreated in NixOS. Testing the system using a newer kernel for better Btrfs and Zen performance and faster gamescope (Wayland micron compositor) updates seems like a really interesting project.
You'll probably find this interesting if you haven't seen it yet. Work has already started on getting NixOS usable on the Steam Deck here[1].
[1]: https://github.com/Jovian-Experiments/Jovian-NixOS
[1]: https://github.com/Jovian-Experiments/Jovian-NixOS
Yea I did notice that and it's where I have started building on.
Between Jovian and HoloISO a lot the the SteamOS internal workings are fairly well documented. It's always amazing how fast the OSS community moves.
Between Jovian and HoloISO a lot the the SteamOS internal workings are fairly well documented. It's always amazing how fast the OSS community moves.
For people who are curious about alternatives, there is also ZeroTier and NetBird.
Here is a comparison between ZeroTier and Tailscale from a year ago: https://news.ycombinator.com/item?id=27491133
(they both have pros and cons)
Here is a comparison between ZeroTier and Tailscale from a year ago: https://news.ycombinator.com/item?id=27491133
(they both have pros and cons)
The first two points in that comparison are (now?) incorrect. Tailscale works natively with Ipv6.
https://tailscale.com/kb/1121/ipv6/
https://tailscale.com/kb/1121/ipv6/
With zerotier you can play multiplayer games over IPX/SPX. Read: Duke Nukem 3D
This is a long post and I didn't notice while reading it that it was coming from Tailsacale itself.
But I wonder: if the best solution is to use a systemd-sysext image, why Tailscale doesn't just provide that kind of image as a download package?
https://pkgs.tailscale.com/stable/
But I wonder: if the best solution is to use a systemd-sysext image, why Tailscale doesn't just provide that kind of image as a download package?
https://pkgs.tailscale.com/stable/
Every systemd-sysext image needs the OS and version hard coded in. In order to provide canned downloads, I'd need to make at least 4 images per release (one for every publicly available version of SteamOS) and it's honestly easier and arguably better to have the target device take what we already ship and make an image out of that on the heckin device.
Because it's not ready yet?
I did the manual setup the other day since I wanted to try using my steam deck as a Road-Warrior build server.
The whole systemd-sysext seems like a good way to make that happen.
The whole systemd-sysext seems like a good way to make that happen.
About moonlight, there is server software project to run Gamestream host for AMD/Nvidia/Intel GPUs and Multiplatform Linux/Windows/MacOs
https://github.com/LizardByte/Sunshine
https://github.com/LizardByte/Sunshine
I don't quite understand what this project is. How does it work with Moonlight or is it a replacement for Moonlight? (The docs don't seem to explain why I'd want to use it.)
Two different things - client and server
Moonlight is a client for Nvidia GameStream, a local streaming server solution. A computer running GeForce Experience hosts the GameStream server - a client device running Moonlight receives the stream.
Typically GameStream is only hosted from a computer running GeForce Experience, which I believe is Windows-only and only compatible with Nvidia graphics cards. This Sunshine project is an alternative GameStream server, so that it can be hosted on macOS and Linux as well.
Moonlight is a client for Nvidia GameStream, a local streaming server solution. A computer running GeForce Experience hosts the GameStream server - a client device running Moonlight receives the stream.
Typically GameStream is only hosted from a computer running GeForce Experience, which I believe is Windows-only and only compatible with Nvidia graphics cards. This Sunshine project is an alternative GameStream server, so that it can be hosted on macOS and Linux as well.
aborsy(8)
[0] https://wiki.archlinux.org/title/systemd/User
[1] https://crankshaft.space/docs/usage/autostart
[2] https://flathub.org/apps/details/space.crankshaft.Crankshaft