centos6.5 Installing VNC

Source: Internet
Author: User
Tags i18n

Using VNC Remote Desktop under Linux is a great thing. However, VNC is not installed by default in CentOS. You can use the following statement to query if the following scenario indicates that VNC is not installed

#rpm-Q Tigervnc tigervnc-server

Package Tigervnc are not installed

Package tigervnc-server are not installed

1. Installation of VNC service

Yum Install Tigervnc tigervnc-server

Then just wait for the installation to complete. 2. Set the weekly password for Vncserver

[email protected]. LINUXIDC. COM ~]# Vncserver
You 'll require a password to access your desktops.
Password:< Enter vnc login password >
Verify:< re-enter vnc login password >


3, configuration vnc in order to prevent black screen, need to modify the/root/.vnc/xstartup. Note the following two lines #xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &
#twm & then add the following line
Gnome-session &

[[Email protected]~]# Vi/root/.vnc/xstartup
#!/bin/sh

[ -R/etc/Sysconfig/i18n] && . /etc/Sysconfig/i18n
ExportLang
ExportSysfont
Vncconfig-Iconic&
Unset Session_manager
Unset dbus_session_bus_address
OS=' Uname-s '
If [$OS= ' Linux ' ]; Then
Case "$WINDOWMANAGER" Inch
*Gnome*)
If [ -E/etc/Suse-Release]; Then
PATH=$PATH:/opt/Gnome/Bin
ExportPATH
Fi
;;
Esac
Fi
If [ -X/etc/X11/Xinit/Xinitrc]; Then
Exec /etc/X11/Xinit/Xinitrc
Fi
If [ -F/etc/X11/Xinit/Xinitrc]; Then
ExecSh/etc/x11/ xinit/xinitrc
fi
[ -r $HOME /. Xresources ] && Xrdb $HOME /. Xresources
xsetroot -solid Grey
# Xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &

To modify a user profile:/etc/sysconfig/vncservers remove the "#" from the following two lines, which means that the comments of the two lines are removed.

Vncservers="2:root"
Vncserverargs[1]="-geometry 1024x768-depth "

The configuration file after the change is as follows

[[Email protected]~]# vi/etc/sysconfig/vncservers
# The Vncservers variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on Display:2
# as my ' myusername ' (adjust this to your own). You'll also
# need to set a VNC password; Run ' man vncpasswd ' to see how
# to does that.
#
# do not RUN the this SERVICE if your the local area network is
# untrusted! For a secure-to-a-to-a using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028

# use "-nolisten TCP" to prevent X connections to your VNC server via TCP.

# use "-localhost" to prevent remote VNC clients connecting except when
# Doing so through a secure tunnel. See the '-via ' option in the
# ' Man vncviewer ' manual page.

Vncservers="2:root"
Vncserverargs[2]="-geometry 1024x768-depth 32"

4, change the authority of Xstartup

chmod 777 /root/. VNC/xstartup

5, firewall opening port, NETSTAT-ANTPL view can be found that there are three ports in the listening. 5901 5801 6001 These three ports: default, VNC service listens on 3 TCP ports RfB (Remote FrameBuffer) protocol default port: 5900 display number HTTP protocol default port: 5800 display number x protocol default port: 6000 display Device number Vncserver The display number used by default starting from 1, in turn, or you can specify the port number of the parameter we only need the RFB protocol, so we add 5900 to 5903 of these in the firewall, so we can open 3.

VI /etc/sysconfig/iptables Find the following statement:

-A INPUT -m state --StateNEW -m TCP -p tcp- -dport J ACCEPT

After this, fill in:

-A INPUT -m state --StateNEW -m TCP -p tcp- -dport 5900:59 -J ACCEPT

Re-start the firewall

Service Iptables Restart

6. Starting the VNC server

/etc/init. D/vncserver start

Then log in to the original link in Windows with the VNC client: http://zengwu3915.blog.163.com/blog/static/27834897201451591359528/

(ext.) centos6.5 Installing VNC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.