Ubuntu 17.10: sudo / gksu / gksudo not working, cannot open display

In case you try to start any application under Ubuntu and you get something like that:

fpanzer@nb-fpanzer:~$ sudo gsmartcontrol
No protocol specified
Unable to init server: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt

(gsmartcontrol:4153): Gtk-WARNING **: cannot open display: :0

Try to allow “root” to run applications under your (user-)display:

xhost +SI:localuser:root

Update: if you disable Wayland, things magically start working as they should. Disable Wayland, it sucks. Just use xorg.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.