How to install and configure the Linux VNC service

Source: Internet
Author: User
Tags iptables firewall

If your computer is a Linux system, so for the installation of Linux VNC service is very convenient, for VNC is a very good remote control tool, so the installation and configuration of Linux VNC service, for netizens useful to this function is very convenient, then how to install and configure it! Let's have a look!

First, Redhat on VNC server configuration

This article is based on the current Linux system does not have VNC server installed, if installed please skip the 1th section!

Premise:

1. Connect to the Internet, will use Yum online install VNC server

2. Confirm SSH is running

1. Install Tigervnc Server

# Yum Search Tigervnc-server

Return about the following:

TIGERVNC-SERVER.X86_64:A TIGERVNC Server

Tigervnc-server-applet.noarch:java tigervnc Viewer applet for Tigervnc server

Tigervnc-server-module.x86._64:tigervnc Mode to Xorg

...

The first line is the VNS server we want to install, the second line is the client, execute

# yum Install tigervnc-server.x86_64

After the carriage return will have a confirmation of installation, input y back to the installation, after installation, return to the command line input cursor, execute

# Vncserver

Prompts for the authentication password, at least 6 digits, that are used when the client connects.

2. Configure the graphical interface

Modify the configuration file, activate the graphical interface, and execute the command:

# Vi/root/.vnc/xstartup

Comment out this line

#twm &//comment on the line

Add one line to the end

Gnome-session &/Increase the line

Save exit

3. Start VNC Service

Execute command

#/etc/init.d/vncserver Start

Or

# service Vncserver Start

Prompt after startup:

Starting VNC SERVER:NO displays configured [FAILED]

Workaround:

Execute command

# vim/etc/sysconfig/vncservers

Modify the last two lines as follows:

Vncservers= "1:root"

vncserverargs[1]= "-geometry 1024x768"

Description

The first behavior service configuration, currently only has a VNC service configured, using user root startup, if you need to use other user login, you can modify the value of vncservers such as: "1:root 2:tiger" (Tiger is another existing user of the system). The second line can be commented, is configured window resolution, need to remove the back of the-localhost

VNC server starts automatically with system

Execute command

# sudo chkconfig--level 345 vncserver on

4. Stop VNC Service

Execute command

#/etc/init.d/vncserver Stop

Or

# Service Vncserver Stop

Windows uses VNC viewer to access Linux

First install RealVNC, download from the Internet to get

Start-Run VNC Viewer, enter the IP address, followed by: 1 represents the use of root user login, 1:root configured on the RH, if you want to use other user login, adjust the number after the colon, the password is previously configured.

Ways to solve problems that are not connected

Execute a command to see what port the VNC listens on and open the port in the firewall

# Netstat-ntupl|grep VNC

Return to list such as:

1. TCP 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 4411/xvnc

2. TCP 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 4411/xvnc

3. TCP 0 0::: 6001:::* LISTEN 4411/xvnc

Modify the firewall profile and open port 5901

# Vi/etc/sysconfig/iptables

You can copy a 22-Port line, paste the changes, restart the Firewall service

# Service Iptables Restart

Related Article

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.