-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu 24.04 Wayland falling back to X11 #1244
Comments
Some more context if I try to explicitly set the GDK_BACKEND as follows I just get the following console output, no window is opened, and the program terminates.
|
On 22.04 I do not need to use weston. I can also just use emacs without pgtk but this should be something that works |
Due to a bug of systemd fixed in 24.04, you must do :
Or use an autostart conf : https://github.com/viruscamp/wslg-links BTW, It's real that wayland working in 22.04@WSL depends a bug of systemd. |
Yeah I'm not having any luck with the symlink. This is still happening #1244 (comment) A weird quirk is that creating this symlink under your user account doesn't work (symlink is red in ls) but creating it when su'd into ubuntu the symlink creation works (symlink is blue in ls) but it still can't open the app. |
The fix provided by @viruscamp makes emacs work on wayland instead of Xwayland: Your Thanks @viruscamp! |
Perhaps I'm running into this issue ubuntu/WSL#468 because I would have just used the ubuntu username but it complains that user already exists? How are you installing 24.04? Are you updating from an existing 22.04? |
I think you met the bug.
You can see that uid=1000 is ubuntu . WSLg works only for uid=1000. That another bug of WSLg. Ubuntu's fix only applies to new install of 24.04. Maybe there is only unstable and insecure method:
|
Yes all of my attempts to use 24.04 on WSL have been fresh installs. The fixes @viruscamp linked are working on the ubuntu user. I'm just running into the user bug still with installing 24.04 fresh. (I removed the 24.04 app and reinstalled from winget) Is there some Windows or WSL update I have not gotten? |
I guess the fixed wsl-setup package has not been put into the install image of ubuntu 24.04 for WSL. We'd better wait them to publish a new image. |
@avlec you're correct, wslg already starts a compositor:
Looks like the Ubuntu-24.04 switches to cloud-init and has user id=1000 defined in the cloud.cfg:
and the installer is creating a user with id=1002 messing up wslg which is hardcoded to user id=1000. If you want to fix it and use emacs-pgtk with wayland backend just edit emacs-pgtk works, after applying @viruscamp fix: |
Yes @elsaco that's where we've gotten to. Just don't know what @zcobol did to have it working without hacking the user/groups. Note: an easier hack is to create a 24.04 and use a throw away username and then just do the registry edit trick to change the DefaultUid then you can login as ubuntu and apply viruscamp's fix @viruscamp is there any issue anywhere tracking the problem you fixed? |
I just did a clean install of Ubuntu 24.04 and applied viruscamp's fix and
Linls are valid But when I run google-chrome as the ubuntu user (id: 1000) I get:
Does anyone know why or have any suggestions on the best way to debug? wsl --version shows:
|
I had a issue " Error: Can't open display: " when I tried to run applications. Resolved: step 1: Windows 11, open Powershell with Run as Administrator, Command line: I don't know if this will help you. |
@mwoodpatrick Try to enable |
To work around the user id issue, I used cloud-init customization Created file
Then destroyed my wsl environment, and recreated it this way
Installed firefox, and it will be using xwayland Apply the fix from @viruscamp Firefox now runs fine with full wayland support To make it run permanent, add it to /etc/bash.bashrc For bonus point, add that step to cloud-init
BUT
UPDATE Would appreciate it if someone could test this with a WDDM 3.x driver on windows 11... |
I'm on Debian (12.6) in wsl and emacs 29.2 doesn't launch per above, so it's not just an Ubuntu issue. I compiled emacs locally (using But confirm @viruscamp workaround works #1244 (comment). |
I do not see authoritative Microsoft response / acknowledge of this issue nor in microsoft/WSL#11261, is there anything else @microsoft needs to attend this issue and fix it properly? |
It may be very wrong, but can't I just set |
I get these messages still on windows 11, but glxgears works. `$ glxgears ` |
This command works for me. But I have to run it every time WSL restarts itself to open up the app, otherwise it doesn't open. So is there anyway I can automate it? If I add it into my zshrc it opens the "Oh No! Something went wrong" screen. |
for Ubuntu, there is a packaged named =wsl-config=, I think it might be a good idea to integrate these tweaks into that, and also as a Debian user, I would love it if it could be migrated to Debian. |
Could you please send the link to that? I would love to check it out. |
https://packages.ubuntu.com/noble/wsl-setup FYI. but this might be somehow off-topic I think. |
I have similar issues. I was using Ubuntu 22.04 under wayland and now Ubuntu 24.04 runs under X11 for some reason. If anyone finds any solutions I'm interested. |
@Souvlaki42 for now this command works |
@TarunDaCoder I think I've tried this before and didn't but after a fresh install of WSL2 it worked now. |
Hey, glad to hear it worked!
Yeah, I am facing that issue as well, but if I put it in my |
@TarunDaCoder in the issue linked by @alonbl (microsoft/WSL#11261), the issue description shows the steps to make a systemd oneshot service to create those symlinks, have you tried that workaround? |
Windows build number:
10.0.22621.0
Your Distribution version:
24.04
Your WSL versions:
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.3296
Steps to reproduce:
wsl --install Ubuntu-24.04
sudo apt update
sudo apt install emacs-pgtk
(or other GTK app)
emacs
WSL logs:
stderr.log
weston.log
pulseaudio.log
WSL dumps:
No response
Expected behavior:
Emacs or whatever GUI application to launch using Wayland and not Xwayland
Actual behavior:
Outputs the following and falls back to xorg display frames.
The text was updated successfully, but these errors were encountered: