Link: http://blog.csdn.net/bykjscn/article/details/8140566
Environment:
[Plain] View plaincopyprint?
- Root @ node1 :~ # Cat/etc/issue
- Ubuntu 12.04 lts \ n \ L
Requirement: now we need to remotely connect to the Ubuntu GUI because there isProgramIt must be configured using the graphical interface.
By default, the Ubuntu server does not have a graphical interface. You can use xmanager to remotely connect to Ubuntu. After the connection is complete, you would like to use the built-in functions of xmanager to bring up a graphic interface, however, no matter how you play it, the program won't be able to play out, and it's very tangled. You can use xclock for testing. It can only be used separately.
In the past, VNC was configured in RedHat, but it was not done in Ubuntu. This is a bit of research. The following describes the configuration process in detail. The graphic program used is xface.
1. install and configure VNC
1. First install VNC
[Plain] View plaincopyprint?
- # Apt-Get install vnc4server
2. Set a password for VNC
[Plain] View plaincopyprint?
- Root @ node1 :~ /. VNC # vncpasswd
- Password:
Enter the password and confirm it again.
3. Start VNC
[Plain] View plaincopyprint?
- Root @ node1 :~ # Vncserver: 1
-
-
- New 'node1: 1 (Root) 'desktop is node1: 1
-
-
- Starting applications specified in/root/. VNC/xstartup
-
- Log File is/root/. VNC/node1: 1.log
-
-
- Root @ node1 :~ # Ps-Ef | grep VNC
- Root 1768 1 0 00:00:00 pts/0 xvnc4: 1-desktop node1: 1 (Root)-auth/root/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbaut
-
- H/root /. VNC/passwd-rfbport 5901-PN-FP/usr/x11r6/lib/X11/fonts/type1/,/usr/x11r6/lib/X11/fonts/Speedo /, /usr/x11r6/lib/X11/fonts/MISC/,/usr/x11r6/lib/X11/fonts/75 DPI /, /usr/x11r6/lib/X11/fonts/100 dpi/,/usr/share/fonts/X11/MISC/,/usr/share/fonts/X11/type1 /, /usr/share/fonts/X11/75 DPI/,/usr/share/fonts/X11/100 dpi/-Co/etc/X11/RGB
Started successfully
2. Client Connection
Install vncview on the client and connect
When you enter the IP address, enter IP: No, that is, the IP address and session number. The account you just opened is 1. Enter
1.1.1.1: 1
After entering the password, you can connect
Because there is no desktop environment, we need to install one. Here we use xface
3. Install xface
[Plain] View plaincopyprint?
- # Apt-Get install xfce4
The process is long and the size is about MB. After the installation is complete, we can use VNC to call xface.
Change VNC configuration and load xface Desktop
[Plain] View plaincopyprint?
- Root @ node1 :~ # Pwd
- /Root
- Root @ node1 :~ # Cd. VNC/
- Root @ node1 :~ /. VNC # ls
- Node1: 1.log node1: 1.pid passwd xstartup
- Root @ node1 :~ /. VNC # Vim xstartup
Comment out the original configuration and add the xface configuration.
[Plain] View plaincopyprint?
-
- Root @ node1 :~ /. VNC # Cat 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/. Xresources
-
- Xsetroot-solid gray
-
- Vncconfig-iconic &
- # X-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ vncdesktop desktop "&
-
- # X-window-manager &
-
-
- Sesion-manager & xfdesktop & xfce4-panel &
-
- Xfce4-menu-plugin &
-
- Xfsettingsd &
-
- Xfconfd &
-
- Xfwm4 &
Then restart VNC
[Plain] View plaincopyprint?
- Root @ node1 :~ /. VNC # vncserver-kill: 1
- Killing xvnc4 process ID 1844
- Root @ node1 :~ /. VNC # vncserver: 1
- New 'node1: 1 (Root) 'desktop is node1: 1
- Starting applications specified in/root/. VNC/xstartup
- Log File is/root/. VNC/node1: 1.log
Connect with the client