1. 下载vnc服务器
    [[email protected] ~]$ sudo pacman -S tigervnc
    
  2. 初始化vnc服务器,开机自启
    [[email protected] ~]$ vncserver
    [[email protected] ~]$ sudo systemctl enable vncserver
    
  3. 修改配置文件
[[email protected] ~]$ nano /home/yuzuki/.vnc/xstartup

将以下内容修改为:

#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
  case "$WINDOWMANAGER" in
    *gnome*)
      if [ -e /etc/SuSE-release ]; then
        PATH=$PATH:/opt/gnome/bin
        export PATH
      fi
      ;;
  esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
  exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
  exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
  case "$WINDOWMANAGER" in
    *gnome*)
      if [ -e /etc/SuSE-release ]; then
        PATH=$PATH:/opt/gnome/bin
        export PATH
      fi
      ;;
  esac
fi
# 这里选择你的桌面环境,其他版本桌面不通用
# xfce:
startxfce4 &
# gnome
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
# kde
startkde &