Linux under Configuration Vncserver

Source: Internet
Author: User
Tags i18n

Vncserver is very easy to use and a wide range of Remote Desktop Services, the configuration is relatively simple.
The process of configuring Vncserver on a CentOS system is documented below.

    1. See if Vncserver has been installed under CentOS

      Rpm-qa |grep VNC

    2. If Vncserver is not installed, install it

      Yum Install VNC Vncserver

vncserver Configuration

There are two ways to start the VNC desktop, one is to configure the startup in the/etc/sysconfig/vncservers file, this way the VNC desktop configuration is started when the server is started, can be directly connected remotely, and the other is running when the machine run Vncserver: Desktop number command to start, this way to start the VNC desktop after the machine restarts after the failure.
1. Using files for configuration
This method can only be performed under root user.
Configuration of the/etc/sysconfig/vncservers:

    # vncservers= "2:myusername"    # vncserverargs[2]= "-geometry 800x600-nolisten tcp-localhost"    VNCSERVERS= "1: Root 2:jason "    vncserverargs[1]="-geometry 1600x1000-nolisten tcp-localhost "    vncserverargs[2]="-geometry 1600x1000-nolisten Tcp-localhost "

It specifies the desktop number: the user name, and the corresponding configuration information.

2. Use the Vncserver command to configure
This can be done under all users, each user can open multiple VNC remote desktops, all of the VNC desktops of a user use the same password, but all users must be unique desktop number.

    Usage:vncserver [: <number>] [-name <desktop-name>] [-depth <depth>]    [-geometry <width>x 

You can create a new desktop with the Vncserver command

Vncserver:number Desktop number,-name desktop name (displayed on vncviewer),-depth color depth,-geometry desktop size.

Or remove a remote Desktop

Vncserver-kill: Desktop number

VNC Desktop Configuration

Each user has a Xstartup configuration file under the ~/.vnc directory to configure VNC to use the GNOME desktop or the KDE desktop, as well as some other information.
If you are a GNOME desktop, then you need to modify the/root/.vnc/xstartup configuration file

    #!/bin/sh    [-r/etc/sysconfig/i18n] &&./etc/sysconfig/i18n    Export LANG    export Sysfont    Vncconfig-iconic &    unset session_manager    unset dbus_session_bus_address    os= ' uname-s '    if [$OS = ' Linux ']; Then case    "$WINDOWMANAGER" in    *gnome*)    if [-e/etc/suse-release], then    path= $PATH:/opt/gnome/bin    export PATH    fi    ;;    Esac    fi    if [-x/etc/x11/xinit/xinitrc]; then    exec/etc/x11/xinit/xinitrc    fi    If [-f/etc/x11 /XINIT/XINITRC]; Then    exec sh/etc/x11/xinit/xinitrc    fi    [-R $HOME/. Xresources] && Xrdb $HOME/. Xresources    xsetroot-solid Grey    xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &    Gnome-session Gnome #添加这一句是连接时使用gnome Desktop environment    TWM &

Vncserver Service-side Operation

Vncserver Run:

Service Vncserver Start

At runtime, each user can open multiple VNC remote desktops via the Vncserer command (differentiated by the Global desktop number), and the passwords for all VNC desktops of a user are the same (through VNCPASSWD settings).
Each time a user opens a new VNC desktop, the user's ~/.vnc directory will have a corresponding server machine Name: the desktop number. PID process file and server machine name: Log file for desktop number.

connection to the VNC client

A, under Linux, run the vncviewer command, the server address is written in a form such as
b, under Windows, run the Windows version of Vncviewer, using a similar usage to Linux.

Linux under Configuration Vncserver

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: 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.