DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 382 forks source link

breaks wslg #55

Open gtsteffaniak opened 3 years ago

gtsteffaniak commented 3 years ago

Running the script works to enable systemd. In both 18.04 and 20.04 , this breaks the environment variables that enable wsl gui apps provided by microsoft.

Intead you get display errors when starting from the terminal:

**graham@GrahamBook:~$** sudo virt-manager
[sudo] password for graham:
**graham@GrahamBook:~$** \

(virt-manager:387): Gtk-WARNING **: 08:41:36.307: cannot open display: :0

When running using the wslg shortcuts, it works:

C:\Windows\System32\wslg.exe ~ -d Ubuntu-18.04 virt-manager
pearj commented 3 years ago

Perhaps the environment variables mentioned here: https://github.com/microsoft/wslg#wslg-system-distro

Need to be be added here:

https://github.com/DamionGans/ubuntu-wsl2-systemd-script/blob/master/ubuntu-wsl2-systemd-script.sh#L61-L66

UGatgithub commented 3 years ago

I can confirm that it does not work with wslg. Tried using it following this approach containing the script and added the error I got there and I think the solution to THE PARENT INIT PROCESS AND SHARED DBUS INSTANCE PROBLEM should finally make this script obsolete for wslg.

cerebrate commented 3 years ago

There are a few more things you have to do to get WSLg fully operational under systemd. Here's a description of how I solved it for genie:

https://github.com/microsoft/wslg/discussions/144#discussioncomment-685578

dangolbeeker commented 3 years ago

Same issue all microsoft apps crashing had to uninstall Kali from app store and reinstall Win 10 Pro 19042.985