# Enable Systemd Support in WSL2 (Obsolete)

Since, WSL2 Ubuntu is a trimmed down version of Ubuntu, it doesn't come with systemd support. However, we can make it work using systemd hack.

***NOTE:*** WSL 2 Only

**Usage**

Run this script in WSL2 (Ubuntu):

```bash
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
```

Then run (in Windows):

```shell
wsl --shutdown
```

Run WSL again and test systemd by running:

```bash
ps 1
```

You should see something like this:

```bash
jungle@DESKTOP-B73I3A0:~$ ps 1
    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:02 /lib/systemd/systemd --system-unit=basic.target
```

Enjoy systemd hack on WSL2!

***Source:&#x20;***~~***GitHub***~~


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/wsl/enable-systemd-support-in-wsl2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
