Skip to content

Commit 051a1fb

Browse files
Fubuchisileshn
Fubuchi
authored andcommitted
Allow systemd and wslg to co-exist
1 parent bce3aa8 commit 051a1fb

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ rootfs: base.tar
4141
@echo "# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line." | sudo tee rootfs/etc/resolv.conf > /dev/null
4242
sudo cp wsl.conf rootfs/etc/wsl.conf
4343
sudo cp bash_profile rootfs/root/.bash_profile
44+
sudo cp wslg-init.service rootfs/usr/lib/systemd/system/wslg-init.service
4445
sudo chmod +x rootfs
4546

4647
base.tar:

bash_profile

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ if [ "$disksize" -le 274877906944 ]; then
113113
done
114114
fi
115115

116+
sudo systemctl daemon-reload
117+
sudo systemctl enable wslg-init.service >/dev/null 2>&1
118+
116119
echo -e ${grn}"Do you want to create a new user?"${txtrst}
117120
select yn in "Yes" "No"; do
118121
case $yn in

wslg-init.service

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=symlink /tmp/.X11-unix
3+
After=systemd-tmpfiles-setup.service
4+
5+
[Service]
6+
Type=oneshot
7+
ExecStart=rmdir /tmp/.X11-unix
8+
ExecStart=ln -s /mnt/wslg/.X11-unix /tmp/
9+
10+
[Install]
11+
WantedBy=sysinit.target

0 commit comments

Comments
 (0)