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

UI fails to run when launched with sudo in Linux enviroment #9601

Closed
BlakePeavy opened this issue Dec 2, 2022 · 2 comments
Closed

UI fails to run when launched with sudo in Linux enviroment #9601

BlakePeavy opened this issue Dec 2, 2022 · 2 comments
Labels

Comments

@BlakePeavy
Copy link

When launching a UI with the sudo command (ex. "sudo dotnet myapp.dll" or "sudo -s" "dotnet myapp.dll") the build seemingly fails.

This can be reproduced with any basic application, in my particular case it requires superuser access. Running as a user runs as expected (aside from permission issues from my client dll which isn't related to any UI issues).

Desktop (please complete the following information):

  • Ubuntu 62 bit
  • Ubuntu 22.04.1 LTS
Unhandled exception. System.Exception: XOpenDisplay failed
   at Avalonia.X11.AvaloniaX11Platform.Initialize(X11PlatformOptions options) in /_/src/Avalonia.X11/X11Platform.cs:line 57
   at Avalonia.AvaloniaX11PlatformExtensions.<>c__0`1.<UseX11>b__0_0() in /_/src/Avalonia.X11/X11Platform.cs:line 280
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 303
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 179
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 208
   at myapp.Program.Main(String[] args) in C:\git\myapp\Program.cs:line 14
@BlakePeavy BlakePeavy added the bug label Dec 2, 2022
@kekekeks
Copy link
Member

kekekeks commented Dec 3, 2022

Check if xterm works with sudo on your Linux machine.

@kekekeks
Copy link
Member

kekekeks commented Jul 3, 2023

XOpenDisplay means a failure to connect to X11, so it's an environment issue

@kekekeks kekekeks closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants