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

11–17 of 17 posts

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

#11
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?

Do you mean trustworthy in terms of the developers not being compromized by state actors, or do you mean in terms of security model and design?

In terms of security model it uses Xen to virtualize VM's and the default network isolation is decent enough for most people wanting network segmentation. The system administrator can either open up or further lock down the networking and firewall(s) to change how restricted VM's are from one another or the internet or the local networks. Their default implementation assumes that one may want to use a ram-only stateless or ephemeral OS to access Tor and another VM that can only talk to the Tor VM to a specific IP/port to prevent leakage. For other security scenarios people would have to create their own firewall rules and networking so that learning exercise would be on each person.

In terms of state actors there is really no way to answer that for any distribution as developers can be compelled into silence through assorted fear inducing tactics and lawful intercept can be a series of subtle design weaknesses that would not be spotted by the best external developers. These subtle design weaknesses can be a combination of OS libraries, combinations of hidden CPU registers and known x86 works as designed flaws.

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

#13
I have something similar and have had for several years. Just needs a recent-ish kernel and decent distro!

I try to avoid virtual machines unless there is an absolute need to virtualise the hardware as well - in most cases single kernel, multiple containers is preferred.

Specifically, I use Debian with systemd-nspawn unprivileged (user namespaced) containers (managed by machinectl), defined and built using mkosi as BTRFS subvolumes (a BTRFS mounted on /var/lib/machines/ allows nspawn to create copy-on-write containers from a 'template' container).

The nice thing about nspawn is being able to create simple declarative configurations with private namespaces. With a private network namespace it has the concept of 'zones' which are containers that share the same (private) bridged network. systemd-networkd has built-in configs for both the host and containers to do automatic configuration.

I use this to create per-domain (e.g. example.com) zones with multiple function-specific containers (one for router/firewall, another for DHCP and DNS, others for single-sign-on, database, web, mail, and whatever else is required). I use veth to connect the zone selectively to the host interface public bridge interface providing external access if necessary.

This allows 'development' 'test' and 'production' domains using mkosi to define and build each repeatedly as needed. In the non-public domains the zone can be configured to use the same public IP addresses as production will use without it leaking outside the zone.

I use IPv6 only in the zones with both ULAs and global prefixes and DNS64/NAT64 in the 'router' container if the zone needs to make outbound connections (to IPv4 destinations).

I use netfilter rules applied to each zone's bridge interface to impose firewall restrictions.

Using veth pairs one can connect two containers (or zones) directly rather than using the common zone bridge interface.

I do dev work on the host itself; if you want to partition application usage I'd suggest keeping it simple by using multiple user accounts, one per 'task' so $USER configs and so on are all kept separate.

In the 'development' containers I do things like bind-mounting the base source-code directory, or project-specific directory, into the container. I do all source-code work on the host but build and test in the appropriate container.

For example I have 'linux-builder' container where I do out-of-tree kernel builds for multiple architectures. The container has the required crossbuild tools installed. Recently this has been used to build latest mainline kernel for amd64, arm64, and powerpc64 (for the Xbox 360!).

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

#15
I use Linux Mint for a similar host set up. Its worth it to move away from virtualBox to the open source versions as I did recently, KVM etc.

There are quite a few paper cuts in setting it up the first time. I recall it took about five hours before I finally had my first VM in the right place, with right size of disk space and ram and the version of linux I wanted. But after the learning curve it becomes very easy. Honest :)

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

#16
If I understand the question correctly, you’d like to build a networked system entirely on a single machine.

If this is the case, then I’d recommend trying docker-compose. It’s quite an easy little system to get up and running, just need a single file to declare different containers and their relationships. Then just run “docker-compose up/down” to spin up and spin down the network.

The beauty of this is that it can run on extremely barebones Linux distributions, as it’s all container based.

It’s a great starting point anyway, and I’m sure there’s many alternatives now that use a similar api

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

#17
post #7

Earlier quoted context omitted.

How trustworthy is QubesOS?

Do you mean trustworthy in terms of the developers not being compromized by state actors, or do you mean in terms of security model and design? In terms of security model it uses Xen to virtualize VM's and the default network isolation is decent enough for most people wanting network segmentation. The system administrator can either open up or further lock down the networking and firewall(s) to change how restricted…

I mean in terms of the compromised software distribution system by governments or similar.

There are products like encrypted phones. They are advertised as secure locked down devices designed for people who have high security requirements. They attract crooks and thus law enforcement that compromise their servers. This can go unnoticed for decades.

Of course this risk is there for any distribution, but we can compare one distribution with another.

Post reply on HN