Ubuntu VNC Configuration

Source: Internet
Author: User
Tags ultravnc viewer

After the graphic interface is installed on the Linux server, you must install VNC to remotely connect to the desktop. Here we will introduce the installation configuration of VNC on Ubuntu.

Installing VNC Server on Ubuntu is simple:

Sudo apt-Get install vnc4server

After installation, enter the following command to set a password for the current user. This password is used to connect to VNC:

Vncpasswd

Next, you need to enter the password again. After confirmation, the password is successfully set.

Run the following command:

Vncserver: 1

If you run the command for the first time, the corresponding file is automatically created and the VNC Server is started. Now you can connect to the interface normally. Note that the ": 1" in the interface indicates the display number, when logging on locally, you must write the same display number to log on. For example, enter XX in the VNC client. XX. XX. XXX: 1 is connected to the desktop of the corresponding user.

At this time, the connection will find that only one terminal is displayed. In this case, it is better to directly use SSH. Why do we need to install the graphic desktop? So we need to set it up to display the GNOME Desktop when connecting.

Run the following command to disable the VNC Server:

Vncserver-kill: 1

Then modify the xstartup file in the corresponding user directory:

Run the CD command to enter the. VNC directory under the user directory, and then run the vim command to modify the directory.

CD. VNC/

Vim xstartup

The following is the content of the xstartup file. Different versions may be different (the red letter is the modification and addition ):

#! /Bin/sh

# Uncomment the following two lines for normal desktop:

# Unset session_manager

# Exec/etc/X11/xinit/xinitrc

[-X/etc/VNC/xstartup] & exec/etc/VNC/xstartup

[-R $ home/. Xresources] & xrdb $ home/. Xresources

Xsetroot-solid gray

Vncconfig-iconic &
# Xterm-geometry 80x24 + 10 + 10-ls-title "$ vncdesktop desktop "&
# TWM & (comment out the two rows)
Gnome-session & (add this line)

The above modification means to change the default TWM program to gnome. If you want to use KDE as the desktop, you can change it to startkde &

Run the following command to start vncserver:

Vncserver: 1

In this way, the connection is the GNOME Desktop.

If another user wants to connect to VNC, run the following command with another user:

Vncserver: 2

In this way, other users change the display number.

I am currently using the UltraVNC viewer client in win7 to connect to the server, which is very simple.

Reprinted please indicate the source: Donghan blog» Ubuntu system VNC Server Installation Configuration

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.