No protocol specified gedit6/23/2023 ![]() I am using a VcXsrv X Server (and have tried Xming too previously). I have been reading up online about similar problems but have not yet found a solution. I have Ubuntu 20.04.3 with X11 installed but am getting the following issue when I try to test with xeyes (the same happens with any other graphical application I use). (gedit:2349): Gtk-WARNING **: cannot open display: :0īefore Wayland, running GUI applications with elevated privileges could be properly implemented by creating a Polkit policy, or more dangerously done by running the command in a terminal by prepending the command with sudo but under (X)Wayland this does not work anymore as the default has been made to only allow the user who started the X server to connect clients to it (see the bug report and the upstream commits it refers to).Ī more versatile though more insecure workaround allows any graphical application to be run as root #Using xhost.I am having trouble with graphical applications and WSL. Unable to init server: Could not connect: Connection refused GParted or Gedit), will fail with an error similar to this: Trying to run a graphical application as root via su, sudo or pkexec in a Wayland session (e.g. Where appname is the name of the particular app. ![]() # XAUTHORITY=/home/ username/.Xauthority appname This will permanently allow root to connect to a non-root user's X server. etc/profile export XAUTHORITY=/home/ username/.Xauthority Then switch to your root user using su or su. To both /etc/pam.d/su and /etc/pam.d/su-l. Permanently allow root access Method 1: Add the line session optional pam_xauth.so Xhost can be used to temporarily allow root access. If you are behind a firewall, you may consider them to be safe enough for your requirements. These methods will allow root to connect to a non-root user's X server, but present varying levels of security risks, especially if you run ssh.
0 Comments
Leave a Reply. |