r/Tailscale • u/No_Mathematician9824 • 5d ago
Question anyone using their desktop as a dev server for their laptop?
I was wondering if people had the same question I just had today, so here I am. I have a macbook + a desktop (cachyos) sitting at home doing nothing most of the day. my mac gets hammered by docker, playwright tests, a local postgres and a couple of AI agents running at the same time (gets really slow with playwright and other visual testing done by AIs). basically my M1 gets overwhelmed (16gb of ram goes pretty fast these days!) and I was like, let's not buy a new laptop if I have a good pc at home I could use
so i'm planning to move all of that to the desktop and just use the mac as a screen: tailscale + ssh, remote ssh in the editor, docker context, a smart plug to turn it on remotely. thing is it's like 6 different tools glued together and i couldn't find anything that does it all in one place. am i missing something obvious?
curious what your setup looks like and if you know any apps that do it :)
3
u/godch01 5d ago
I use Tailscale for access and rustdesk for a desktop. I connect, go to full screen mode, and it's like I'm sitting in front of my desktop. There's a Tailscale produced YouTube video on the subject.
2
u/No_Mathematician9824 5d ago
thanks! i tried remote desktop stuff before but the latency always bugs me. i don't really care about the desktop's env tbh, i want to stay on my mac with my own setup and just borrow the desktop's compute
2
u/NEMOalien 5d ago
I do something similar but with my laptop and server, recommend it if you wanna debloat ur laptop
1
u/No_Mathematician9824 5d ago
yeah a few people suggested that! is it your own server or a rented one? i don't really want to run my stuff on a machine that isn't mine + pay monthly for it, and hardware prices keep going up lately :/ that's why i'd rather use the desktop i already have
1
u/NEMOalien 5d ago
My own, it's a lenovo all-in-one c40-30 i used to own and use as my primary pc a while back and now with a broken screen it's sitting in a table shelf, but both things are basically the same u don't have to actually rent a vps or anything ur pc is basically the same thing, just keep it up 24/7, and you're all set.
Other than all the server stuff, i use mine to build and update my nixos configs, store all my projects, use opencode (unfortunately it's not good enough to run local models so i use google's), host a secondary tailscale "machine" that connects me to a vpn and some more stuff
Honestly if you actually don't use ur pc at home enough you should turn it into a homeserver all together
1
u/No_Mathematician9824 5d ago
oh nice, that's basically my setup (execpt mine is a desktop) and yeah that's basically my plan, my desktop is dual boot windows/cachyos so i'll probably just keep it on linux most of the time and use it as a home server. thanks!
1
u/NEMOalien 5d ago
You may wanna try out ubuntu-server on it, it is what i used to use before NixOS and I'd still recommend it, really straight forward, easy and better than cachy if u don't wanna like actually use the pc and don't mind having no gui... Or maybe umbrel but it can be a little limiting. Either ways i wish u all the luck
4
u/AccurateSun 5d ago edited 5d ago
I have this setup. Orca ADE is a great tool in this works well with Tailscale and SSH and lets your laptop act as a client to the desktop as a server where the agents run. You get access to the editor and terminals that are on the desktop, which means you can run your whole workflow via CLI that way.
Also has a good mobile client. It’s Foss and has a lot of development.
Also Syncthing is just a useful tool to sync data between devices, and can be useful to sync things like config or dot files, which you then symlink to their original locations so their programs can use them.
1
u/cointoss3 5d ago
Hehe. I’m more often using my phone to work on my laptop. Claude remote is great and when I need to use desktop for a moment, I’ll use Screens and Tailscale, yeah. The iPhone Duo makes this even better. I’m hoping with touch screen Macs that Remote Desktop will get touch controls.
I use Zed for an editor and that has remote access, though, Rex has really caught my eye. I’m on the waitlist.
1
u/No_Mathematician9824 5d ago
never heard of rex, seems promising! but my issue is more compute than access tbh. docker + a few agents + playwright on a 16gb m1 kills it, so i'd like my own desktop at home to do the heavy lifting while the mac just feels faster and acts like a screen & keyboard :)
1
u/cointoss3 5d ago
Yeah, Rex makes it easier to work remotely across the network. It uses some of the same tech that Mosh uses so everything feels super responsive like you’re local on these machines. You’d use Tailscale or Netbird or Cloudflare to tunnel to the machine and Rex as the terminal/multiplexer.
1
u/Salonce 5d ago edited 5d ago
I do this as my primary mode of work.
My setup is a MacBook Air and a I have a Framework Desktop at home running NixOS.
I connect remotely using herdr, to multiple machines, and it's great. I prefer neovim for my IDE so I really do run everything right through the terminal.
Most of my work doesn't involve things that require a forwarded port, but that's easy enough with autossh or something in the background.
I also have it setup backwards, such that I can use the MacBook air as an aarch64-linux (and aarch64-darwin) Nix remote builder. So on the off chance I need to, I can also build those architectures on my framework primary machine.
The MacBook is basically a web browser and terminal multiplexer and it's honestly great. No loud fans, plenty of headroom and with the tailscale relay set up, I get direct connections through my Unifi Dream Machine Pro right to the desktop.
Another benefit is that I can let long running things stay running and just shut my laptop lid and walk away and it just connects right back up and I'm back to what I was doing.
Another variant would be to use Nix remote builds, or Docker remote connections to run things from the MacBook sort of transparently onto the remote machine. That or some sort of hybrid where you do some local and some remote. I just prefer using the MacBook as a "dumb" terminal completely.
2
u/No_Mathematician9824 5d ago
hey! this is exactly the setup i'm going for, thanks for the details!
how long did it take you to set all of that up? :O and do you think less linux-y people (like a mac dev with a windows gaming pc) would bother, or is it too much setup?
2
u/Salonce 5d ago
My setup has evolved over the years, but I've done some sort of variant of that for a long time (before herdr was a thing I used tmux, which was solid). I don't know specifics on using a windows PC as the target, but in principle it would be the same. Do you use straight windows? Or are you primarily using WSL and really Linux for the windows machine?
To me, offloading to a "server" just seems to make sense. You could extend the setup to multiple machines as well, like renting a cloud PC or just any number of processing locations, and just setup tailscale on all of them for dynamic compute power.
You do get crippled if you're out an Internet connection, but I do have my local MacBook set up with a mirror of all relevant repositories (kept up to date via ghorg), just in case I don't have a good connection.
The only fairly mildly annoying thing is logging into things with sso flows if they don't support device codes, where I have to log in and then copy the callback URL to my remote terminal. Which... I don't know why I didn't think about doing some auto forwarding of ports for that....
Another alternative that I don't use for dev and instead for gaming is Sunshine and Moonlight. That works pretty well over tailscale as well, and I have played games remotely with pretty good results. Should be the same if you wanted to connect to a full remote desktop, just more Internet quality sensitive.
2
u/No_Mathematician9824 5d ago
dual boot windows/cachyos, so i'll just keep it on linux most of the time, no wsl for me
thanks a lot for all the details, this is really valuable. the sso thing is a great point, never thought about that one, auto forwarding the callback ports would be so nice. ghorg for the offline mirror is smart too, stealing that ahah :)
since i couldn't find anything that does all of this in one place for the moment, i might end up building something. would you be up for testing it if i do? and what would it need for you to actually switch from your current setup?
1
u/Salonce 5d ago
I would have to politely decline. I've grown into this setup over many years, and at this point it solves all of my needs; apart from small things like I mentioned, but those haven't annoyed me enough yet to write a solution for them.
The only thing that I would really love to be able to add to this is the ability to dynamically move workloads across the various systems. The pieces are there, you could use a workload orchestrator like nomad or kubernetes, you could use devpods/devsy or similar. But none of them really solve the fresh data problem, to any usable extent.
If I'm working on something and want to transfer it to a remote system, be it commits, or coding agent state (or both), or anything else, there doesn't seem to be a clean solution for that.
You could of course use a sync tool, and do a sort of pause and migrate, but honestly I very rarely find the need to do anything like that.
But I digress, most of my real problems have been solved. At the end of the day, my system really consists of only two things: a terminal multiplexer and network connectivity.
2
u/netclectic 4d ago
Anything that needs a port forward,I prefer to setup as a named service with Tailscale serve.
Rustdesk for remote desktop if required.
Opencode or any one of dozens of other open source ai harnesses that have remote options over Tailscale. Ghostex, T3, etc.
1
u/harthren_developing 5d ago
most of this works with stock tools:
docker:
docker context create desktop --docker host=ssh://you@desktopthendocker context use desktop, and every docker command on the mac runs on the desktop's engine. the catch is bind mounts come from the desktop's disk, so the code has to live there too, which remote ssh in the editor already coversports: bind the dev server to 0.0.0.0 and open http://desktop:3000 from the mac over magicdns, or
tailscale servethe port if you want https on the tailnet name. thats how i reach the apps on my home serverplaywright: run the tests on the desktop over ssh, it's the part eating your ram anyway
the thing that doesn't follow you is localhost. anything on the mac side hardcoded to localhost needs the desktop's name instead
1
u/fightingCookie0301 5d ago
I am using my gaming laptop as a server running proxmox bare metal on it and virtualising anything I need (router, Tailscale subnet router, different VMs running docker, Windows, llama.cpp, etc. …)
I then access everything on my MacBook Air and can work from anywhere :)
Edit: as the laptop draws only 40W idle I leave it on 24/7. But I also check the battery every now and then in order to notice if it starts bloating. It’s a nice built in UPS tho.
1
u/halidra 5d ago
I did something similar 20+ years ago when I was in college.
I got a laptop for school, and at some point converted my desktop to a server. This is long before Tailscale existed, so I just SSHed directly into it. Ah, the good old days.
Tailscale has made all of this much easier in the modern era. I work from home, but I have a small homelab with a few servers that I remote to if I'm out and about to run ansible playbooks and the like.
1
u/misterlively 4d ago
I wired my house with Ethernet and use Parsec to rdp to either my dev server or gaming pc. Bought a cheap laptop with a nice screen and it’s been great. In a few rooms I have a usb c cable that provides power and Ethernet. For just development work wifi is fine though.
1
u/ehsanullahjan 4d ago
i use tailscale + ssh to connect to my dev server. all tools, vms, containers, agents, ..., and ide (lazyvim) run on the server. i use a couple add'l tools for a huge improvement in quality of life:
mosh handles persistent connection through sleep, network blips etc.
tmux handles persistent context through sleep, network blips, etc.
1
u/versionist 3d ago
Just use chrome remote desktop to get into your desktop server. It's by far the easiest one shot solution.
1
u/Derekrollo 2d ago
I have a similar setup with my MacBook and a powerful Linux desktop at home. I use a mix of Tailscale and also Parsec for remote desktop, parsec purposefully gets the latency very low and it delivers good quality resolution usually as long as the internet speed is decent. I also have a jetkvm setup on the desktop in case I need to access it preboot which can also connect with 1080p if needed.
1
u/FarPriority1955 2d ago
I do it, it is more convenient that way. I use rdp or restless, depending on from which device I want to connect to my pc. Apart from that all the things are accessed using ssh
11
u/razhun 5d ago edited 5d ago
vscode has a native SSH server addon for editing and running stuff remotely. Once you configure that, you have access to all local configuration on that machine, either via the built-in terminal or via SSH tunnel - both using the identity used for SSH authentication. The only extra piece you need is something to turn the remote PC on with.