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

XOpenDisplay failed when running on WSL 2.2 #1592

Closed
mikelor opened this issue Apr 18, 2024 · 2 comments
Closed

XOpenDisplay failed when running on WSL 2.2 #1592

mikelor opened this issue Apr 18, 2024 · 2 comments
Labels
gui Specific to graphical user interface controls platform:wsl Specific to Windows Subsystem for Linux

Comments

@mikelor
Copy link

mikelor commented Apr 18, 2024

Version

2.4.1

Operating system

Linux

OS version or distribution

Ubuntu 22.04.4 LTS / WSL 2.2.2.0

Git hosting provider(s)

GitHub

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

None

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

When doing a git push I would expect the Github authentication popup in XWindows

This was working fine until I upgraded to WSL 2.2.2 from WSL 2.1.5.0 to fix this issue https://twitter.com/mikelor/status/1780657187649654992

Actual behavior

 ~/repos/tsathroughput   main  git push
Unhandled exception. System.Exception: XOpenDisplay failed
   at Avalonia.X11.AvaloniaX11Platform.Initialize(X11PlatformOptions options)
   at Avalonia.AvaloniaX11PlatformExtensions.<>c.<UseX11>b__0_0()
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithoutStarting()
   at GitCredentialManager.UI.AvaloniaUi.<>c__DisplayClass8_1.<ShowWindowAsync>b__1(CancellationToken appCancelToken)
   at GitCredentialManager.UI.Dispatcher.DispatcherJob.Execute(CancellationToken ct)
   at GitCredentialManager.UI.Dispatcher.DispatcherJobQueue.Run()
   at GitCredentialManager.UI.Dispatcher.Run()
   at GitCredentialManager.Program.Main(String[] args)
Aborted
Username for 'https://github.com': ^C

Logs

No response

@mikelor mikelor added the auth-issue An issue authenticating to a host label Apr 18, 2024
@mjcheetham
Copy link
Collaborator

This was working fine until I upgraded to WSL 2.2.2 from WSL 2.1.5.0

This indicates a regression and issue with WSL. Please reach out to the Windows or WSL teams.

@mjcheetham mjcheetham closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@mjcheetham mjcheetham added platform:wsl Specific to Windows Subsystem for Linux gui Specific to graphical user interface controls and removed auth-issue An issue authenticating to a host labels Apr 18, 2024
@mikelor
Copy link
Author

mikelor commented Jul 13, 2024

So after much searching I found out that the issue is related to some changes in WSL 2.2+ relating to how they handle WSL Networking. You can read all about it here. microsoft/WSL#11698 (comment)

After configuring with the recommended export, all of my Avalonia Apps work. Strange that this did not affect XEyes, GCalculator and other non Avalonia Based Apps.

export DISPLAY=$(ip route | grep default | awk '{print $3}'):0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui Specific to graphical user interface controls platform:wsl Specific to Windows Subsystem for Linux
Projects
None yet
Development

No branches or pull requests

2 participants