I have recently installed Ubuntu 17.10 and every time I try to open a graphical app as root (with sudo) these are the error messages that come out.
I have already tried xhost +chips
(my username) and xhost +root
but this is the error message that I get: xhost: bad hostname "root"
.
chips@DELL:~$ sudo nautilus
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused
(nautilus:2254): Gtk-WARNING **: cannot open display: :0
chips@DELL:~$ sudo wireshark
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Invalid MIT-MAGIC-COOKIE-1 keyQXcbConnection: Could not connect to display :0
Aborted
chips@DELL:~$ sudo rhythmbox
error: XDG_RUNTIME_DIR not set in the environment.
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused
Cannot open display:
Run 'rhythmbox --help' to see a full list of available command line options.
nautilus admin:///
(to access/
), in generalnautilus admin://<path-to-directory>
? – pomsky Oct 28 '17 at 18:18nautilus admin:///
asks for my password and then it starts, but I need it to be working with sudo – Chips Oct 28 '17 at 18:22