summaryrefslogtreecommitdiffstats
path: root/doc/source/runnova/vncconsole.rst
blob: cf69b610b134bb1fb5fe68d7f51feed9aa5b8bf0 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
..
      Copyright 2010-2011 United States Government as represented by the
      Administrator of the National Aeronautics and Space Administration.
      All Rights Reserved.

      Licensed under the Apache License, Version 2.0 (the "License"); you may
      not use this file except in compliance with the License. You may obtain
      a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
      License for the specific language governing permissions and limitations
      under the License.


Overview
========
The VNC Proxy is an OpenStack component that allows users of Nova to access
their instances through vnc clients.  In essex and beyond, there is support
for for both libvirt and XenServer using both java and websocket cleints.

In general, a VNC console Connection works like so:

* User connects to api and gets an access_url like http://ip:port/?token=xyz
* User pastes url in browser or as client parameter
* Browser/Client connects to proxy
* Proxy authorizes users token, maps the token to a host and port of an
  instance's VNC server
* Proxy initiates connection to VNC server, and continues proxying until
  the session ends

Note that in general, the vnc proxy performs multiple functions:
* Bridges between public network (where clients live) and private network
  (where vncservers live)
* Mediates token authentication
* Transparently deals with hypervisor-specific connection details to provide
  a uniform client experience.


About nova-consoleauth
----------------------
Both client proxies leverage a shared service to manage token auth called
nova-consoleauth.  This service must be running in order for for either proxy
to work.  Many proxies of either type can be run against a single
nova-consoleauth service in a cluster configuration.

Getting an Access Url
---------------------
Nova provides the ability to create access_urls through the os-consoles extension.
Support for accessing this url is provided by novaclient:

    # FIXME (sleepsonthefloor) update this branch name once client code merges
    git clone https://github.com/cloudbuilders/python-novaclient
    git checkout vnc_redux
    . openrc # or whatever you use to load standard nova creds
    nova get-vnc-console [server_id] [xvpvnc|novnc]


Accessing VNC Consoles with a Java client
-----------------------------------------
To enable support for the OpenStack java vnc client in nova, nova provides the
nova-xvpvncproxy service, which you should run to enable this feature.

* :option:`--xvpvncproxy_baseurl=[base url for client connections]` -
  this is the public base url to which clients will connect.  "?token=abc"
  will be added to this url for the purposes of auth.
* :option:`--xvpvncproxy_port=[port]` - port to bind (defaults to 6081)
* :option:`--xvpvncproxy_host=[host]` - host to bind (defaults to 0.0.0.0)

As a client, you will need a special Java client, which is
a version of TightVNC slightly modified to support our token auth::

    git clone https://github.com/cloudbuilders/nova-xvpvncviewer
    cd nova-xvpvncviewer
    make

Then, to create a session, first request an access url using python-novaclient
and then run the client like so::

    # Retrieve access url
    nova get-vnc-console [server_id] xvpvnc
    # Run client
    java -jar VncViewer.jar [access_url]


nova-vncproxy replaced with nova-novncproxy
-------------------------------------------
The previous vnc proxy, nova-vncproxy, has been removed from the nova source
tree and replaced with an improved server that can be found externally at
http://github.com/cloudbuilders/noVNC.git (in a branch called vnc_redux while
this patch is in review).

To use this nova-novncproxy:
    git clone http://github.com/cloudbuilders/noVNC.git
    git checkout vnc_redux
    utils/nova-novncproxy --flagfile=[path to flagfile]

The --flagfile param should point to your nova config that includes the rabbit
server address and credentials.

By default, nova-novncproxy binds 0.0.0.0:6080.  This can be configured with:

* :option:`--novncproxy_baseurl=[base url for client connections]` -
  this is the public base url to which clients will connect.  "?token=abc"
  will be added to this url for the purposes of auth.
* :option:`--novncproxy_port=[port]`
* :option:`--novncproxy_host=[host]`


Accessing a vnc console through a web browser
---------------------------------------------
Retrieving an access_url for a web browser is similar to the flow for
the java client:

    # Retrieve access url
    nova get-vnc-console [server_id] novnc
    # Then, paste the url into your web browser

Support for a streamlined flow via dashboard will land in essex.


Important Options
-----------------
* :option:`--vnc_enabled=[True|False]` - defaults to True. If this flag is
  not set your instances will launch without vnc support.
* :option:`--vncserver_host=[instance vncserver host]` - defaults to 127.0.0.1
  This is the address that vncservers will bind, and should be overridden in
  production deployments as a private address.  Applies to libvirt only.