CentOS6.4下VNC Server最簡配置vim
環境:centos
CentOS 6.4 Final,桌面安裝了除KDE的全部組件app
一、安裝服務工具
yum install tigervnc-serverspa
名字有點怪哦,CentOS5前叫vnc-serverrest
二、運行並設置密碼orm
vncserver :1server
輸入密碼,會生成相關的文件ip
xauth: creating new authority file /root/.Xauthorityci
New 'centos6-244:1 (root)' desktop is centos6-244:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/centos6-244:1.log
三、配置用戶
vim /etc/sysconfig/vncservers
最後一行加入:
VNCSERVERS="1:root" 多個用戶用空格分開,並要先su - 到那個用戶運行vncserver :n來設定配置文件和密碼
四、實用命令
usage: vncserver [:] [-name ] [-depth ]
[-geometry x]
[-pixelformat rgbNNN|bgrNNN]
[-fp ]
[-fg]
...
vncserver -kill
vncserver -list
vncserver[:n]開服務
vncserver -list看有幾個在運行
vncserver -kill :n 殺掉第幾個x-display
vncpasswd 修改密碼
五、服務管理
service vncserver restart
其它用法:/etc/init.d/vncserver {start|stop|restart|try-restart|status|force-reload}
chkconfig vncserver on 加入到自啓動(chkconfig --level 35 vncserver on)
六、客戶端鏈接
CentOS:使用TigerVNC Viewer 鏈接 ip:1
Windows:使用Real VNC Viewer 鏈接ip:1
輸入密碼便可訪問
關閉虛擬機防火牆:
關閉命令: service iptables stop
永久關閉防火牆:chkconfig iptables off
兩個命令同時運行,運行完成後查看防火牆關閉狀態
service iptables status
1 關閉防火牆-----service iptables stop
2 啓動防火牆-----service iptables start
3 重啓防火牆-----service iptables restart
4 查看防火牆狀態--service iptables status
5 永久關閉防火牆--chkconfig iptables off
6 永久關閉後啓用--chkconfig iptables on
客戶端工具
http://www.realvnc.com/download/viewer/