Package: nojava-ipmi-kvm
NoJava-IPMI-KVMVersion incompatibility notice (upgrading from v0.8.1)Users upgrading from versionv0.8.1or earlier must rewrite their config files. The previously used ini format was not
flexible enough for adding HTML5 KVM support and was replaced with aYAMLfile.Use the converter scriptconvert_config_file.pyto convert your old ini config file to the new YAML format.Introductionnojava-ipmi-kvmis 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 or Oracle) and connects to the
container withnoVNC. By using Docker, Java Webstart is sandboxed automatically and
you don't need to install old Java versions on your Desktop machines.Starting with versionv0.9.0,nojava-ipmi-kvmalso supports HTML5 based kvm viewers.This project is based on ideas fromsolarkennedy/ipmi-kvm-docker.Deploying as a web serviceIf you would like to access IPMI-KVM consoles with a browser only (without Java plugins and a local installation ofnojava-impi-kvm), seenojava-ipmi-kvm-serverwhich encapsulatesnojava-ipmi-kvmin a web service.Local InstallationThe latest version can be obtained from PyPI and runs with Python 3.5+:python3-mpipinstallnojava-ipmi-kvmInstall Dockeron your local machine if not done already (or Podman with Docker emulation).If you run an Arch-based system, you can also installnojava-ipmi-kvmfrom theAUR:yay-Snojava-ipmi-kvm-dockerIf you prefer Podman to Docker use the Podman version instead:yay-Snojava-ipmi-kvm-podmanUsageConfiguration fileFirst, create a file~/.nojava-ipmi-kvmrc.yamland add a template for each kvm host type you want to connect to, for
example:templates:kvm-openjdk-7u51:skip_login:Falselogin_user:ADMINlogin_endpoint:rpc/WEBSES/create.aspallow_insecure_ssl:Falseuser_login_attribute_name:WEBVAR_USERNAMEpassword_login_attribute_name:WEBVAR_PASSWORDsend_post_data_as_json:Falsesession_cookie_key:SessionCookiedownload_endpoint:Java/jviewer.jnlpjava_version:7u51format_jnlp:Falseskip_login: Skip the login to the KVM host (should beFalsein most cases). If the login is skipped, you can
omitlogin_user,login_endpoint,user_login_attribute_nameandpassword_login_attribute_name.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.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.send_post_data_as_json: Send the login POST request with JSON data as data payload (not needed in most cases)extra_login_form_fields: Comma-separated list of key/value pairs which will be sent as additional data on the
login request. Key and value must be separated by colon (example:method:login).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 namesession_cookie_key. In most cases you
can simply obmit this configuration key. This config value must also be set ifformat_jnlpis set to true.Java-specific configuration keys:download_endpoint: Relative download url of the Java KVM viewer.java_version: Java version that is needed to run Java KVM viewer. Currently,7u51,7u79,7u181,8u91,8u242,7u80-oracleand8u251-oracleare available (default:7u181). The-oracleversions are special
cases which require to build a Docker image yourself because of license restrictions. SeeUsing Oracle
Javafor more details.format_jnlp: Replace "{base_url}" and "{session_key}" in the jnlp file (not needed in most cases)HTML5-specific configuration keys:html5_endpoint: Relative url of the HTML5 kvm console.rewrites: List of transformations / patches which must be applied to the HTML5 kvm console code for embedding
into another web root. Every transformation is described by a dictionary containing the keyssearch(regular
expression),replaceandpath_match(regular expression which specifies which urls will be patched). The
placeholder{subdirectory}contains the new root path.Example:rewrites:-search:'varpath=""'replace:'varpath="{subdirectory}"'path_match:"/novnc/include/nav_ui\\.js$"Then, add a definition for every single kvm host by reusing the previously defined templates:hosts:mykvmhost:based_on:kvm-openjdk-7u51full_hostname:mykvmhost.orgbased_on: Template to use for this host configurationfull_hostname: Fully qualified name of your KVM hostTemplate configuration values can be overwritten in the host section.In addition, you can create ageneralsection to configure more general settings, e.g.:general:
  run_docker_with_sudo: False
  x_resolution: 1600x1200run_docker_with_sudo: Set to True if thedockercommand must be called withsudo(needed on Linux if your user
account is not a member of thedockergroup, defaults toFalse).x_resolution: Resolution of the X server and size of the VNC window (default:1024x768).java_docker_image: Docker image for Java-based kvm consoles (default:sciapp/nojava-ipmi-kvm:v{version}-{java_provider}-{java_major_version}).html5_docker_image: Docker image for Java-based kvm consoles (default:sciapp/nojava-ipmi-kvm:v{version}-html5).Unless you want to use custom docker images, you can omit the config keysjava_docker_imageandhtml5_docker_image.Using the command line toolAfter configuring, you can callnojava-ipmi-kvmfrom the command line:nojava-ipmi-kvmmykvmhostYou can startnojava-ipmi-kvmmultiple times to connect to different machines in parallel. The background Docker
container will be shutdown automatically after to you closed the VNC window (if invoked with the--use-guiflag) or
sent<Ctrl-C>on the command line.Options:usage: nojava-ipmi-kvm [-h] [--debug] [-f CONFIG_FILEPATH] [-g]
                       [--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
  --debug               print debug messages
  -f CONFIG_FILEPATH, --config-file CONFIG_FILEPATH
                        login user (default: ~/.nojava-ipmi-kvmrc)
  -g, --use-gui         automatically open a PyQt5 browser window. Requires
                        PyQt5 to be installed
  --print-default-config
                        print the default config to stdout and exit
  -V, --version         print the version number and exitUsing Oracle JavaBecause of license restrictions we cannot provide pre-built docker images for Oracle Java. However, you can build an
Oracle Java image yourself:Clone this repository:gitclonegit@github.com:sciapp/nojava-ipmi-kvm.gitVisitthe Java download pageand get theLinux x64tar archive of
Oracle Java version8u251. Save it to thedockersubdirectory of the previously cloned repository asjre-8u251-linux-x64.tar.gz. If you would like to also use Oracle Java 7, getjre-7u80-linux-x64.tar.gzfromOracle's Java archive(this
requires an free Oracle account).Open a terminal and go to the root of the project clone. Rungitpull
makebuild-oracleto build a Docker image with Oracle Java. When you install an updated version ofnojava-ipmi-kvmrepeat these
commands.Usejava_version: 8u251-oracle(or7u80-oracle) in your~/.nojava-ipmi-kvmrc.yamlconfiguration.Command line completionThis repository offers a completion script for bash and zsh (only hostnames currently, no options).BashDownloadthe Bash completion
fileand source it in your.bashrc, for example by running:curl-o.nojava-ipmi-kvm-completion.bash-Lhttps://raw.githubusercontent.com/sciapp/nojava-ipmi-kvm/master/completion/bash/nojava-ipmi-kvm-completion.bashecho'[ -r "${HOME}/.nojava-ipmi-kvm-completion.bash" ] && source "${HOME}/.nojava-ipmi-kvm-completion.bash"'>>~/.bashrcZshYou can install the completion script withzplugor manually.Using zplugAddzplug "sciapp/nojava-ipmi-kvm"to your.zshrc, open a new shell and runzpluginstallManualClone this repository and sourcenojava_ipmi_kvm_completion.plugin.zshin your.zshrc.AcknowledgementSpecial thanks to @mheuwes for adding the new YAML config file format and adding HTML5 support!