Introduction to Ubuntu Server Installation and configuration Vncserver in Linux

Source: Internet
Author: User
Tags server installation and configuration ssh

Ubuntu contains 2 types of Remote Desktop: Vino-server and VNC Server.

Where Vino-server is Ubuntu's self-contained Remote Desktop server, which is easy to open under System-> Preferences (Preferences)-> Remote Desktop, and can then be used with VNC Viewer for Remote Desktop Connection. The specific way to open, you can see the "Ubuntu Open Remote Desktop method." However, one of the most notable drawbacks of this vino-server approach is that when you reboot the machine, you must first log on to the remote server and enter the system (equivalent to creating a session) before you can use Remote Desktop to connect to this remote server locally. This disadvantage leads to vino-server sometimes extremely inconvenient.

So, if we want to solve this problem, we can fix it by installing VNC server. The process of installing vncserver under Ubuntu is simple:

(1) Installation Vncserver
Use SSH to login ubuntu, execute command: sudo apt-get install Vnc4server

(2) Close the original Ubuntu server with Remote Desktop
You can first connect to Ubuntu using Vncviewer, and then remove the first tick under System-> Preferences (Preferences)-> Remote Desktop (remotely Desktop). This time your vncviewer will be automatically disconnected.

(3) Configure Vncserver
On the SSH to Ubuntu command line, run the following command: VNCPASSWD, be careful not to add sudo.
This command sets the Remote Desktop password for the current user. The. VNC folder is then generated in the current user's root directory, and after entering the. vnc file, modify the Xstartup file:
Vim. Vnc/xstartup (assuming you are at this point in the user's root directory)
Comment out the TWM & (that is, add a # at the very beginning of this line), and save the exit by adding a row to the file at the end of Gnome-session.

(4) Start Vncserver
Vncserver-geometry 1280x800-alwaysshared:1
This command contains 3 parameters, the first parameter geometry the resolution, you can specify the resolution for your desktop, and the second parameter alwaysshared indicates that multiple individuals are running simultaneously to the same desktop; the third parameter: 1 means to open a 1th Remote Desktop, At this point you can use Ip:1 to connect to this Remote desktop. (Note: The connector between 1280 and 800 above is the English letter x (xyz x), not the Chinese and English multiplication!)

(5) Connect this Remote Desktop using Vncviewer
In Vncviewer, enter the IP plus desktop number, that is, x.x.x.x:1 can connect to the Remote Desktop, the password is previously set password.

This way, when you restart the server, you do not have to run to the server before the system, and you can first use SSH login ubuntu, to perform the 4th step above command, you can open a remote Desktop, and then you can use Vncviewer to connect to this Remote desktop.

I have also tried to automatically start a remote Desktop vncserver under Ubuntu, but unfortunately, many of the methods found on the Internet are for other Linux methods, the directory structure in Ubuntu is completely different, Some of the few articles that automatically start Vncserver under Ubuntu are also not suitable for the Ubuntu 9.04 Server Edition, so eventually I didn't implement automatic start Vncserver on the Ubuntu 9.04 server. Is that every time you restart the machine, you have to step into SSH to start the vncserver step. Use it first.

Note: In addition, if you want to turn off a remote desktop, you can use the following command:
Vncserver-kill:1
Where, ": 1" is the desktop number that is created when you create a remote Desktop

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.