除了这里的其他答案,我还必须使用以下脚本修改我的 xstartup 脚本:
#!/bin/sh
# Change "GNOME" to "KDE" for a KDE desktop, or "" for a generic desktop
MODE=""
#Uncommment this line if using Gnome and your keyboard mappings are incorrect.
#export XKL_XMODMAP_DISABLE=1
# Load X resources (if any)
if [ -e "$HOME/.Xresources" ]
then
xrdb "$HOME/.Xresources"
fi
# Try a GNOME session, or fall back to KDE
if [ "GNOME" = "$MODE" ]
then
if which gnome-session >/dev/null
then
gnome-session --session=ubuntu-2d &
else
MODE="KDE"
fi
fi
# Try a KDE session, or fall back to generic
if [ "KDE" = "$MODE" ]
then
if which startkde >/dev/null
then
startkde &
else
MODE=""
fi
fi
# Run a generic session
if [ -z "$MODE" ]
then
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
fi
我用这个网站来帮助我: http: //ubuntuforums.org/archive/index.php/t-2131958.html。但我必须根据我的情况调整它,因为我使用的是基于 CentOS 的 Rocks Cluster 发行版。