logoalt Hacker News

Using Tailscale with an OrbStack VM on macOS

42 pointsby highpostlast Monday at 10:10 PM10 commentsview on HN

Here's an example of how to build an Ubuntu VM using OrbStack on macOS and then connect to the VM through Tailscale SSH using an auth key stored in Apple Keychain.

For example, I can create a VM on my Mac mini at home that hosts a git repo or even a Forgejo server. A colleague in my Tailnet can then connect to this VM to clone, push or pull source code changes from a coffeeshop or airliner while not exposing the rest of my Mac mini.


Comments

philipstoday at 7:11 PM

I recently learned of OrbStack and it feels like the only product that actually makes an effort to integrate VMs and Containers correctly and consistently into macOS.

Docker Desktop and Podman Desktop are both a treadmill made of Lego bricks.

show 1 reply
robgoughtoday at 7:52 PM

I do all my dev inside docker/orbstack environments. I've been using a Tailscale sidecar for each, which has let me easily spin up second (and third!) copy of each repo without having to worry about them interfering with each other (the same open ports etc.). I've not extended to using worktrees, as right now I prefer entirely separate clone's of a repo, but that may well change and I suspect this would work well for that too.

https://robgough.net/multiple-app-instances-with-tailscale

Also has the handy effect of making it super easy to share my dev environment with anyone else on my tailnet, though this could be locked down if needed.

sudostephtoday at 7:23 PM

I use tailscale with Orbstack so that my agents on the vm can use tailscale serve to share dashboards I can view on my phone. Works out nicely.

One thing I noticed though, is that even if I set up the VM as a tagged device with limited access rules, if my host machine (the laptop) is connected as my user (which has less limited permissions), the vm uses my host's user permissions, which isn't really what I want. If I disconnect tailscale on the mac and leave the vm tailscale connected it works as intended though - so that's something to look out for.

Also, if you're using orbstack as an agent sandbox, just be aware that they only recently added an option for true filesystem isolation, the default setup doesn't really sandbox effectively.

show 2 replies
CalChristoday at 7:00 PM

Interesting. Can you do this with Forgejo?

show 1 reply