Live data from Hacker News

Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

news.ycombinator.com

1–10 of 17 posts

Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#1
I have a new lightweight laptop with 16 GB of RAM, decent SSD space, and an i7 CPU.

And I would like to setup a few systems on it, to have "everything" with me as I move around while disconnected.

I'm looking for recommendations and ideas into how to set this up.

Examples of these systems would be:

a) A headless server with a dev stack: runs a build workflow, a web server, etc.

b) A stable "production" version of server (a)

c) A "desktop" dev environment: IDE, language/tools-rich

d) A "basics" desktop environment for non-tech work: office tools, maybe some media editing (even blender 3d if feeling lucky)

They won't all be running simultaneously.

I haven't worked on the OS systems and platforms level since a past life. I don't know much about virtualization/containers/etc, but I'm good with networking fundamentals, and I'm willing to learn any old/new tech.

Ideally:

1. The host OS is minimal (i.e. can only keep the core packages I need), and driver-friendly so the core hardware (compute/graphics) is efficiently accessible to each guest OS.

2. I can network the different "machines" together; so the dev desktop can use the dev server's API, and the basics desktop accesses the apps on the production server in its browser.

3. I can pull data from each system out into the host OS for data backups.

4. I can restrict network/internet access from/to any of those systems, from the host OS.

5. All systems are open-source, can work completely disconnected and do not phone home in order to function.

Thankful for any experience you can share.

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#2
It sounds like you are describing QubesOS [1] I've used it with 16 GB of ram just fine provided each VM does not need a lot of ram. Here [2] are some screenshots and show how networks and firewalls are presented and a video walk-through [3]

[1] - https://www.qubes-os.org/intro/

[2] - https://www.qubes-os.org/screenshots/

[3] - https://www.youtube.com/live/hkWWz3xGqS8?feature=share&t=849

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#4
It really depends on why you want to have separate environments. What's the thing you're trying to avoid here?

Anything that requires graphics is much more efficiently done in the Bare Metal machine. You can have a separate user for those or some other kind of abstraction that's not a virtual machine.

You can also use Network Namespaces directly, using "ip netns" or even cgroups. That way you can run every single program natively, but have multiple network environments for them.

You can go for the jails-style containers where you also run everything natively but on a different chroot, without having a Kernel running on top of a Kernel. For this I recommend creating a chroot with debootstrap or febootstrap and then launching it with systemd-nspawn.

You can also have specific applications running on their own "jail" with /usr/bin/firejail.

Now if you want even stricter separation you'll have to go with full virtualization (guest Kernel running on top of Host Kernel). This is much worse in terms of efficiency of used resources, but gives you the most separation from one thing to another. For that you can use virt-manager or just Virtualbox.

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#6
I've been doing my work in VMs running on my local for a long time now and it works great. I got started because I wanted my development environment to be a close match for my stage and production.

For a long time I ran VirtualBox guests on a laptop host running Debian or Ubuntu. VB is great especially if you're getting started with virtual machines, it has a GUI and things are easy to understand. I used a host-only network to keep traffic inside my laptop.

If you're going to edit code inside a VM you'll need an IDE that can handle it. Emacs with tramp has served me well for years. IIRC with VSCode you have to install a server on the VM.

I do web development so I've never felt the need to run desktops inside VMs. It's nice to have some separation between work and stuff like HN but Gnome workspaces gives me just enough.

A couple years ago I levelled up and switched to KVM on a headless Debian box. This system uses bridge networking with DHCP from my router, and I use Tailscale to access my VMs from outside my LAN. You can use virt-manager (which also works for VirtualBox) but I mostly use the libvirt CLI tools and cockpit/cockpit-machines if I need something a little more visual. Caveat: I don't know how KVM would handle suspend on a laptop.

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#7

It sounds like you are describing QubesOS [1] I've used it with 16 GB of ram just fine provided each VM does not need a lot of ram. Here [2] are some screenshots and show how networks and firewalls are presented and a video walk-through [3] [1] - https://www.qubes-os.org/intro/ [2] - https://www.qubes-os.org/screenshots/ [3] - https://www.youtube.com/live/hkWWz3xGqS8?feature=share&t=849

How trustworthy is QubesOS?

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#8
Have you considered devcontainers?

Its use results in carrying entire development environments with you, and because it is using containerization these will not clutter your host OS.

Using DevPod (https://devpod.sh/) you are not locked into Visual Studio or Visual Studio Code, but you can use whatever tool you want.

IMO this kind of setup will provide a much better DX than running a bunch of VMs eating away the resources of your laptop.

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#9
For an off-the-shelve solution there is Qubes but from what I've heard it's probably quite a pain to use unless you're comfortable debugging Linux desktop and driver problems in particular. Generally KVM/libvirt is nice because it's fast and can be set up transparently and networking can be customized in any possible way. (It might also be possible to get GPU Passthrough working with KVM but I think this only works if you have 2 GPUs)

Re: Ask HN: What's a good Linux OS and setup to build a dev “network” on my laptop?

#10
post #7

It sounds like you are describing QubesOS [1] I've used it with 16 GB of ram just fine provided each VM does not need a lot of ram. Here [2] are some screenshots and show how networks and firewalls are presented and a video walk-through [3] [1] - https://www.qubes-os.org/intro/ [2] - https://www.qubes-os.org/screenshots/ [3] - https://www.youtube.com/live/hkWWz3xGqS8?feature=share&t=849

How trustworthy is QubesOS?

[dead]
Post reply on HN