要遠程向redhat Linux安裝軟件,但不得不用圖形時怎麼辦?我們可以用VNC來實現,配置起來也非常方便快捷。
下面介紹配置步驟:
1、RHEL5.6默認已安裝了VNC Server,驗證方法
[root@saimpc ~]# rpm -qa vnc-server
vnc-server-4.1.2-14.el5_5.4
2、啓動VNC Server服務
[root@saimpc ~]# vncserver :1
在第一次啓動時會提示輸入密碼,請記住,登錄時用到。
VNC第1個桌面的端口號爲5901,以類推第n個桌面的端口號爲590n
VNC第1個基於JAVA的桌面端口號爲5801,第n個爲580n
3、驗證VNC Server服務
提前在客戶端中安裝JAVA。
在瀏覽器中輸入http://192.168.1.123:5801 (192.168.1.123爲服務器地址)
輸入服務器IP地址,點擊OK
輸入密碼
如果能看到命令介面,到此時說明一切正常。要看到最終圖形介面還得繼續設置
4、設置圖形模式
[root@saimpc ~]# vi /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 &
5、重啓VNC Server服務
[root@saimpc ~]# vncserver -kill :1
Killing Xvnc process ID 4849
[root@saimpc ~]# vncserver :1
New 'saimpc:1 (root)' desktop is saimpc:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/saimpc:1.log
6、登錄VNC Server
再次在瀏覽器中輸入http://192.168.1.123:1並輸入用戶和密碼。驚喜的事出來了,自動彈出了Linux的桌面。
接下來就可以任意操作Linux的桌面了
也可以使用VNC Viewer登錄,在地址中輸入:192.168.1.123:5901