Skip to main content

Access Java based ipmi kvm consoles without a local Java installation.

Project description

Introduction

NoJava-IPMI-KVM is a tool for running Java-based IPMI-KVM consoles without a local Java installation. It runs a Docker container in the background, starts a suitable Java Webstart version (from OpenJDK) and connects to the container with noVNC. By using Docker, Java Webstart is sandboxed automatically and you don’t need to install old Java versions on your Desktop machines.

This project is based on ideas from solarkennedy/ipmi-kvm-docker.

Installation

The latest version can be obtained from PyPI and runs with Python 2.7 or 3.3+ (Python 3 is recommended):

python3 -m pip install nojava-ipmi-kvm

Install Docker on your local machine if not done already.

Usage

Configuration file

First, create a file ~/.nojava-ipmi-kvmrc and create a configuration section for each kvm host you want to connect to, for example:

[myhostkvm]
full_hostname = myhostkvm.org
login_user = ADMIN
login_endpoint = rpc/WEBSES/create.asp
download_endpoint = Java/jviewer.jnlp
allow_insecure_ssl = False
user_login_attribute_name = WEBVAR_USERNAME
password_login_attribute_name = WEBVAR_PASSWORD
java_version = 7u51
session_cookie_key = SessionCookie
  • full_hostname: Fully qualified name of your KVM host

  • login_user: User to login to the web admin view (default: ADMIN)

  • login_endpoint: Relative POST url of the login form. Is needed to create a login session.

  • download_endpoint: Relative download url of the Java KVM viewer.

  • allow_insecure_ssl: Allow SSL certificates that cannot be validated when logging in and downloading the KVM viewer.

  • user_login_attribute_name: Name of the user login field in the login form (use the web inspector of your favorite browser to find out the field names).

  • password_login_attribute_name: Name of the password field in the login form.

  • java_version: Java version that is needed to run Java KVM viewer. Currently, 7u51 and 7u181 are available (default: 7u181).

  • session_cookie_key: Workaround for web applications that do not set session cookies directly (for example with Javascript). If a login attempt does not set a session cookie, the HTTP reply body is scanned for a potential session cookie value. If a value is found, it will be stored under the name session_cookie_key. In most cases you can simply obmit this configuration key.

In addition, you can create a general section to configure more general settings, e.g.:

[general]
run_docker_with_sudo = False
x_resolution = 1600x1200
  • run_docker_with_sudo: Set to True if the docker command must be called with sudo (needed on Linux if your user account is not a member of the docker group, defaults to False)

  • x_resolution: Resolution of the X server and size of the VNC window (default: 1024x768)

Using the command line tool

After configuring, you can call nojava-ipmi-kvm from the command line:

nojava-ipmi-kvm myhostkvm

You can start nojava-ipmi-kvm multiple times to connect to different machines in parallel. The background Docker container will be shutdown automatically after to you closed the VNC window or sent <Ctrl-C> on the command line.

Options:

usage: nojava-ipmi-kvm [-h] [-f CONFIG_FILEPATH] [--print-default-config] [-V]
                       [hostname]

nojava-ipmi-kvm is a utility to access Java based ipmi kvm consoles without a local java installation.

positional arguments:
  hostname              short hostname of the server machine; must be
                        identical with a hostname in `.nojava-ipmi-kvmrc` (for
                        example `mykvmserver`)

optional arguments:
  -h, --help            show this help message and exit
  -f CONFIG_FILEPATH, --config-file CONFIG_FILEPATH
                        login user (default: ~/.nojava-ipmi-kvmrc)
  --print-default-config
                        print the default config to stdout and exit
  -V, --version         print the version number and exit

Command line completion

This repository offers a completion script for bash and zsh (only hostnames currently, no options).

Bash

Download the Bash completion file and source it in your .bashrc, for example by running:

curl -o .nojava-ipmi-kvm-completion.bash -L https://raw.githubusercontent.com/sciapp/nojava-ipmi-kvm/master/completion/bash/nojava-ipmi-kvm-completion.bash
echo '[ -r "${HOME}/.nojava-ipmi-kvm-completion.bash" ] && source "${HOME}/.nojava-ipmi-kvm-completion.bash"' >> ~/.bashrc

Zsh

You can install the completion script with zplug or manually.

Using zplug

Add zplug "sciapp/nojava-ipmi-kvm" to your .zshrc, open a new shell and run

zplug install

Manual

Clone this repository and source nojava_ipmi_kvm_completion.plugin.zsh in your .zshrc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nojava-ipmi-kvm-0.2.3.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nojava_ipmi_kvm-0.2.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file nojava-ipmi-kvm-0.2.3.tar.gz.

File metadata

  • Download URL: nojava-ipmi-kvm-0.2.3.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.1

File hashes

Hashes for nojava-ipmi-kvm-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6f9f0790d457a72e19ee5dea382835741c000372039af854814a2b0088cc7e0f
MD5 cd03da3c018cc864b468a9af4864ac77
BLAKE2b-256 5db6b6eaf718954a1b64ace0d3b200c649a28793d3dd70804a38ce91a9e8f49f

See more details on using hashes here.

File details

Details for the file nojava_ipmi_kvm-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: nojava_ipmi_kvm-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.1

File hashes

Hashes for nojava_ipmi_kvm-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 531278c968984970eeed2559b2aa367cd8e537cdb9f27d1cee343d8cde045f90
MD5 35437252ea67e43be5deea4bd89bbd95
BLAKE2b-256 0cc8554000c76ac68c561f8d11a5c5dea95b13f932b59edfdabca17d1eb59f25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page