1. 下载vnc服务器
[yuzuki@YuzukiTsuru ~]$ sudo pacman -S tigervnc
  1. 初始化vnc服务器,开机自启
[yuzuki@YuzukiTsuru ~]$ vncserver
[yuzuki@YuzukiTsuru ~]$ sudo systemctl enable vncserver
  1. 修改配置文件
[yuzuki@YuzukiTsuru ~]$ 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 &