The CentOS system uses VNC to view the X11 graphic interface window

Source: Internet
Author: User
Tags ssh centos centos server x11vnc

In Linux, VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect. In most cases, you only need two commands: vncserver and vncviewer.

My CentOS server is connected via SSH without a graphical window, that is, Headless System. Therefore, I decided to use two lightweight applications, x11vnc and Xvfb, to meet my needs. X11vnc is a VNC service program, which itself is relatively lightweight. Therefore, the lightweight requirements for running only one or two GUI window programs are more appropriate. We know that to display a window in Linux, you must first create a display service. Xvfb is a lightweight virtual display service program that does not generate actual screen output. Therefore, the principle of the entire solution is that Xvfb creates display and x11vnc connections and converts them to vnc protocols.

First, install necessary components:

The code is as follows: Copy code
Yum install xorg-x11-xauth xterm libXi libXp libXtst-devel libXext-devel

Install x11vnc. The script is as follows:

The code is as follows: Copy code
Wget http://softlayer-ams.dl.sourceforge.net/project/libvncserver/x11vnc/0.9.13/x11vnc-0.9.13.tar.gz
Tar zxf x11vnc-0.9.13.tar.gz
X11vnc-0.9.13 cd tar zxf
./Configure-prefix =/usr/local/blog.creke.net/x11vnc
Make
Make install

Then we use yum to install Xvfb. The script is as follows:

The code is as follows: Copy code

Yum install Xvfb

Then, you can use Xvfb with a simple x11vnc command, as shown below:
/Usr/local/x11vnc/bin/x11vnc-rfbport 12345-passwd connection password-create-forever
After running, use the vnc client to connect to port 12345 of the server. Enter the correct password to view the terminal window. The window program can be directly displayed in VNC when the terminal is started. If you want to use the window after logging out of SSH, you can run the above script in screen. If you want multiple users to connect to VNC at the same time, you can add the "-shared" parameter.

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.