Friday, February 23, 2018

Cannot open display Error when using VNC

After opening VNC Viewer on MS Windows 10 and connecting to the Centos 7, the desktop appears as planned. However, there is an error when running some apps such as system-config-printer. The error is

Gtk-WARNING **: cannot open display:1

Good to note that the VNC server was providing the session at display 1 on port 5901. If you are running the display on another port, it wouldn't matter.

Solution:

At the user's terminal (AND as that user NOT sudo or root), add localhost to the xhost permission. Type

$ xhost +localhost

And this allows system-config-printer to run.


No comments:

Blog Archive