Walker News

How To Configure VNC Server To Use GNOME Desktop On CentOS?

When connecting to Linux VNC server running on RHEL or CentOS, you only see a boring xterm window instead of getting access to normal Linux Desktop (GNOME Desktop, by default).

2 ways to configure Linux VNC server xstartup script to access GNOME Desktop.No worry, it can be easily fixed in no time. Let’s see how to setup Linux VNC server xstartup script to access the graphical GNOME Desktop on RHEL / CentOS:

1. Stop VNC server by execute vncserver -kill :1 (if VNC server display number is 1; otherwise replace this number accordingly).

2. Execute cd $HOME/.vnc (this hidden folder and its files are created in user’s home directory when VNC server started for the first time).

3. Create a backup copy of $HOME/.vnc/xstartup.

4. Now, there are two ways to deal with this $HOME/.vnc/xstartup script file (choose one that works for your case):

Option 1: Open $HOME/.vnc/xstartup and remove comment character “#” in front of the blue text, i.e. the file content will looks like this eventually:

# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Option 2: Overwrite $HOME/.vnc/xstartup content with these lines:

vncconfig -iconic &

if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
   eval `dbus-launch --sh-syntax --exit-with-session`
exec  gnome-session

After saving changes made to xstartup script file, you may start VNC server to test it. Now, the VNC client should be able access to GNOME Desktop of RHEL/CentOS.

Custom Search

2016  •  Privacy Policy