Skip to content

Add support for a custom VNC port #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<IDRAC_HOST>. 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://<IDRAC_HOST>. 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 |

Expand Down
16 changes: 14 additions & 2 deletions startapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -118,8 +129,9 @@ 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 -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
wait
wait