Thursday, January 17, 2013

oVirt WebAdmin + ShellInABox UI Plugin

Inspired by a recent post on Oved's blog regarding the new UI-plugins infrastructure
introduced by oVirt,  I've decided to take my chances and create one myself.

The Challenge

Using oVirt WebAdmin, make SSH connection to a host and emulate a terminal.
  • Hosts main-tab -> create a 'Shell Box' action button
  • Hosts main-tab -> create a 'Shell Box' sub-tab

The Means

Shell In A Box: http://code.google.com/p/shellinabox/

The Implementation

oVirt Engine side

  • Create 'shellbox.json' file under '/usr/share/ovirt-engine/ui-plugins'
    (a plugin configuration file):
  • Create 'start.html' file under '/usr/share/ovirt-engine/shellbox-files'
    (the iframe content HTML file):

Host side

  • Download and Install 'shellinabox': http://rpmfind.net/linux/rpm2html/search.php?query=shellinabox
  • Edit configuration file '/etc/sysconfig/shellinaboxd':
    Replace 'OPTS="-s /:LOGIN"' with 'OPTS="--disable-ssl --service /:SSH"'
  • Start 'shellinabox' service

The Results

Shell Box sub-tab:


Shell Box action button (+ context menu):


Shell Box on a new browser tab:


The Source Code on oVirt


Thanks!

  • For UI-plugins infrastructure: Vojtech Szocs
  • For oVirt-Foreman UI Plugin: Oved Ourfali