虚拟化容器,大数据,DBA,中间件,监控。

ubuntu x11vnc 使用web 访问vnc

05 11月
作者:admin|分类:系统运维

Ubuntu上启用X11VNC  并使用web访问VNC

 

计算中心节点,没有远程控制不能活,就得装个VNC。

启动Ubuntu的软件中心,选择“X11VNC服务器”,进行安装。当然也可以用sudo apt-get install命令安装。
Ubuntu上启用X11VNC - 九千澜 - 紅世鐵杖御者

接下来创建登陆密码

sudo x11vnc -storepasswd

输入和确认之后,密码被保存到了用户的密码目录下:

 
Ubuntu上启用X11VNC - 九千澜 - 紅世鐵杖御者

再设置X11VNC的密码文件:

sudo x11vnc -storepasswd in /etc/x11vnc.pass

将密码文件复制过去:

sudo cp /root/.vnc/passwd /etc/x11vnc.pass


打开/etc/init/x11vnc.conf文件,粘贴以下内容。
如果没有这个文件,就用文本工具创建一个。端口:5900,自己可以定义。
要打开web 访问VNC,并加参数: -shared  -http

start on login-session-start script x11vnc -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared -http end script


 
Ubuntu上启用X11VNC - 九千澜 - 紅世鐵杖御者

保存后重启Ubuntu。

在别的操作系统里启动VNC Viewer,这里用的是Windows 7下安装的Real VNC。
输入对应的IP地址或主机名,点击Connect连接。
 
Ubuntu上启用X11VNC - 九千澜 - 紅世鐵杖御者

如图,可见Ubuntu登陆界面。
 
Ubuntu上启用X11VNC - 九千澜 - 紅世鐵杖御者




Using Web Browser to Remote Desktop Login to pcDuino

 




In this post, we discuss how to remote access pcDuino’s desktop using a web browser.

To achieve that, a x11vnc server needs to be installed on pcDuino. As x11vnc is built with the factory provided image, we just need to configure it.

Step 1 Configure the password to remote access

1
$x11vnc -storepasswd

Step 2 Start VNC Server

1
$x11vnc -display :0 -xkb -rfbauth .vnc/passwd -auth .Xauthority -shared -http

