ubuntu-wsl2-systemd-script icon indicating copy to clipboard operation
ubuntu-wsl2-systemd-script copied to clipboard

breaks wslg

Open gtsteffaniak opened this issue 4 years ago • 4 comments
trafficstars

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

gtsteffaniak avatar Apr 29 '21 13:04 gtsteffaniak

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

pearj avatar Apr 30 '21 05:04 pearj

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.

UGatgithub avatar May 02 '21 10:05 UGatgithub

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

cerebrate avatar May 02 '21 18:05 cerebrate

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

dangolbeeker avatar May 17 '21 14:05 dangolbeeker