Configure the VNC service for Remote Desktop Access in red-flag Linux

Source: Internet
Author: User
Tags remote desktop access

Title: configure the VNC service for Remote Desktop Access in red-flag Linux

Introduction:

VNC (Virtual Network Computing) is short for virtual network computers. It is an excellent remote control tool software developed by the famous at&t European research laboratory.

The following describes how to configure the VNC service in the "red-flag Linux DC Server 5.0" and "red-flag Linux Desktop 6.0" operating systems to enable client connection and access through "Remote Desktop.

I. Red-Flag Linux DC Server 5.0 provides the remote desktop service:

Server: redflag Linux DC Server 5.0

Note: redflag Linux DC Server 5.0 has a VNC Server RPM package installed. You do not need to install it separately.

The configuration and operations are as follows:

1. Configure the VNC Server

Edit the vncservers file under/etc/sysconfig/and add a VNC user.

Add the following line to the end of the vncservers file:

-------------

Vncservers = "1: Root"

--------------

Note:

*. The added user (Root User) must already exist.

*. "1" indicates the session number. You can add multiple sessions to provide multiple remote desktop services at the same time.

2. Configure the VNC server password

Run the command: # vncpasswd to set the VNC logon password.

After the password is set, a file named "passwd" is generated under the path/root/. VNC.

If you want to change the VNC server password, run the # vncpasswd command again.

3. Start the vncserver service

Run the command: #/etc/init. d/vncserver start
Or: # service vncserver start

After the vncserver is started, the xstartup and 1. log files are generated under/root/. VNC.

In the xstartup file, the most important thing is to define the display mode of Remote Desktop that can be seen in client sessions when the VNC Server provides services.

You can edit and modify xstartup to add custom content.

1. The log file is the log file of the VNC server with the session number "1.

If the VNC Server fails to be started, you can find the cause based on the log.

4. Modify the VNC service Remote Desktop Startup Mode

By default, the Remote Desktop VNC starts the TWM Window Manager (tabwindow manager for the X windowsystem ).

The remote interface (TWM window) that the client can see is relatively simple. Although all the functions of the system can be executed under the command line, it lacks efficient human-computer interaction functions.

