Linux Red Hat 5.6 and VNC: KDE & Gnome

Issue

I am using Red Hat 5.6 and I have configured VNC for my Unix user with no issues. I am able to log into it and it defaults to Gnome. KDE is installed on the machine and I would like to use it. Below is my ~/.vnc/xstartup file.

I tried replacing twm below with “startkde &” but it didn’t work. Gnome seems to be the default desktop even though twm is shown below and even once I change it, it doesn’t work. Even with no desktop listed, Gnome still starts.

Does anyone know why this is happening and how I can start other desktops?

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
vncconfig -nowin &
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 &

Solution

The script is never getting to the bottom part, as ‘exec’ causes the current process to be replaced by the target of the exec, in this case the script /etc/X11/xinit/xinitrc, which sources the /etc/X11/Xsession script, which in turn does run-parts of /etc/X11/Xsession.d, invoking the default x-session-manager, which is gnome-session.

Answered By – sixerjman

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published