access_legacy_bmc_kvm_consoles_and_other_legacy_java_applets_using_a_podman_container

access legacy BMC KVM consoles and other legacy Java Applets using a podman container

occasionally I have to access a KVM remote console of an old server where the web GUI of the BMC (some call it IPMI, ILO, RMM) is very old and the java applet that's launched in order to provide the remote KVM is no longer running on an up-to-date javaws installation. If you're lucky you can update the server's BMC to a newer version, but if it is old enough there might not be an update anymore or on some other systems the BMC can only be updated through the host, so if you don't have access to a ssh console on the host you can't update your BMC either.

that's why i came up with the following script, which I simply save in my $HOME/bin/legacyff. this script will check if a podmain container called “legacyff” exists on this system already. If not, it will build it. legacyff is based on ubuntu 14.04, (very old, which is exactly the point here ;)) and it contains the “icedtea” java plugin for firefox as well as firefox.

if the legacyff container exists already or once it is built, the script will launch it with x-forwarding, so that an old firefox window will pop up on your desktop where you can now access your old BMC and probably open the KVM console just fine.

here's the script that does it all:

legacyff
#!/bin/bash
if ! which podman; then
  echo "please install podman for this to work"
  exit 1
fi
 
if ! podman image exists legacyff; then
  echo "building podman image for legacyff"
  cat > /tmp/legacyff.docker <<EOF
FROM docker.io/ubuntu:14.04
RUN apt-get update && apt-get -y install icedtea-plugin firefox
RUN timeout 2 firefox --headless || exit 0
RUN cd /root/.mozilla/firefox && echo 'user_pref("dom.disable_open_during_load", false);' >> \$(echo *.default)/prefs.js
CMD firefox
EOF
  podman build -t legacyff -f legacyff.docker /tmp/ || { echo "BUILD FAILED" ; exit 2; }
  rm -f /tmp/legacyff.docker
  echo "done building the container"
fi
 
podman run --rm -ti -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix legacyff
  • access_legacy_bmc_kvm_consoles_and_other_legacy_java_applets_using_a_podman_container.txt
  • Last modified: 23.11.2022 18:25
  • by Pascal Suter