VNC configuration on Ubuntu

Source: Internet
Author: User

VNC configuration document classification in Ubuntu: the operating system configures the SERVER as a vnc server, allowing other hosts to log on to this SERVER graphically. It is easy to configure the vnc server in ubuntu as follows:
Server: 1 first install VNC service program: Shell code $ sudo apt-get install vnc4-common vnc4server

2. Set a vnc logon password for the current user: Shell code $ vncpasswd

3. Modify the default vnc settings so that gnome is used as the X Desktop at startup (if not set, vnc will use twm, you can try
): Shell code $ vncserver: 1 $ vncserver-kill: 1
Note: ": 1" indicates the display number. You must write the same display number when logging on to the client.
Points ). Modify ~ /. Vnc/xstartup file. We recommend that you copy the Xsession configuration file in the system: Shell code $ cp/etc/X11/Xsession ~ /. Vnc/xstartup

Then start vnc server again: Shell code $ vncserver-geometry 1280x800: 1

Client: 1. install VNC client: Shell code $ sudo apt-get install vnc4-common xvnc4viewer

2. Then you log on to the Terminal Server Client: Applications> Internet> Terminal Server.
Client; Computer: Server IP: display #, for example, 192.168.10.36: 1; protocol: VNC. Or use the command line: Shell code $ vncviewer 192.168.10.36: 1 ================================================ ==================================
Remotely logging on to the Ubuntu Desktop using VNC has been remotely logging on to ubuntu using putty + pagent, and operating and configuring the Ubuntu system using the command line. However, I always think that something is missing and that the graphic interface is also good, especially after ubuntu-joES is installed, the idea is even more intense. In the past, the graphic interface program can be run in putty + xming, but the font is relatively small. You can use VNC to remotely manipulate the ubuntu interface. I tried two types of VNC server software: vnc4server and vncserver. The client can also use ultravnc.
Other VNC client software such as tightvnc. VNC4Server server: vnc4server-free software, which can be found from the source. Sudo apt-get install vnc4server client: UltraVNC for Windows is also a free software. UltraVNC contains the Server and Client, but I only installed the Client. It is particularly worth mentioning that the plug-in of this software contains a DSMplugin, which can implement encrypted transmission and is very good. UltraVNC download: http://ultravnc.sourceforge.net/dsmplugindownload (not available here): http://msrc4plugin.home.comcast.net /~ Msrc4plugin/index.html configuration: 1. Generate a passwd file vnc4passwd and generate a passwd file under the $ HOME/. vnc directory. $ HOME/. vnc is a key directory of vnc4server. 2. When vnc4server is enabled, enter vnc4server to get the name of desktop, which is used for client connection. For desktop: 1, when the client is connected
Enter ip: 5901, and so on. For Desktop 2, enter ip: 5902 at the client .... the first running will prompt the generation. vnc/xstartup file, which contains the configuration when you log on to start X. Note: logon from UltraVNC may provide a simple window, because WM started by VNC4Server is twm by default. if you want
To start gnome, change. vnc/xstartup. My configuration 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 /. xresourcesxsetroot-solid greyvncconfig-iconic & xterm-geometry 1024x768 + 10 + 10-ls-title \ "$ VNCDESKTOP Desktop \" & gnome-session & when logging on like this, it automatically starts gnome. If you do not understand the principle very well or have problems, you can view the/usr/bin/vnc4server file, which is a Perl file.
You will understand the operating principles. VNCServer: If vncserver is used, the default configuration file is in $ HOME/. vncrc and the global configuration file of the vncserver system.
In/etc/vnc. conf, you can see how it works from/usr/bin/vncserver (also a Perl file. In addition, you also need to change/etc/vnc. conf. Because vncserver uses the xfree system by default, You need to modify the configuration file,
Roughly as follows: $ XFConfigPath = \ "/etc/X11/xorg. conf \ "; of course, other variables such as vncStartup can be seen here. If you want to start the default X system, you can configure it as follows: $ vncStartup = \ "/etc/X11/Xsession \"; if /. in vncrc, configure the X system as xorg $ XFconfigPath = \ "/etc/X11/xorg. conf \ "; # Start the default Xsession $ vncStartup = \"/etc/X11/Xsession \ "; # resolution $ geometry = \" 800x600 \ "; after logon, will automatically go to the default desktop, such as Gnome, if the Ubuntu local login is the same. In addition, we can see that xinited and vncserver are used to implement backend services. However, I think the risk is still high because it is used by default.
Be cautious when running the command by using root. Linux VNC is a good tool for Xorg's C/S system!

---------------------

Set VNCServer in Ubuntu

 

Virtual Network Computing (VNC) is a software for remote desktop control. Keyboard Input and mouse operations on the client are transmitted to the remote server over the network to control server operations. The graphical interface of the server is displayed on the client through network transmission. Just like operating a local computer, all programs and commands are executed on the server.
1. Open a Terminal window


2. Download vnc4server:
Sudo apt-get install vnc4server

3. Start vnc4server:
Vnc4server
At this time, the system will prompt you to enter the password, which will be used when you connect through the client.
After entering the password, you will see a prompt similar to the following:

New '***** 3 (*****)' desktop is *****: 3 (***** indicates the host name)

Take notice of the number after the colon (, in this case it is "3 ."

After vnc4server is started, A. vnc directory will be generated in your home directory.
Now you can link to the server through the vnc client.


4. Stop a vnc4server
Vnc4server-kill: 3
Replace 3 with the number you obtained at startup.


5. Open the. vnc/xstartup file and edit it:
Gedit/. vnc/xstartup
The file will look like this:
#! /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
Vnccon **-iconic &
X-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&
X-window-manager &


6. Modify and save the. vnc/xstartup file.
Uncomment the lines starting with unset and exec, and comment the rows starting with xsetroot, vnccon **, xterm, and twm. After execution, it looks like this:
#! /Bin/sh
# Uncomment the following two lines for normal desktop:
Exec/etc/X11/xinit/xinitrc
[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup
[-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources
# Xsetroot-solid gray
# Vnccon **-iconic &
# X-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&
# X-window-manager &

7. Modify the license for the/etc/X11/xinit/xinitrc file to make it executable:


8. Start vnc4server:
Vnc4server
Note: Remember the number after the colon


9. log on to this server from another computer:
Vncviewer remote-server: 3
Follow the prompts to enter the password you entered in the third part.

10. If the preceding execution fails, the graphic interface is invisible to the VNC, And the mouse is in the "X" shape, check whether article 7 has been executed, and delete the created VNCServer, vncserver-kill: 1 (1 indicates the number of vncserver started earlier)

11. added the Windows key definition under Ubuntu 10.10, which is defined as the Super key. When you press the letter "d" under VNC, it will be incorrectly treated as a return desktop shortcut, causing d to be unable to be input. In this case, you can modify the shortcut key to avoid this bug. Open a new terminal and enter :, in this dialog box, go to "Apps-> Metacity-> Global keybingdings" and find "show desktop". Change the default value to <Ctl> <Alt> D.

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.