News: 1664003651

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

A match made in heaven: systemd comes to Windows Subsystem for Linux

(2022/09/24)


Linux distros running on Windows in a WSL2 virtual machine now can use the systemd init system.

This week Microsoft and Canonical jointly announced the news that the latest build of Windows Subsystem for Linux 2 (version 0.67.6 and higher) has been modified to support systemd. Canonical's [1]blog post has some technical detail, and also takes the opportunity to promote its [2]LXD container thingamajig.

Microsoft's corresponding [3]announcement is not so technical – and the YouTube demo video even less so – but it does mention that there have been multiple third-party workarounds that have achieved the same thing.

[4]

The Register [5]predicted this about a year ago, and we rather suspect that this may to some degree be connected with systemd supremo [6]Lennart Poettering joining the Windows giant a few months ago.

[7]

sudo systemctl stop grinning ... Lennart Poettering in May 2015

For clarity, this is specific to WSL2, the second generation Windows Subsystem for Linux. WSL2 runs a full Linux kernel inside a dedicated VM, using a subset of the features of Windows' integrated Hyper-V hypervisor. The original version 1 WSL was a [8]very different tool , which didn't contain a full Linux kernel.

The joint Microsoft/Canonical demo video gives as examples tools such as MicroK8s (pronounced "micro-Kates", and nary a mention of Kubernetes), NextCloud, and Canonical's cross-platform packaging format Snap, as Linux features that need systemd's functionality.

[9]

Apparently implementing this has required changing how WSL2 works, as previously it used a Microsoft program running as PID 1 for integration with the host OS. As such, the change to support systemd won't be pushed out automatically as it could break things for existing users. You'll need to install or upgrade to the necessary WSL2 build from the Microsoft Store to enable it.

[10]Windows Subsystem for Linux 2 splashes down on Win Server 2022

[11]AlmaLinux comes to Windows Subsystem for Linux

[12]WSL2 on Windows Server 2022 hits Windows Update

[13]Microsoft freshens up its in-house container Linux, CBL-Mariner

This has been an outstanding [14]issue for a long time, and it's caused [15]problems for some users. To this grizzled Linux veteran, not being able to use the systemctl command doesn't seem like a big drawback, but to sysadmins young enough to have never seen a distro without Poettering's brainchild, it's confusing.

We suspect that other jaded old-timers might consider the absence of containers, Snaps, Flatpaks, and indeed systemd itself as positive advantages, but this is a cultural gap between generations and won't get any narrower. Far be it from us to speculate that Microsoft embracing, extending and then extinguishing systemd could ever be seen as a good thing. ®

Get our [16]Tech Resources



[1] https://ubuntu.com//blog/ubuntu-wsl-enable-systemd

[2] https://www.theregister.com/2014/11/06/canonical_announces_lxd_container_hypervisor/

[3] https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Yy7VP5V00hkwQFhWAOkiEQAAAJE&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[5] https://www.theregister.com/2021/11/17/ubuntu_team_systemd_windows_wsl2/

[6] https://www.theregister.com/2022/07/07/lennart_poettering_red_hat_microsoft/

[7] https://regmedia.co.uk/2015/05/07/lennart_poettering.jpg

[8] https://learn.microsoft.com/en-us/windows/wsl/compare-versions

[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yy7VP5V00hkwQFhWAOkiEQAAAJE&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[10] https://www.theregister.com/2022/05/26/wsl2_windows_server_2022/

[11] https://www.theregister.com/2022/04/04/almalinux_wsl/

[12] https://www.theregister.com/2022/06/22/wsl2_windows_server/

[13] https://www.theregister.com/2022/03/17/microsoft_updates_its_inhouse_linux/

[14] https://github.com/systemd/systemd/issues/8036

[15] https://github.com/microsoft/WSL/issues/1579

[16] https://whitepapers.theregister.com/



A Non e-mouse

I've read the Canonical & Microsoft blog posts about the change. Other than saying that SystemD needs to be PID 1 and previously WSL was PID 1, neither say really what changed.

A related question is: Why did WSL need to be PID 1?

Dan 55

It had to be pid 1 as was the init process for WSL.

I imagine Poettering's grinning because he's thrilled that the systemd knotweed has found another distro to take over, and the one with the greatest reach at that. If that won't make it the de facto standard, nothing will.

emfiliane

WSL did the work of init before this; now Systemd will do what it does, replace init, if you elect to use it.

jake

"Why did WSL need to be PID 1?"

Because WSL was the init. Whatever your init is on a *nix system, it always has the PID of 1. Not even Microsoft or Poettering would be daft enough to try to change this.

Would they?

Better idea.

jake

Use Slackware on the desktops and BSD on the servers.

Free of both Windows and the systemd-cancer. What's not to like?

Re: Better idea.

Jad

AD integration, SAML connections, GPO functionality, COTS desktop apps with only for Windows, Office and Azure apps (yes I prefer LibreOffice, but we're talking corporate here, and there's lots of Azure connectivity apps not yet ready for Linux), hyper v images (allowing migration to the Azure cloud), user/automated patching ...

Easier to get support staff for Windows, easier access to training, common platform, most likely the same desktop they use on their home computer ...

Don't get me wrong, I'm a UNIX/Linux guy at heart, but there are good solid reasons for running a Windows server and desktop system

Re: Better idea.

jake

"there are good solid reasons for running a Windows server and desktop system"

Keep telling yourself that, and it'll remain true. For you.

I decline to tell myself that, and as a result have been Redmond free for almost 13 years now. Try it, you might like it.

a match made in heaven indeed

lvm

systemd abomination is a product which could've make microsoft proud - overcomplicated, unnecessary and addressing issues which don't exist. And using binary logs - just the way ms likes it.

SEMINAR ANNOUNCEMENT

Title: Are Frogs Turing Compatible?
Speaker: Don "The Lion" Knuth

ABSTRACT
Several researchers at the University of Louisiana have been studying
the computing power of various amphibians, frogs in particular. The problem
of frog computability has become a critical issue that ranges across all areas
of computer science. It has been shown that anything computable by an amphi-
bian community in a fixed-size pond is computable by a frog in the same-size
pond -- that is to say, frogs are Pond-space complete. We will show that
there is a log-space, polywog-time reduction from any Turing machine program
to a frog. We will suggest these represent a proper subset of frog-computable
functions.
This is not just a let's-see-how-far-those-frogs-can-jump seminar.
This is only for hardcore amphibian-computation people and their colleagues.
Refreshments will be served. Music will be played.