Commit cbdea24
fix(wsl2): fix boot, logind loop, hostname, and wsl.conf path
Critical WSL2 fixes:
1. Move wsl.conf to /etc/wsl.conf — WSL2 reads /etc/wsl.conf only;
/usr/lib/wsl.conf was silently ignored, meaning [user] default=mios
and [boot] systemd=true were never applied (hostname = container ID,
login defaulted to root). Update .gitignore to whitelist etc/wsl.conf.
Leave usr/lib/wsl.conf as a reference-only stub.
2. systemd-logind WSL2 drop-in — logind crashes in WSL2 (no VT devices)
and retried indefinitely. Add ConditionVirtualization=!wsl drop-in to
prevent the restart loop visible in the boot log.
3. boot.mount + boot-complete.target drop-ins — CoreOS's dynamic /boot
mount requires /dev/disk/by-label/boot which doesn't exist in WSL2.
Mask both units in WSL2; their dependents already had drop-ins.
4. Fix hostname in wsl-firstboot — hostnamectl requires logind (now masked
in WSL2). Write /etc/hostname and call hostname(1) directly instead, so
the configured MIOS_HOSTNAME is applied unconditionally.
5. Drop-ins for qemu-guest-agent, cloud-init-local/network/config — mask
these services in WSL2 to eliminate boot noise and failed-unit clutter.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 16f5353 commit cbdea24
11 files changed
Lines changed: 43 additions & 21 deletions
File tree
- etc
- usr
- libexec/mios
- lib
- systemd/system
- boot-complete.target.d
- boot.mount.d
- cloud-config.service.d
- cloud-init-local.service.d
- cloud-init-network.service.d
- qemu-guest-agent.service.d
- systemd-logind.service.d
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments