logoalt Hacker News

Show HN: NSL – WSL for Linux

74 points • by bketelsen • today at 2:51 PM • 58 comments • view on HN

One of the things that Windows really got right is WSL2. I drive an atomic Linux distro for daily use, but wanted a way to develop with multiple different distros with that same WSL UX. NSL is my answer. It is a faithful reproduction of the developer experience, powered by a single VM that hosts one or more systemd-nspawn containers with your development instances. Host file edits and port sharing come along for the ride, just like WSL. Take a look and tell me what you think... It's yet another step in my long journey to keep my host installation free from all the changing and breaking dev dependencies that force a reinstall every few months.


Comments

rao-v • today at 4:36 PM

I have to say this is nice packaging. It is weirdly not obvious how nice it is to cleanly use a different “machine” inside your desktop.

I never thought I’d prefer WSL to even my MacBook for working with remote servers and dev but somehow I do.

I of course know the many ways to roll something like this for myself, yes dev containers are better for many things etc. but it’s wierd how good the ergonomics of a WSL like container are.

➕ show 2 replies
0x457 • today at 5:02 PM

I'm confused why VM + systemd-nspawn? From my understaing WSL 2 runs a single VM + something like systemd-nspawn per "linux installation", but it runs a VM because it needs linux kernel. Why not just do systemd-nspawn if you alread on linux?

➕ show 3 replies
dathinab • today at 10:57 PM

How does it differ from existing tools kinda do exactly same, like e.g. toolbx. (And to a slightly lesser degree flatpack, snap, etc.)?

And what prevented adopting/supporting existing projects, instead of further tool ecosystem fragmentation?

thayne • today at 4:20 PM

How does this compare to distrobox?

➕ show 1 reply
rpcope1 • today at 4:28 PM

So you've just basically reimplemented LXC?

➕ show 1 reply
graemep • today at 4:27 PM

This is most useful to people who run Linux as their daily driver so rather than saying its like WSL can you explain what it offers that existing Linux containers do not?

Its also sounds different from WSL which I thought is a VM rather than a container.

> It's yet another step in my long journey to keep my host installation free from all the changing and breaking dev dependencies that force a reinstall every few months.

Something that also require a bit of explanation. What do you do that makes this such a common problem.

➕ show 1 reply
bee_rider • today at 5:46 PM

The name WSL has always struck me as a bit back area (LSW would seem to make more sense, since it is a Linux subsystem for Windows). I guess they mean it as a Windows Subsystem for Linuxing.

Anyway, should this be called LSL or WSLL? Or maybe LSWSL.

➕ show 2 replies
naman_307 • today at 9:19 PM

Is the VM layer mostly for host hygiene, or are you also treating the instances as a real security boundary when something untrusted (deps or agent-written code) runs inside?

bita_nidir • today at 6:33 PM

I'll give this one a try, thanks for sharing!

FWIW, I'm currently using systemd-nspawn via mkosi: https://github.com/systemd/mkosi

It makes an image and runs it in separate namespace. It can start at bash or init. It's very fast but there seem to be a problem creating an Ubuntu image on Debian and vice versa.

michaelastreiko • today at 5:52 PM

Nice flip of the WSL idea the other way — simple interop like this keeps a one-person stack from turning into a VM zoo.

teeskay • today at 6:40 PM

Just a recommendation that difference between docker container and nsl on homepage is worth it

dingaling911 • today at 4:58 PM

Looks very cool.

Now all you have to do is run NSL under WSL.

➕ show 1 reply
28304283409234 • today at 6:35 PM

Always looking for a successor to https://developer.hashicorp.com/vagrant. Is this it?

bezko • today at 6:02 PM

someone has to ask the question: can you run lsl in wsl?

RandomGerm4n • today at 4:35 PM

There's already Distrobox, which does exactly the same thing but isn't slop.

➕ show 1 reply
codr1 • today at 6:35 PM

This is very cool. GG.

varispeed • today at 4:21 PM

The project is cool, but please use human written text.

The website's Claudisms are unbearable.

the_real_cher • today at 4:21 PM

IS it LXC containers or docker? Or are you running a custom chroot namespace setup?

➕ show 3 replies