microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.26k stars 310 forks source link

Ubuntu Firefox will start from wsl cmd line but won't start from Windows Start | Ubuntu | Firefox. #343

Open patfla opened 3 years ago

patfla commented 3 years ago

Environment

Microsoft Windows [Version 10.0.21390.2025]

Steps to reproduce

Windows | Start | Ubuntu | Firefox doesn't launch

(running FF from the WSL2 cmd line does work - with VcXsrv installed and running).

WSL logs:

You can access the wslg logs using explorer at: \\wsl$\<Distro-Name>\mnt\wslg (e.g.: \\wsl$\Ubuntu-20.04\mnt\wslg)

pulseaudio.log weston.log

Seems I don't have the privs to drag-and-drop versions.txt. It's probably short - let's copy the contents here.

MyId@DESKTOP-gobbledygook:/mnt/wslg$ cat versions.txt WSLg ( x86_64 ): 1.0.24+Branch.main.Sha.b42023b5fed7567955f4c6c36123a5cf22e9292a Mariner: VERSION="1.0.20210224" FreeRDP: b05321cd4e6a862aef76163a69db4e1910245736 weston: ed4f3bbbf5efbd5bde880704bc03497f2446c3f2 pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5 mesa:

Expected behavior

Firefox should launch from Start.

Actual behavior

Firefox doesn't launch from Start (but it does launch from the cmd line).

hideyukn88 commented 3 years ago

@patfla, given you are running VcXsrv, is it running via VcXsrv? Would you please try with VcXsrv disabled? thanks!

(running FF from the WSL2 cmd line does work - with VcXsrv installed and running).

patfla commented 3 years ago

Thought I might determine this by opening up VcXsrv from the Notification Area - but didn't find what I was looking for there.

Taskmgr however tells me that, yes (as I probably should have guessed), Ubuntu FF from wsl2 is running on Windows via VcXsrv.

https://imgur.com/a/GecvkPg

Again though, GIMP and Emacs do run successfully via WSLg.

patfla commented 3 years ago

Which, come to think of it, doesn't necessarily answer your question.

Yes, if I close VcXsrv, I can of course run Ubuntu FF from the wsl2 command line - but nothing appears.

hideyukn88 commented 3 years ago

Hi @patfla, thanks for checking.

Again though, GIMP and Emacs do run successfully via WSLg.

How do you determine it's running via WSLg? Does task manager show "Remote Desktop Connection" ?

I close VcXsrv

I'm not familiar with VcXsrv, but I guess it might still interfere with our X socket even it's closed (or not running) unless it's uninstalled/removed ? Are you able to install separate fresh install of Ubuntu on WSL and if that works?

Currently we don't support co-existing with other X server solution (yet), while it might be possible by having separate X socket (for example, :0 is WSLg and :1 for VcXsrv), but we haven't had though through yet.

Thanks for trying out WSLg!

patfla commented 3 years ago

Hi @hideyukn88,

Hi @patfla, thanks for checking.

Again though, GIMP and Emacs do run successfully via WSLg.

How do you determine it's running via WSLg? Does task manager show "Remote Desktop Connection" ?

Yes, I can see in taskmgr that GIMP and Emacs run through rdp.

I close VcXsrv

I'm not familiar with VcXsrv, but I guess it might still interfere with our X socket even it's closed (or not running) unless it's uninstalled/removed ? Are you able to install separate fresh install of Ubuntu on WSL and if that works?

Currently we don't support co-existing with other X server solution (yet), while it might be possible by having separate X socket (for example, :0 is WSLg and :1 for VcXsrv), but we haven't had though through yet.

Thanks for trying out WSLg!

I'll temporarily remove VcXsrv and try Ubuntu Firefox again and post what I find.

Pat

patfla commented 3 years ago

Uninstalled VcXsrv and rebooted for good measure. Ubuntu FF still fails to run from Windows | Start. Although I'm on Windows Insider and, as of yesterday, that has me at Windows 11 and I'm still adjusting to how things have moved around. In this case, though, not much.

