WhitewaterFoundry / Fedora-Remix-for-WSL

Fedora Remix for Windows Subsystem for Linux.
Other
693 stars 51 forks source link

Cannot open any gui apps #169

Closed MrErr closed 1 year ago

MrErr commented 1 year ago

Describe the bug Cannot open any gui apps like gedit or gvim

To Reproduce Steps to reproduce the behavior:

  1. start wsl in windows terminal
  2. type "gedit"

Expected behavior I expect the gedit window to open.

Screenshots

Additional context I also have vcxsrv running on display 0.0

Basic Troubleshooting Checklist

What other troubleshooting have you attempted?

I have tried Xming xserver. That too failed exactly the same way.

WLinux Version

Find: Settings->Apps->Apps & features->WLinux->Advanced Options->Version.

0.66.2.0

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here: OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22000 N/A Build 22000 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free BIOS Version: American Megatrends International, LLC. 5.19, 10/11/2021

For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number

crramirez commented 1 year ago

Hello @MrErr,

With Windows 11, it should work even without VcXsrv. Please tell me the output of

echo $DISPLAY

It should be :0.0

MrErr commented 1 year ago

echo $DISPLAY :0.0

gedit magically now works, but gvim does not work. With gvim, i get the message Vim: Caught deadly signal SEGV Vim: Finished. E852: The child process failed to start the GUI

Why would the two apps be treated differently?

crramirez commented 1 year ago

OK you hace the right configuration to use WSLg.

The reason why some apps work and other don't is because two main things:

  1. WSLg is too New and also has many components and complexity that leads to many border cases that are being address es progresively. You can check the issues in the wslg GitHub project.

  2. WSLg is based on Wayland not X11, in the middle there is a gateway called XWayland for X based apps. Some apps still have issues with it.

If you want to skip WSLg and use VcXsrv, run this command to disable it:

echo 'unset DISPLAY' | sudo tee /etc/profile.d/00-nowslg.sh

Restart Fedora and be sure you have the VcXsrv running. Then try your apps again.

Hope it helps.

MrErr commented 1 year ago

Thank you this worked!

MrErr commented 1 year ago

I have updated to fedora 37 using the instructions on the whitefoundry blog. Now i am running into the problem again where gvim or gedit do not open, but xterm works.

Below are output from the command line

[irlapati@andes-wsl 514]>gvim Vim: Caught deadly signal SEGV Vim: Finished. E852: The child process failed to start the GUI Press ENTER or type command to continue [2023-01-06:14:34:38 ~] [irlapati@andes-wsl 515]>gedit Segmentation fault (core dumped) [2023-01-06:14:34:38 ~] [irlapati@andes-wsl 516]>xterm [2023-01-06:14:34:38 ~] [irlapati@andes-wsl 517]>

Any help would be appreciated.

crramirez commented 1 year ago

Could you do a unset WAYLAND_DISPLAY ? and try again?

also please execute wsl.exe --version

MrErr commented 1 year ago

PS C:\Users\Sam Irlapati> wsl --version WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.963 PS C:\Users\Sam Irlapati>

WAYLAND_DISPLAY was unset.

But I got it to work in the strangest way possible, meaning there is a bug somewhere.

I am using the latest version of VcXsvr.

To get it work, I launch fedoraremix in windows terminal. Initially typing gvim will not open a new window. Next I ssh into a remote fedora machine from fedoraremix and open a gvim windows and it opens up. Now I log out off the remote machine and am back at the fedoraremix prompt and typing gvim opens a new a window! After this no matter how many terminal of fedoraremix I open, launching of gui apps work.

I hope this helps you or someone else that might have the same problem.

crramirez commented 1 year ago

OK, since you are using VcXsrv I recommend you to disable WSLg in Fedora Remix with a new option in /etc/wsl.conf

Add to your /etc/wsl.conf

[general]
guiApplications=false

Terminate fedora remix with wsl.exe --terminate fedoraremix

And try again