在CentOS下安裝配置VNC的過程 |
發(fā)布時間: 2012/8/13 10:06:05 |
1.檢查vnc客戶端和服務器是否已經(jīng)安裝: [gavin@centos~]$rpm-qvncvnc-server packagevncisnotinstalled vnc-server-4.0-8.1 centos5已包含vnc的安裝包 2.將用戶名稱加入到配置文件: (注:這里的“用戶名”是指linux系統(tǒng)用戶的名稱) [gavin@centos~]#vi/etc/sysconfig/vncservers # #UncommentthelinebelowtostartaVNCserverondisplay:1 #asmy'myusername'(adjustthistoyourown)。Youwillalso #needtosetaVNCpassword;run'manvncpasswd'toseehow #todothat. # #DONOTRUNTHISSERVICEifyourlocalareanetworkis #untrusted!ForasecurewayofusingVNC,see #http://www.uk.research.att.com/vnc/sshvnc.html>. #VNCSERVERS="1:myusername" #VNCSERVERS="1:gavin2:john"#usethemethodformoreuser VNCSERVERS="1:gavin2:root3:root" #VNCSERVERARGS[1]="-geometry800x600" VNCSERVERARGS[1]="-geometry1024x768" 3.設置用戶gavin的密碼 [gavin@centos~]$vncpasswd Password: Verify: 4.啟動VNC服務 [gavin@centos~]#/sbin/servicevncserverstart StartingVNCserver:1:gavin[OK] 5.輸入命令 [gavin@centos~]$cd~/.vnc/ [gavin@centos.vnc]$vixstartup #!/bin/sh #Uncommentthefollowingtwolinesfornormaldesktop: #unsetSESSION_MANAGER #exec/etc/X11/xinit/xinitrc [-x/etc/vnc/xstartup]&&exec/etc/vnc/xstartup [-r$HOME/.Xresources]&&xrdb$HOME/.Xresources xsetroot-solidgrey vncconfig-iconic& #xterm-geometry80x24+10+10-ls-title"$VNCDESKTOPDesktop"& gnome-session&#setstartingGNOMEdesktop #startkde&#kdedesktop #twm&#Textinterface 6.重啟vncserver [gavin@centos~]#/sbin/servicevncserverrestart ShuttingdownVNCserver:1:gavin[OK] StartingVNCserver:1:gavin[OK] 7.Windows登陸到VNCServer (1)。從IE登錄 直接從IE瀏覽器中輸入如下地址: http://xxx.xxx.xxx.xxx:5802 輸入密碼即可使用。 (2)。從VNCview登錄 在windows上安裝vncview,然后輸入xxx.xxx.xxx.xxx:2,連接登錄,輸入密碼即可。 備注:如果從vncview登錄時,提示connectionrefused(10061),則是因為linux防火墻的問題,登錄centos系統(tǒng),選擇System——>Preferences——>RemoteDesktop,勾選sharing中的兩項,Security兩項不勾,點擊關閉,然后再重新用vncview登錄即可。 本文出自:億恩科技【mszdt.com】 |