Wonder what the log files on Ubuntu, and in /mnt/wslg, might tell me? ls -lart seems to say that weston.log is the most recently updated and I watch, as I launch WSLg apps, a log file at a time with tail -f. Weston.log then others such as stderr.log.

Launching GIMP produces these four lines in weston.txt:

[12:45:19.869] set_position_from_xwayland: XWM 479, 259; geometry 32, 32; view 447, 227 [12:45:19.918] Client: ClientGetAppidReq: pid:159 appId:Gimp-2.10 [12:45:20.735] set_position_from_xwayland: XWM 376, 65; geometry 32, 32; view 344, 33 [12:45:20.766] Client: ClientGetAppidReq: pid:159 appId:Gimp-2.10

Launching WSLg Firefox produces no messages in weston.log. Wonder where I'd see log messages corresponding to a failed Firefox launch?

hideyukn88 commented 3 years ago

@patfla, when Firefox is started, it's expected to be logged like below in weston.log.

[11:19:38.411] Client: ClientGetAppidReq: pid:4192 appId:Firefox

Without VcXsrv, can you run Firefox from Linux command terminal using WSLg? This might give more info since it outputs some info to console (stdout/err), if it doesn't help, you can run with -g option (like firefox -g) under debugger and see if Firefox is successfully running. thanks!

patfla commented 3 years ago

@hideyukn88,

@patfla, when Firefox is started, it's expected to be logged like below in weston.log.

[11:19:38.411] Client: ClientGetAppidReq: pid:4192 appId:Firefox

Without VcXsrv, can you run Firefox from Linux command terminal using WSLg? This might give more info since it outputs some info to console (stdout/err), if it doesn't help, you can run with -g option (like firefox -g) under debugger and see if Firefox is successfully running. thanks!

No, without VcXsrc, it won't run from the cmd line. When I run just firefox it hangs with no message. When I run firefox -g it exits - also without messages.

It's keeping its silence. Started to look around to remember where linux keeps its system logs. Not remembering just which log viewer is which I install gnome-system-log - but it too, like firefox, won't run on the basis of WSLg. Will it run with VcXsrc - yes but it tells me that it can't open many of the log files it needs. It shows me dpkg.log which isn't of interest here. Along the way I notice that my WSL Ubuntu installation has no /var/log/messages - and no other likely candidates in /var/log.

Etc, etc.

patfla commented 3 years ago

I believe the 11 upgrade advertised a new version of WSL - however, none of my WSLg launches have changed, and still have to use VcXsrv to run Firefox from Ubuntu. Is anyone still looking at this?

Masamune3210 commented 3 years ago

Did you try updating wsl after upgrading to 11?

patfla commented 3 years ago

I thought, from messages I saw that that was bundled into the 11 upgrade, but let me double-check:

D:\WSL>wsl --update Checking for updates... No updates are available. Kernel version: 5.10.43

spronovo commented 3 years ago

Hi @patfla, it sounds like VcXsrv might have left some configuration settings in your initialization script. After uninstalling VcXsrv, can you look at the following wiki to determine if there is a problem with your WSLg X11/Wayland connection... i suspect the DISPLAY environment variable is being incorrectly initialize.

patfla commented 3 years ago

@spronovo - thanks.

I set my DISPLAY variable with the following in ~/.bashrc

blahblah@DESKTOP-930EG0A:~$ grep -i display .bashrc export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 blahblah@DESKTOP-930EG0A:~$ echo $DISPLAY 192.168.32.1:0 blahblah@DESKTOP-930EG0A:~$

This works reliably with VcXsrv.

It occurs to me ...

Temporarily commented that line out of my .bashrc and tried running Ubuntu FF again. No joy. As before, GIMP works but Firefox does not.

Tried everything in your wayland post. All the points you suggest check out. If you like I can write it up and make a ticket as the post recommends.

Here's a thing though about the X DISPLAY - GIMP (and other apps) run but Firefox does not.

I did all the wayland stuff with

export DISPLAY=:0

in my .bashrc.