Ubuntu12.04 installation configuration and Operation VNC Server----Step-by-step measurement

Source: Internet
Author: User

In the Ubuntu graphics environment, VNC can be used for remote management. If there is no graphical interface, only the character interface needs to be installed in the GUI before installing the Vncserver service, specifically as follows:


1, install the Gonme core package in turn, this step can be omitted if the graphics package is installed when the system is loaded.

[e-mail protected]:~ #apt-get install x-window-system-core[email protected]:~ #apt-get install Gnome-core (installation DGM after download is complete, Can not choose LIGHTDGM, or restart will not be able to log on to the desktop) [email protected]:~ #apt-get install metacity[email protected]:~ #apt-get Install Gnome-desktop-environment (optional)

2, install vnc4server

[Email protected]:~# apt-get Install Vnc4server

3, set Vncserver password

[Email protected]:~# vncpasswdpassword:verify:

4. Start the VNC server and shut down the VNC server

[Email protected]:~# vncserver #启动vnc server[email protected]:~# vncserver-kill:1 #关闭vnc server:1 means close port 5901

5. Modify the ~/.vnc/xstartup file

[email protected]:~# vi ~/.vnc/xstartup    #!/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 &x-terminal-emulator -geometry  80x24+10+10 -ls -title  "$VNCDESKTOP  desktop"  & #twm  & gnome-session-fallback & #x-window-manager &~                                                                                                        ~

NOTES: Note the last few lines, add Gnome-session-fallback &

Comment out "TWM &" and "X-window-manager &"


6, log in with client-side VPN

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/77/CB/wKiom1ZueZ_DpejRAACSV8MzgKA446.png "title=" 1.png " alt= "Wkiom1zuez_dpejraacsv8mzgka446.png"/>


At this point, the configuration is complete.








Note: Sometimes the login port does not have to log in through 5901, if you do not know the use of login port number, you can query the process number, query the login settings, the steps are as follows:

1. To view the process number that VNC can sign in to Ubuntu:

[Email protected]:~ #cd  /root/.vnc[email protected]:~/.vnc# pwd/root/.vnc[email  Protected]:~/.vnc# lltotal 84drwxr-xr-x  2 root root  4096 dec  14 16:57 ./DRWX------ 19 root root  4096 dec 14 16:57 &NBSP, .... /-RW-------  1 root root     8 Dec 14 16:55  Passwd-rw-r--r--  1 root root 10452 dec 14 16:50 ubuntu:1. Log-rw-r--r--  1 root root  1645 dec 14 16:49 ubuntu:2. Log-rw-r--r--  1 root root     6 dec 14 14:13  ubuntu:2.pid-rw-r--r--  1 root root  6012 dec 14 16:48  ubuntu:3.log-rw-r--r--  1 root root     6 dec 14  15:57 ubuntu:3.pid-rw-r--r--  1 root root  6195 dec 14 16:56 ubuntu:4.log-rw-r--r--   1 root root     6 dec 14 16:50 ubuntu:4. Pid-rw-r--r--  1 root root  6361 dec 14 16:57 ubuntu:5. log-rw-r--r--  1 root root     6 dec 14 16:52  ubuntu:5.pid-rw-r--r--  1 root root  4965 dec 14 17:15  ubuntu:6.log-rw-r--r--  1 root root     6 dec 14  16:57 ubuntu:6.pid-rwxr-xr-x  1 root root   395 dec 14  14:19 xstartup*


There are about 6 processes, there are 6 landing interface, if you do not want to log in, you can directly use VNCSERVER-KILL:X (x for the corresponding port number.) Where 5900 is the base, the process number that kills the port, the entire VNC service stops)


2, view the port number of the process that VNC can log in:


[Email protected]:~/.vnc# ps-ef |grep VNC

root 37263 1 0 16:57 pts/0 00:00:02 xvnc4:6-desktop ubuntu:6 (Root)-auth/root/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth /root/.vnc/passwd-rfbport 5906-pn-fp/usr/x11 r6/lib/x11/fonts/type1/,/usr/x11r6/lib/x11/fonts/speedo/,/usr/x11r6/lib/x11/fonts/misc/,/usr/x11r6/lib/x11/ fonts/75dpi/,/usr/x11r6/lib/x11/fonts/100dpi/,/usr/share/fonts/x11/misc/,/usr/share/fonts/x11/type1/,/usr/ share/fonts/x11/75dpi/,/usr/share/fonts/x11/100dpi/-co/etc/x11/rgb

Root 37269 1 0 16:57 pts/0 00:00:00 vncconfig-iconic

Root 37516 36380 0 16:58 pts/0 00:00:00 tail-f/root/.vnc/ubuntu:6.log

106      38305     1  5 17:09?        00:00:22/usr/bin/kvm-s-M pc-1.0-qemu-kvm-enable-kvm-m 1024-smp 2,sockets=2,cores=1,thread S=1-name Liqb-uuid B122f27c-e17a-a625-7f80-0c6c805cbd45-nodefconfig-nodefaults-chardev Socket,id=charmonitor,path =/var/lib/libvirt/qemu/liqb.monitor,server,nowait-mon CHARDEV=CHARMONITOR,ID=MONITOR,MODE=CONTROL-RTC BASE=UTC- No-shutdown-drive File=/images/test/liqb.img,if=none,id=drive-ide0-0-0,format=raw-device ide-drive,bus=ide.0, Unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1-drive If=none,media=cdrom,id=drive-ide0-1-0,readonly=on, Format=raw-device Ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0-netdev Tap,fd=18,id=hostnet0- Device Rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:3f:6a:06,bus=pci.0,addr=0x3-chardev Pty,id=charserial0- Device Isa-serial,chardev=charserial0,id=serial0-usb-vnc 127.0.0.1:0-VGA cirrus-device virtio-balloon-pci,id= balloon0,bus=pci.0,addr=0x4

Root 38734 37665 0 17:16 pts/3 00:00:00 grep--color=auto VNC



However, you can also query by port number.

[Email protected]:~# netstat-lntp |grep 590*

TCP 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 38305/KVM

TCP6 0 0::: 5906:::* LISTEN 37263/xvnc4


can be represented by: 6 to log in, such as:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/CE/wKioL1ZujVmBZ1cXAACKBcSpt3o465.png "title=" 2.png " alt= "Wkiol1zujvmbz1cxaackbcspt3o465.png"/>



This article is from the "Breght Moon" blog, make sure to keep this source http://liqingbiao.blog.51cto.com/3044896/1722865

Ubuntu12.04 installation configuration and Operation VNC Server----Step-by-step measurement

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.