Skip to content
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

[Build] WSL2 #109

Open
markusbkk opened this issue Oct 28, 2022 · 6 comments
Open

[Build] WSL2 #109

markusbkk opened this issue Oct 28, 2022 · 6 comments

Comments

@markusbkk
Copy link

I'd like to use this issue to track my process in getting Greenfield to work under Windows 11/WSL2.

According to microsoft/WSL#938 (comment), this apparently worked before.

RN, after disabling WSLg with the following command (to be updated with a snippet that will automatically pull the Windows username. As soon as I've figured out how to properly get the Windows username from Powershell or cmd without additional characters), Greenfield proxy reports that no dev/dri interface can be found.

echo $'[wsl2]\nguiApplications=false' > /mnt/c/Users/[Windows User]/.wslconfig
@Zubnix
Copy link
Collaborator

Zubnix commented Oct 28, 2022

/dev/dri is optional. It allows for Wayland clients to be hardware accelerated and was only relatively recently added to Greenfield. The comment you posted, Greenfield didn't have support for /dev/dri at the time.

@markusbkk
Copy link
Author

markusbkk commented Oct 28, 2022

/dev/dri is optional. It allows for Wayland clients to be hardware accelerated and was only relatively recently added to Greenfield. The comment you posted, Greenfield didn't have support for /dev/dri at the time.

Makes sense. I think shutting down WSLg made it more complicated than I had thought.
Turns out, I just needed to changed the WAYLAND_DISPLAY variable (export WAYLAND_DISPLAY=wayland-1) and start Firefox (my test target ... because browser inception) with MOZ_ENABLE_WAYLAND=1 firefox.

Works properly now. Alas, a bit slow and flickery. But so does the native Wayland compositor on my machine, too.
One more question: How do I connect XWayland applications to the compositor? By default, it's still launching them through WSLg for me.

EDIT: NVM. DISPLAY is analogous to WAYLAND_DISPLAY. Just as I thought. It's not displaying xeyes for some other reasons, but Greenfield seems to work on my machine now.

EDIT2: Was apparently an XAUTH issue. After manually setting $Xauthority though, it's now stuck at Spawned XWayland Server (trying with xeyes instead of firefox)

@Zubnix
Copy link
Collaborator

Zubnix commented Oct 28, 2022

Using these steps #108 (comment) I can run xterm & xeyes

@markusbkk
Copy link
Author

Using these steps #108 (comment) I can run xterm & xeyes

Thanks again. I got it working with those steps on my WSL2 Ubuntu 20.04 system, too. Namely, the XAuthority parts helped a lot.

@Zubnix
Copy link
Collaborator

Zubnix commented Nov 10, 2022

I've done some digging on how to run this smoothly on WSLg, and it seems WSLg uses a system distro image to run Weston with a custom build of MESA to get hardware acceleration. I expect Greenfield to run faster/smooth if a similar image is used.

@Zubnix
Copy link
Collaborator

Zubnix commented Feb 17, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants