Ubuntu 17.10 uses Wayland in the default session and Xorg for optional. However, many graphical applications need to run as root so far does not launch in Wayland.
You’ll get following similar errors while running graphical applications via root:
- For some applications, e.g., Synaptic Package Manager, Grub Customizer, Gparted, and Ubuntu Tweak, they does not launch in Wayland.Or you may get following error when trying to launch them via
Failed to run *** as user root. Unable to copy the user’s Xauthorization file.
- Starting graphical application via
sudoin terminal window will get error:No protocol specified. Gtk-WARNING **: Cannot open display: :0
The most straightforward workaround is to use xhost to temporarily allow the root user to access the local user’s X session.
To do so, run command:
After running the command, these graphical applications can be launched from app launcher or via
pkexec commands until you log out.
To make this work automatically at login, search for and launch Startup Applications utility, click the “Add” button to run the command at startup:
- name: whatever
- comment: whatever