(Of course, it doesn't mean to belittle TWM-TWM is short and cool! ^_^)

If you want the VNC server to start the KDE interface service, modify the/root/. VNC/xstartup file.

The modification method is as follows:

Open the/root/. VNC/xstartup file, comment out the last line of TWM &, and change it to the following:

--------------

# TWM &
Startkde &

--------------

Save the xstartup file and start the vncserver service again. Then, the client can access the friendly KDE interface. Pai_^

5. Common commands of VNC Server

*. Vncserver restart command:

# Service vncserver stop
# Service vncserver start
Or:
# Service vncserver restart

*. Command for viewing the vncserver service status:

# Service vncserver status

*. View the vncserver listening port command:

# Netstat-tlnp | grep VNC

By default, the VNC Server provides the following port numbers for access through a browser: 5800 + session numbers. The port numbers for access through the VNC Viewer client are 5900 + session numbers.

If you need to provide a cross-firewall server, the firewall needs to open the corresponding port.

*. Run the following command to end the service:

# Vncserver-kill: Session ID
For example: # vncserver-kill: 1 // end the service whose session number is 1

 

6. VNC client and usage:

Three clients are available:

A. The client is in a Linux environment.

Run the following command:

# Vncviewer vncserverip: 1
 
Enter the logon password of the VNS server to connect to the VNC Server. The Remote Desktop is displayed.

The premise is that the client needs to install the RPM package of the VNC client, the package that can be downloaded and installed: vnc-4.0-8.1.i386.rpm.

Vncserverip is the IP address of the server, and "1" is the session number.

B. The client is in a Windows environment.

Client tools that need to run VCN, such as VNC Viewer. You canWww.realvnc.com/Download.
 
The access address is as follows:

Vncserverip: 5900 + session number. (Note: The port used by the VNC server to access through the VNC Viewer client is: 5900 + session number)

For example, the access address is 192.168.100.82: 5901.

Note that the correct session number must be written here, otherwise the following error will be reported:
---------------------------

Failed to connect: Connection refused (10061)

---------------------------

Enter the logon password of the VNS server to connect to the VNC Server. The Remote Desktop is displayed.

C. Access the VNC server using a browser as a client and display the Remote Desktop in Java Applet Mode

Enter the server access address in the browser address bar, as shown below:
 
Http: /// vncserverip: 5801/

Note that the port number is 5800 + session number. (Note: The port for access via a browser provided by the VNC Server is 5800 + session number)

Enter the logon password of the VNS server to connect to the VNC server.ProgramOpen and display the Remote Desktop.

Ii. Red-Flag Linux Desktop 6.0 provides the remote desktop service:

Server: redflag Linux Desktop 6.0

Note: by default, the RPM package of the VNC server is not installed in redflag Linux Desktop 6.0. Install the RPM package of the VNC Server separately.

The configuration and operations are as follows:


1. Install the VNC Server RPM package.

Package: vnc-server-4.0-8.1.i386.rpm

If you need a VNC client under Linux, the installation package is also: vnc-4.0-8.1.i386.rpm

The installed RPM package can be viewed in the package manager.

2. Configure the VNC server.

Edit the end Of the vncservers file under/etc/sysconfig/and add the following line:

-------------
Vncservers = "1: Root"
--------------

3. Configure the VNC server password.

Run the command: # vncpasswd to set the VNC logon password.

4. Start the vncserver service

Run the command: # service vncserver start

Note: A prompt is displayed on the Linux console:

------------------------
Start VNC Server: 1: Root warning: initlog is deprecated and will be removed in a future release
-------------------------

Run the # service vncserver STATUS Command to check the service status. The VNC server is not started successfully.

In this case, you can view the logs in the/root/. VNC/file and find the error message:


------------------------------------------------------

Couldn't open rgb_db '/usr/x11r6/lib/X11/RGB'

Xvnc version 4.0-built Aug 4 2005 10:11:38
Underlying X Server Release 60801000, the X. Org Foundation

Thu May 20 11:26:06 2010
Vncext: VNC extension running!
Vncext: listening for VNC connections on port 5902.
Vncext: listening for HTTP connections on port 5802
Vncext: created VNC Server for screen 0
Error opening security policy file/usr/x11r6/lib/X11/xserver/securityPolicy
Cocould not init font path element/usr/x11r6/lib/X11/fonts/MISC/, removing from list!
Cocould not init font path element/usr/x11r6/lib/X11/fonts/TTF/, removing from list!
Cocould not init font path element/usr/x11r6/lib/X11/fonts/type1/, removing from list!
Cocould not init font path element/usr/x11r6/lib/X11/fonts/CID/, removing from list!
Cocould not init font path element/usr/x11r6/lib/X11/fonts/75 DPI/, removing from list!
Cocould not init font path element/usr/x11r6/lib/X11/fonts/100 dpi/, removing from list!

Fatal server error:
Cocould not open default font 'fixed'
Xrdb: Connection refused
Xrdb: Can't open display'localhost. localdomain: 2'
Xsetroot: Unable to open display 'localhost. localdomain: 2'
/Root/. VNC/xstartup: line 12: TWM: Command not found
Vncconfig: Unable to open display "localhost. localdomain: 2"
Warning: This program is an SUID-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
In this environment. You may get a more descriptive message by running
Program as a non-root user or by removing the SUID bit on the executable.
Xterm XT error: Can't open display: % s

------------------------------------------------------

According to the information written in the log, the error is mainly because the font required by the X system cannot be loaded, and the path of the font cannot be found under/usr/x11r6/lib/X11.

The default font path of the X system is/usr/x11r6/lib/X11/fonts.

However, for redflag Linux Desktop 6.0, only the folder TrueType is in/usr/x11r6/lib/X11/fonts.

This is the cause of the problem!

Solution:

In redflag Linux Desktop 6.0, the font paths required by the VNC Server, such as MISC, TTF, type1, 75 DPI, and 100dpi, are found in/usr/share/X11/fonts.

In/usr/x11r6/lib/X11/fonts/, add these paths under/usr/share/X11/fonts as links (folder shortcuts.

The command for creating a file link is similar to the following:

# Cd/usr/x11r6/lib/X11/fonts/
# Ln-S/usr/share/X11/fonts/MISC Misc
# Ln-S/usr/share/X11/fonts/TTF
# Ln-S/usr/share/X11/fonts/type1 type1
# Ln-S/usr/share/X11/fonts/75 DPI 75 DPI
# Ln-S/usr/share/X11/fonts/100 dpi 100 dpi
# Mkdir/usr/x11r6/lib/X11/fonts/CID/

(Note: Because the CID folder is not found, an empty folder named "CID" is created by using commands.
This mainly refers to the folder structure of redflag Linux DC Server 5.0. However, there is no CID folder, which is not greatly affected. ^_^)

Run the following command to restart the VNC Server:

# Service vncserver restart

Next, run the # service vncserver STATUS Command to check the service status. The VNC Server is successfully started and is normal. Pai_^

5. Modify the Remote Desktop Startup Mode of the VNC service.

Open the/root/. VNC/xstartup file, comment out the last line of TWM &, and change it to the following:

--------------
# TWM &
Startkde &
--------------

Then run the command # service vncserver restart to restart the VNC server.


6. Remote Desktop Connection Method of the client, same as above.

I will not go into details.

[-End-]

By jrq

2010/05/20 in Nanchang

 

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.