Linux5.4下vncserver的安裝

kuqlan發表於2012-04-12

在linux系統下安裝VNC Server,大多數linux發行版都帶了VNC Server的發行包.只要選擇安裝就可以了.在Windows下安裝VNC 客戶端

[root@localhost ~]# cd /root

[root@localhost ~]# cd .vnc

-bash: cd: .vnc: No such file or directory

[@more@]

[root@localhost ~]# cd /media/

.hal-mtab .hal-mtab-lock RHEL_5.4 x86_64 DVD/

[root@localhost ~]# cd /media/RHEL_5.4 x86_64 DVD/

[root@localhost RHEL_5.4 x86_64 DVD]# cd Server/

[root@localhost Server]# ls -alh |grep vnc-

vnc-4.1.2-14.el5_3.1.x86_64.rpm vnc-server-4.1.2-14.el5_3.1.x86_64.rpm

[root@localhost Server]# rpm -ivh vnc-4.1.2-14.el5_3.1.x86_64.rpm

warning: vnc-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

package vnc-4.1.2-14.el5_3.1.x86_64 is already installed

[root@localhost Server]# rpm -ivh vnc-server-4.1.2-14.el5_3.1.x86_64.rpm

warning: vnc-server-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

package vnc-server-4.1.2-14.el5_3.1.x86_64 is already installed

[root@localhost Server]#

[root@node2 ~]# vncserver

You will require a password to access your desktops.

Password:

Verify:

xauth: creating new authority file /root/.Xauthority

New 'node2:1 (root)' desktop is node2:1

Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/node2:1.log

修改xstartup檔案(只修改標紅部分)

[root@node2 ~]# 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 &

gnome-session &

~

按照文件紅色部分更改。

儲存後重啟系統生效,也可以再次開啟一個nvc終端生效

[root@node2 ~]# vncserver :3

New 'node2:3 (root)' desktop is node2:3

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/node2:3.log

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1057892/,如需轉載,請註明出處,否則將追究法律責任。

相關文章