How to install VNC server on CentOS 6

來源:互聯網
上載者:User

標籤:

參考: https://rbgeek.wordpress.com/2012/06/26/how-to-install-vnc-server-on-centos-6/

VNC is a protocol that is used to share the desktop with other users/computers over the network/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop.

When we install the minimal copy of CentOS Server, it only gives us the “Command Line” interface.
But some people prefer GUI instead and for this they install Full version of Gnome on CentOS. Actually there is a better way and that is to install VNC. VNC provides a lightweight virtual desktop than full blown version of Gnome.

To run the VNC Server on CentOS, we have to install these required packages:
sudo yum groupinstall Desktop
sudo yum install tigervnc-server
sudo yum install xorg-x11-fonts-Type1

This is optional:
sudo yum install vnc

To start VNC Server on boot
sudo chkconfig vncserver on
To setup users’ VNC password:

vncpasswd
Edit the /etc/sysconfig/vncservers file:
sudo nano /etc/sysconfig/vncservers

Add the following to the end of the file:
VNCSERVERS=“1:root”
VNCSERVERARGS[1]="-geometry 1024x600"

The iptables rules need to be amended to open the VNC ports:
sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT 去掉5後運行正常
sudo service iptables save
sudo service iptables restart

Restart the VNC Server:
sudo service vncserver restart

Now kill the VNC Server:
vncserver -kill :1

Edit the xstartup file in .vnc directory:
nano .vnc/xstartup

Comment the last line and run the Gnome:
#twm &
exec gnome-session & 有的檔案中不存在這一行

Restart the service:
sudo service vncserver restart

sudo service vncserver stop 關閉服務後節省資源

編輯 /etc/inittab 給設定啟動cli還是gui

How to install VNC server on CentOS 6

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.