Simple configuration of VNC servers on Ubuntu

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 VNCserver on ubuntu is very simple: After the sudoapt-getinstallvnc4server is installed, enter the following command, set a password for the current user, this password is used to connect to VNC: v

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 vncserver is started. now you can connect to the interface normally. Note that ": 1" 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.

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.