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/- Source code - http://code.google.com/p/shellinabox/downloads/list
- Binary - http://rpmfind.net/linux/rpm2html/search.php?query=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
Can it be enhanced to also show up at the VM's tab?
ReplyDeleteJoop - Adding the sub-tab and action button shouldn't be difficult.
ReplyDeleteThe problem is understanding the FQDN or ip address of the VM.
If the assumption is that the VM name is the FQDN, then it should be easy.
It would require adding a section (next to the one already available)
api.addMainTabActionButton('VirtualMachine', 'Shell Box', {
onClick : function() {
window.open(getShellBoxUrl(arguments), '_blank');
},
isEnabled : function() {
// The button is enabled only when a
// single VM is selected
return arguments.length == 1;
},
isAccessible : function() {
// The button is always visible
return true;
}
});
// Add 'Shell Box' sub-tab under 'Hosts' main-tab
api.addSubTab('VirtualMachine', 'Shell Box', 'vm-shell-box', '');
VirtualMachineSelectionChange : function() {
if (arguments.length == 1) {
// Update iframe URL on host selection
api.setTabContentUrl(
'vm-shell-box', getShellBoxUrl(arguments));
}
},
Cool !!!
ReplyDeleteAwesome!
ReplyDeleteThis looks cool although I've not been able to make it work.
ReplyDeleteShould "Create 'start.html' file under '/usr/share/ovirt-engine/shellbox-files'" actually be "Create 'start.html' file under '/usr/share/ovirt-engine/ui-plugins/shellbox-files'"?
I see the 'Shell Box' tab but it is always empty. When I do a 'tcpdump -i eth0 port 4200' on the RHEV-M node I see no traffic. When I do the equivalent on the fat RHEL hypervisors, I see nothing.
Note that I'm not runing oVirt but RHEV-M 3.3.
Thanks