遠程調用Linux圖形化,很不錯的..
01、遠程Linux須裝圖形化
yum groupinstall -y 'Desktop' 'X Window System' #xclock試圖形化
02、安裝tigervnc-server
yum install -y tigervnc-server
03、設置vnc登錄密碼
[root@zabbix ~]# vncserver
You will require a password to access your desktops.
Password: Password must be at least 6 characters - try again Password: Password must be at least 6 characters - try again #123456 Password: Verify:
New 'zabbix:1 (root)' desktop is zabbix:1
Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/zabbix:1.log
04、修正啟動參數配置
vim /root/.vnc/xstartup
#!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # 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 & gnome-session & #gnome
注:釋掉twm,添加桌面環境。如果是kde填寫kde-session & ,gnome &
05、啟動vncserver
vncserver :1 #啟動
vncserver -kill :1 #關閉
注意:VNC服務的端口號與桌面號
VNC使用TCP端口從5900開始
桌面號為“1” ---- 端口號為5901
桌面號為“2” ---- 端口號為5902
桌面號為“3” ---- 端口號為5903
啟動多個vncserver
vncserver :2
vncserver :3
06、客戶端vnc-viewer
IP:端口(簡寫1與上面開窗口對應)
VNC-viewer:http://files.cnblogs.com/files/xiaochina/vncviewer.zip
07、切換用戶仍可以調出圖形化
172.24.0.120:2
123123
xeyes
xhost + #其他用戶也可以遠程調用圖形化 (root用戶下)
su - weblogic
xeyes #測試圖形化
08、黑屏解決方案
錯誤提示:
Starting VNC server: no displays configured
解決方案:
vim /etc/sysconfig/vncservers
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1360x768 -alwaysshared"
相關地址:
http://www.cnblogs.com/xiaochina/p/5823500.html