Install VNC server and ubuntuvnc in Ubuntu

Source: Internet
Author: User

Install VNC server and ubuntuvnc in Ubuntu

Although we can use ssh to log on to the Ubuntu server in most cases, sometimes our program needs to run in the graphical interface. In this case, we need to use the vnc server software. Installing the vnc server in Ubuntu is simple. You only need to perform the following steps:

Step 1: Obtain the Installation File

Sudo apt-get install vnc4server

Step 2: Modify the VNC Password. It cannot be too short.

# Vncpasswd

Password :******

Verify :*****

Step 3: Check the firewall, which is not described in detail

Step 4: Start the VNC server

# Vncserver

Step 5: connect through the client

Address followed by: 1

Step 6: Is the interface ugly !? Reference others' solutions

But why is this desktop so ugly ?!

The default window manager used by vncserver is twm, which is a simple window manager. You can change your desktop to GNOME or KDE.

You can go to your home directory and edit the file:. vnc/xstartup. The content of this file is as follows:

#! /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 &

Gnome-session &

You can comment out the line "twm &" as above, and then add a line "gnome-session &", or "startkde &", start GNOME desktop and KDE Desktop respectively.

If the server restarts, you need to run the vncserver command again to start the VNC server, which is very troublesome. Is there a better way?

If the server restarts, you need to run the vncserver command again to start the VNC server, which is very troublesome. Is there a better way?

Yes! We can start the VNC server as a background service. Perform the following steps:

First, you must allow the VNC server to be started during system startup. You can use the "System Settings> Server Settings> Services" menu to configure the vncserver.

If you use the command line, run the following two commands as root:

Cd/etc/rc5.d

Mv K35vncserver S35vncserver

Edit/etc/sysconfig/vncservers. The following is the file content:

# The VNCSERVERS variable is a list of display: user pairs.

#

# Uncomment the line below to start a VNC server on display: 1

# As my 'myusername' (adjust this to your own). You will also

# Need to set a VNC password; run 'man vncpasswd' to see how

# To do that.

#

# Do not run this service if your local area network is

# Untrusted! For a secure way of using VNC, see

#.

VNCSERVERS = "1: user1 2: user2 3: user3"

VNCSERVERARGS [1] = "-geometry 1024x768"

VNCSERVERARGS [2] = "-geometry 1024x768"

VNCSERVERARGS [3] = "-geometry 800x600"

Explain this file:

VNCSERVERS is configured to start several VNC servers when the system starts. In the preceding example, three VNC servers are run, where user1 is displayed: 1, user2 is displayed: 2, user3 is in display: 3.

VNCSERVERARGS sets the startup parameters for VNC server 1, 2, and 3. In the preceding example, the screen resolution is 1024x768 for user1 and user2, and 800x600 for user3.

Use the "man vncserver" command to query other supported parameters.

After editing the file, save it and run it as root:

/Sbin/service vncserver start

In this way, the vncserver of user1, user2, and user3 is started.

After each system restart, the vncserver of these three users will be automatically started.

Note: The preceding three users must have used the vncpasswd command to set the vnc password. Otherwise, the vncserver cannot be started.


How does Ubuntu1204 server version install desktop and VNC?

Terminal execution:
Sudo apt-get install ubuntu-desktop # install desktop
Sudo apt-get install vnc-server # install VNC
 
How to install VNC in Ubuntu 804?

Enter sudo apt-get install vnc4server on the terminal

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.