“Unable to open display ” “” error on VNC Server

Published on Author Code Father

Install the following packages:

yum install pixman pixman-devel libXfont tigervnc-server.x86_64 -y

Edit the file /etc/sysconfig/vncservers and add the following lines:

VNCSERVERS="6:<LOGIN_NAME>"
VNCSERVERARGS[6]="-geometry 1152x864"

In the first line, “6:” means that the vnc server daemon will listen on port 590[6] and will log into the specified user’s desktop.

Example:

Having “5:itai” there will make the server listen on port 590[5] and connect to itai’s desktop.

Then run in order to make sure vncserver starts with boot:

chkconfig vncserver on

Then, set a password for that user, run it from the user’s shell (the user you specified in /etc/sysconfig/vncservers):

/usr/bin/vncpasswd

And restart the daemon:

/etc/init.d/vncserver start

Edit #1:

It seems like you installed only the Desktop packages, as far as I know you will need these as well:

yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"

Then run:

init 5
startx

Comments

comments