WSL2: Enabling systemd in Ubuntu 22.04
- Issued
- Extent
- 1 min read · 134 words
- By
- Felix Itzenplitz
- Also in
- Deutsch
Since Ubuntu 22.04 it is possible to use systemd in an experimental state on WSL installations. This guide explains how you can easily set it up in just a few steps.
Setup Guide
- Install
wsl-setuppackage, if its not already there.
sudo apt install wsl-setup
- Create a
/etc/wsl.conffile ( WSL Configuration Documentation (opens in a new window) ):
For WSL comes with Windows 10/11:
[boot]
command="/usr/libexec/wsl-systemd"
For WSL Preview from MS Store in Windows 11:
[boot]
systemd=true
- Create
/run/users/1000and set user rights (optional: but was needed for snapd):
sudo mkdir -p /run/users/1000
sudo chown $USER:$GROUP /run/users/1000
- Relaunch wsl with following command from windows or set as launch option in your terminal:
wsl -e /usr/libexec/nslogin /bin/bash
Links
Official Ubuntu Bug Report
(opens in a new window)
Install Snippet
(opens in a new window)