From 2c35a02a9533304771ef9bb819a69ff64bd1ae21 Mon Sep 17 00:00:00 2001 From: nochkin Date: Fri, 3 May 2024 15:33:57 -0400 Subject: [PATCH 1/3] Add support for a custom VNC port --- Dockerfile | 1 + startapp.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f79a2b..24a51b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM jlesage/baseimage-gui:debian-11 ENV APP_NAME="iDRAC 6" \ IDRAC_PORT=443 \ + IDRAC_VNC_PORT=5900 \ DISPLAY_WIDTH=801 \ DISPLAY_HEIGHT=621 diff --git a/startapp.sh b/startapp.sh index c3c4879..dbedf9b 100644 --- a/startapp.sh +++ b/startapp.sh @@ -26,6 +26,11 @@ if [ -f "/run/secrets/idrac_password" ]; then IDRAC_PASSWORD="$(cat /run/secrets/idrac_password)" fi +if [ -f "/run/secrets/idrac_vnc_port" ]; then + echo "Using Docker secret for IDRAC_VNC_PORT" + IDRAC_VNC_PORT="$(cat /run/secrets/idrac_vnc_port)" +fi + if [ -z "${IDRAC_HOST}" ]; then echo "${RED}Please set a proper idrac host with IDRAC_HOST${NC}" sleep 2 @@ -50,6 +55,12 @@ if [ -z "${IDRAC_PASSWORD}" ]; then exit 1 fi +if [ -z "${IDRAC_VNC_PORT}" ]; then + echo "${RED}Please set a proper idrac VNC port with IDRAC_VNC_PORT${NC}" + sleep 2 + exit 1 +fi + echo "Environment ok" cd /app @@ -118,8 +129,8 @@ if [ -n "$IDRAC_KEYCODE_HACK" ]; then export LD_PRELOAD=/keycode-hack.so fi -exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html" & +exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=${IDRAC_VNC_PORT} vport=${IDRAC_VNC_PORT} user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:${IDRAC_PORT}/help/contents.html" & # If an iso exists at the specified location, mount it [ -f "/vmedia/$VIRTUAL_ISO" ] && /mountiso.sh -wait \ No newline at end of file +wait From c8950002678e46c53bcc6b023e9abfedd4ae7abb Mon Sep 17 00:00:00 2001 From: nochkin Date: Fri, 3 May 2024 15:41:21 -0400 Subject: [PATCH 2/3] Update doc to reflect IDRAC_VNC_PORT variable --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8be2e73..3d60a25 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,11 @@ The web interface will be available on port 5800 while the VNC server can be acc | Variable | Description | Required | |----------------|----------------------------------------------|----------| -|`IDRAC_HOST`| Host for your iDRAC instance. Make sure your instance is reachable with https://. See IDRAC_PORT for using custom ports. HTTPS is always used. | Yes | +|`IDRAC_HOST`| Host for your iDRAC instance. Make sure your instance is reachable with https://. See IDRAC_PORT and IDRAC_VNC_PORT for using custom ports. HTTPS is always used. | Yes | |`IDRAC_USER`| Username for your iDRAC instance. | Yes | |`IDRAC_PASSWORD`| Password for your iDRAC instance. | Yes | |`IDRAC_PORT`| The optional port for the web interface. (443 by default) | No | +|`IDRAC_VNC_PORT`| The optional port for the VNC interface. (5900 by default) | No | |`IDRAC_KEYCODE_HACK`| If you have issues with keyboard input, try setting this to ``true``. See [here](https://github.com/anchor/idrac-kvm-keyboard-fix) for more infos. | No | |`VIRTUAL_MEDIA`| Filename of iso located within /vmedia to automount | No | From 2e056b3fab554d78700bbccd42a1ebb43d7f52b3 Mon Sep 17 00:00:00 2001 From: nochkin Date: Sat, 28 Sep 2024 23:34:24 -0400 Subject: [PATCH 3/3] Add java options to resolve crash --- startapp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/startapp.sh b/startapp.sh index dbedf9b..9125653 100644 --- a/startapp.sh +++ b/startapp.sh @@ -129,7 +129,8 @@ if [ -n "$IDRAC_KEYCODE_HACK" ]; then export LD_PRELOAD=/keycode-hack.so fi -exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=${IDRAC_VNC_PORT} vport=${IDRAC_VNC_PORT} user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:${IDRAC_PORT}/help/contents.html" & + +exec java -cp avctKVM.jar -XX:+AlwaysPreTouch -XX:+TieredCompilation -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:MaxMetaspaceSize=1024m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:MaxTenuringThreshold=15 -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=${IDRAC_VNC_PORT} vport=${IDRAC_VNC_PORT} user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:${IDRAC_PORT}/help/contents.html" & # If an iso exists at the specified location, mount it [ -f "/vmedia/$VIRTUAL_ISO" ] && /mountiso.sh