https://github.com/arkane-systems/genie
See Issue arkane-systems/genie#267
Patch /usr/lib/binfmt.d/WSLInterop.conf:
- From:
:WSLInterop:M::MZ::/init:F
- To:
:WSLInterop:M::MZ::/init:PF
TLDR: Use /etc/wsl.conf
Add these lines:
[boot] command = /bin/bash /opt/wsl2_init.sh
Write the following into /usr/local/bin/systemctl
#!/bin/bash
export PATH=/usr/bin:$PATH # avoid genie recursively call this wrap
genie -c /usr/bin/systemctl "$@"