Now it will dump out the following information:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
23/05/2014 02:20:08 passing arg to libvncserver: -rfbauth
23/05/2014 02:20:08 passing arg to libvncserver: .vnc/passwd
23/05/2014 02:20:08 x11vnc version: 0.9.12 lastmod: 2010-09-09 pid: 1163
23/05/2014 02:20:08 Using X display :0
23/05/2014 02:20:08 rootwin: 0×101 reswin: 0x2a00001 dpy: 0x13ecfb0
23/05/2014 02:20:08
23/05/2014 02:20:08 —————— USEFUL INFORMATION ——————
23/05/2014 02:20:08 X DAMAGE available on display, using it for polling hints.
23/05/2014 02:20:08 To disable this behavior use: ‘-noxdamage’
23/05/2014 02:20:08
23/05/2014 02:20:08 Most compositing window managers like ‘compiz’ or ‘beryl’
23/05/2014 02:20:08 cause X DAMAGE to fail, and so you may not see any screen
23/05/2014 02:20:08 updates via VNC. Either disable ‘compiz’ (recommended) or
23/05/2014 02:20:08 supply the x11vnc ‘-noxdamage’ command line option.
23/05/2014 02:20:08
23/05/2014 02:20:08 Wireframing: -wireframe mode is in effect for window moves.
23/05/2014 02:20:08 If this yields undesired behavior (poor response, painting
23/05/2014 02:20:08 errors, etc) it may be disabled:
23/05/2014 02:20:08 use ‘-nowf’ to disable wireframing completely.
23/05/2014 02:20:08 use ‘-nowcr’ to disable the Copy Rectangle after the
23/05/2014 02:20:08 moved window is released in the new position.
23/05/2014 02:20:08 Also see the -help entry for tuning parameters.
23/05/2014 02:20:08 You can press 3 Alt_L’s (Left “Alt” key) in a row to
23/05/2014 02:20:08 repaint the screen, also see the -fixscreen option for
23/05/2014 02:20:08 periodic repaints.
23/05/2014 02:20:08
23/05/2014 02:20:08 XFIXES available on display, resetting cursor mode
23/05/2014 02:20:08 to: ‘-cursor most’.
23/05/2014 02:20:08 to disable this behavior use: ‘-cursor arrow’
23/05/2014 02:20:08 or ‘-noxfixes’.
23/05/2014 02:20:08 using XFIXES for cursor drawing.
23/05/2014 02:20:08 GrabServer control via XTEST.
23/05/2014 02:20:08
23/05/2014 02:20:08 Scroll Detection: -scrollcopyrect mode is in effect to
23/05/2014 02:20:08 use RECORD extension to try to detect scrolling windows
23/05/2014 02:20:08 (induced by either user keystroke or mouse input).
23/05/2014 02:20:08 If this yields undesired behavior (poor response, painting
23/05/2014 02:20:08 errors, etc) it may be disabled via: ‘-noscr’
23/05/2014 02:20:08 Also see the -help entry for tuning parameters.
23/05/2014 02:20:08 You can press 3 Alt_L’s (Left “Alt” key) in a row to
23/05/2014 02:20:08 repaint the screen, also see the -fixscreen option for
23/05/2014 02:20:08 periodic repaints.
23/05/2014 02:20:08 X FBPM extension not supported.
23/05/2014 02:20:08 X display is capable of DPMS.
23/05/2014 02:20:08 ——————————————————–
23/05/2014 02:20:08
23/05/2014 02:20:08 Default visual ID: 0×21
23/05/2014 02:20:08 Read initial data from X display into framebuffer.
23/05/2014 02:20:08 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
23/05/2014 02:20:08
23/05/2014 02:20:08 X display :0 is 32bpp depth=24 true color
23/05/2014 02:20:08
23/05/2014 02:20:08 Autoprobing TCP port
23/05/2014 02:20:08 Autoprobing selected port 5901
23/05/2014 02:20:08 Listening also on IPv6 port 5901 (socket 10)
23/05/2014 02:20:08 check_httpdir: trying to guess httpdir… x11vnc
23/05/2014 02:20:08 check_httpdir: guessed directory:
23/05/2014 02:20:08 /usr/bin/../share/x11vnc/classes
23/05/2014 02:20:08 http_connections: turning on http service.
23/05/2014 02:20:08 Listening for HTTP connections on TCP port 5801
23/05/2014 02:20:08 URL http://ubuntu:5801
23/05/2014 02:20:08 http_connections: Listening also on IPv6 port 5801 (socket 12)
23/05/2014 02:20:08
23/05/2014 02:20:08 Xinerama is present and active (e.g. multi-head).
23/05/2014 02:20:08 Xinerama: number of sub-screens: 1
23/05/2014 02:20:08 Xinerama: no blackouts needed (only one sub-screen)
23/05/2014 02:20:08
23/05/2014 02:20:08 fb read rate: 19 MB/sec
23/05/2014 02:20:08 The X server says there are 10 mouse buttons.
23/05/2014 02:20:08 screen setup finished.
23/05/2014 02:20:08
23/05/2014 02:20:08 The URLs printed out below (‘Java … viewer URL’) can
23/05/2014 02:20:08 be used for Java enabled Web browser connections.
23/05/2014 02:20:08
 
The VNC desktop is: ubuntu:1
Java viewer URL: http://ubuntu:5801/
PORT=5901

Step 3 Open a web browser

As shown in the log, the port for web access is 5801. We just need to access http://ipaddress:5801. In our case, the ip address is 192.168.1.133.

Enter the IP address along with the port number in the address bar of a web brower and hit enter:

brower_vnc_1

 

If the Java plug in is not installed like in our case, it will prompt us to install. Click ‘Install plug-in..':

brower_vnc_2

 

Click ‘Free Java Download’  to download the plug in:

brower_vnc_3

 

Install the plug in:

 

brower_vnc_4

 

After the installation is done, restart the browser and enter the IP address again:

 

brower_vnc_5

 

For the permission, please select ‘Always run on this site’.

 

Oops. Huston. We got problem!

 

brower_vnc_6

 

Don’t be panic.  Find an utility named ‘Configure Java':

 

brower_vnc_13

 

Navigate to the security tab, and select the security level to be medium:

 

brower_vnc_9

 

Now we restart the web browser, and it will ask for the password when we enter the IP and port address of the pcDuino server:

brower_vnc_11

 

The password is ‘ubuntu’ as we configure in the first step. The desktop of the remote pcDuino will show up in your browser:

brower_vnc_12

 

 

 

浏览2547 评论0
返回
目录
返回
首页
Automating Database Startup and Shutdown on Linux Windows ADSL PPPOE下openVPN安装配置单网卡共享上网