Skip to content

Instantly share code, notes, and snippets.

@suhailpatel
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suhailpatel/8bf790f079bcdaa94f1c to your computer and use it in GitHub Desktop.
Save suhailpatel/8bf790f079bcdaa94f1c to your computer and use it in GitHub Desktop.
OnApp Requesting VNC

Requesting a VNC Console Session via the API

Step 1: Make a request to http://<onapp-cp-url>/virtual_machines/<virtual_machine_id>.json to get the remote access password:

{
  "virtual_machine": {
	... <snip> ...
    "remote_access_password": "abc1234",
    ... <snip> ..
  }
}

Step 2: Make a request to http://<onapp-cp-url>/virtual_machines/<virtual_machine_id>/console.json to request a console session and get an assigned port:

{
  "remote_access_session": {
    "called_in_at": "2014-09-01T16:30:20+01:00",
    "created_at": "2014-09-01T16:30:20+01:00",
    "id": 11,
    "port": 30000,
    "remote_key": "<snip>",
    "updated_at": "2014-09-01T16:30:20+01:00",
    "virtual_machine_id": 53
  }
}

Step 3: You can now make a normal VNC connection using your client to the following URL: vnc://<onapp-cp-url>:<console-port-from-step-2> with the VNC password as the remote_access_password from step 1

Embedding on a Web Page

To embed the console on a web page, you'll need to run your own middleware to connect to a VNC connection. OnApp exposes the VNC connection as described in the previous section via the API.

There are a few HTML5 based options to look into:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment