dfuchslin / jviewer-starter

Script that starts AM MegaRAC Remote Console Viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JViewer starter script

Script to download and start the JViewer remote console application. It has become increasingly difficult to execute Java Web Start applications, this script helps alleviate the pain and frustration. Tested on my AsrockRack D1541D4U-2T8R.

Furthermore, the JViewer version in the latest BMC firmware (as of 2022) requires Java 8 and does not work on architectures other than x86 (Intel/AMD).

This was a problem for me when I got my new M1-based Mac. I found this excellent script (forked from https://github.com/arbu/jviewer-starter -- thank you! šŸ«¶), and I modified it to work with a non-default Java installation so that an x64 Java can be started (rather than an Apple Silicon aarch64 Java). This will run under Rosetta. However, since Rosetta will most likely not be around forever, I also wrapped the script in a Docker container (built with x64 architecture). The Docker container can be run on any architecture via Docker, hopefully providing somewhat more "future-proofness" if/when Rosetta is removed from MacOS. The Docker container expects an x-server (referenced by the DISPLAY env variable), and therefore also requires XQuartz to be installed on MacOS.

I use MacOS and have tested both the initial script and the docker container. I have not extensively tested this on Linux hosts. Zero testing has been performed on Windows, good luck there.

Installation

  • Install Java 8 for x64 (other architectures and newer JREs not supported by JViewer!). Examples:
  • Install Docker (optional, if you do not want to install Java locally)
  • Install XQuartz (needed if using Docker and MacOS)

MacOS:

I recommend symlinking the scripts to /usr/local/bin (or another location in your PATH) so they can be easily started:

ln -s $(pwd)/jviewer-starter.py /usr/local/bin/jviewer-starter
ln -s $(pwd)/jviewer-docker.sh /usr/local/bin/jviewer-docker

MacOS (Intel):

brew install zulu8

MacOS (Apple Silicon)

Homebrew installs the aarch64 version, but unfortunately we need the x64 version (which will run via Rosetta). Manual install (is there an easier way to do this via Homebrew? seems this may help: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f):

export ZULU_VERSION=zulu8.64.0.19-ca-jdk8.0.345-macosx_x64
curl -L "https://cdn.azul.com/zulu/bin/${ZULU_VERSION}.tar.gz" -o /tmp/${ZULU_VERSION}.tar.gz
pushd /tmp
tar -xzvf ${ZULU_VERSION}.tar.gz
mv /tmp/${ZULU_VERSION}/zulu-8.jdk /tmp/${ZULU_VERSION}/zulu-8-x64.jdk
sudo mv /tmp/${ZULU_VERSION}/zulu-8-x64.jdk /Library/Java/JavaVirtualMachines/
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/zulu-8-x64.jdk
sudo chown -R root:wheel /Library/Java/JavaVirtualMachines/zulu-8-x64.jdk
rm -rf /tmp/${ZULU_VERSION}*
export ZULU_VERSION
popd

# then set the java version for JViewer
export JVIEWER_JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8-x64.jdk/Contents/Home

Other Operating Systems:

gl;hf

Running

Run with a locally-installed Java:

jviewer-starter
jviewer-starter --host [ipmi ip/hostname] --username [ipmi username] --password [ipmi password]

Run via Docker:

jviewer-docker
jviewer-docker --host [ipmi ip/hostname] --username [ipmi username] --password [ipmi password]

Issues

XQuarts 2.8.2 has a known issue in which GUI background elements inverse their colors upon mouse movement. I have applied a recommended fix via Java properties injected in JVIEWER_JAVA_OPTIONS. This only affects when running JViewer via Docker, not when running JViewer with a locally-installed Java.

References:

About

Script that starts AM MegaRAC Remote Console Viewer


Languages

Language:Python 88.9%Language:Dockerfile 9.4%Language:Shell 1.7%