之前的困擾是
yum install vnc vnc-server
yum install tigervnc tigervnc-server
yum groupinstall "basic-desktop" "X Window System"
假設我要 vncserver 啟動給 root 透過 5909 方式遠端登入, 之前的處理方式就是先用 root 登入該主機, 然後執行
vncserver :09
第一次會需要設定密碼
將以下兩行前面的 # 取消掉
: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc :
找到 VNCSERVERS=“” 將啟動的帳號加入, 例如 root 要 Listen 5909, jonathan 要 Listen 5901
: VNCSERVERS="1:jonathan 9:root"
: VNCSERVERS="1:jonathan 9:root" VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp -localhost" VNCSERVERARGS[9]="-geometry 800x600"
chkconfig vncserver on
service vncserver start
[root@pdc-e2160 .vnc]# service vncserver start 正在啟動 VNC 伺服器: 1:jonathan New 'pdc-e2160:1 (jonathan)' desktop is pdc-e2160:1 Starting applications specified in /home/jonathan/.vnc/xstartup Log file is /home/jonathan/.vnc/pdc-e2160:1.log 9:root New 'pdc-e2160:9 (root)' desktop is pdc-e2160:9 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/pdc-e2160:9.log [ 確定 ]
service vncserver stop
[root@pdc-e2160 .vnc]# service vncserver stop 正在關閉 VNC 伺服器: 1:jonathan 9:root [ 確定 ]