Skip to content
Back to skills

Wsl2 Systemd Config

BSecurity

Use when enabling systemd in WSL2 distros.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
ai-agentsgoshellbashsqldocker

Security analysis

B88/100
  • criticalModifies startup scripts or system services for persistence

Pro shows the line behind each finding and how to fix it

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill wsl2-systemd-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Wsl2 Systemd Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Wsl2 Systemd Config
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-wsl2-systemd-config/badge)](https://www.skillsdirectory.com/skills/loopyluci-wsl2-systemd-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: wsl2-systemd-config
description: "Use when enabling systemd in WSL2 distros."
category: software-development
tags: [wsl2, systemd, linux, service-management]
---
# WSL2 systemd Configuration

Enabling systemd in WSL2 distributions.

## Enable systemd

```ini
# /etc/wsl.conf (inside WSL2 distro)
[boot]
systemd=true
```

```powershell
# Restart WSL2 to apply
wsl --terminate Ubuntu
# Or:
wsl --shutdown
```

## Verify systemd

```bash
# Inside WSL2
systemctl list-units --type=service
systemctl status docker
systemctl status ssh
systemctl --version
```

## Docker with systemd

```bash
# Docker is now managed by systemd automatically
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status docker

# Check that it starts on boot
sudo systemctl is-enabled docker
```

## systemd Service Management

```bash
# Enable services that need to autostart
sudo systemctl enable ssh
sudo systemctl enable postgresql

# View all services
systemctl list-unit-files --type=service

# Journal logs
journalctl -u docker -n 50 --no-pager
journalctl -f  # follow logs
```

## Pitfalls

- systemd increases WSL2 startup time slightly
- Not all WSL2 distros support systemd (needs WSL2, not WSL1)
- Some older Ubuntu releases need manual init setup
- Docker installed via apt uses systemd when systemd is enabled
- Conflicts with /etc/init.d scripts that were used before systemd

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…