Add automount capability

This commit is contained in:
Josh Chambers 2022-02-28 19:14:42 -08:00
parent 27059eba65
commit 5ed5512305
5 changed files with 45 additions and 7 deletions

View File

@ -11,7 +11,7 @@ RUN APP_ICON_URL=https://raw.githubusercontent.com/DomiStyle/docker-idrac6/maste
install_app_icon.sh "$APP_ICON_URL" install_app_icon.sh "$APP_ICON_URL"
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y wget software-properties-common libx11-dev gcc && \ apt-get install -y wget software-properties-common libx11-dev gcc xdotool && \
wget -nc https://cdn.azul.com/zulu/bin/zulu7.52.0.11-ca-jdk7.0.332-linux_amd64.deb && \ wget -nc https://cdn.azul.com/zulu/bin/zulu7.52.0.11-ca-jdk7.0.332-linux_amd64.deb && \
apt-get install -y ./zulu7.52.0.11-ca-jdk7.0.332-linux_amd64.deb && \ apt-get install -y ./zulu7.52.0.11-ca-jdk7.0.332-linux_amd64.deb && \
gcc -o /keycode-hack.so /keycode-hack.c -shared -s -ldl -fPIC && \ gcc -o /keycode-hack.so /keycode-hack.c -shared -s -ldl -fPIC && \
@ -24,5 +24,6 @@ RUN mkdir /app && \
chown ${USER_ID}:${GROUP_ID} /app chown ${USER_ID}:${GROUP_ID} /app
COPY startapp.sh /startapp.sh COPY startapp.sh /startapp.sh
COPY mountiso.sh /mountiso.sh
WORKDIR /app WORKDIR /app

View File

@ -1,9 +1,9 @@
# iDRAC 6 dockerized # iDRAC 6 dockerized
![Web interface](https://i.imgur.com/Au9DPmg.png) ![Web interface](https://i.imgur.com/Sg6qYtT.png)
*Web interface* *Web interface*
![Guacamole](https://i.imgur.com/8IWAATS.png) ![Guacamole](https://i.imgur.com/LcD0q2a.png)
*Directly connected to VNC via Guacamole* *Directly connected to VNC via Guacamole*
## About ## About
@ -15,9 +15,15 @@ Container is based on [baseimage-gui](https://github.com/jlesage/docker-baseimag
# Usage # Usage
See the docker-compose [here](https://github.com/DomiStyle/docker-idrac6/blob/master/docker-compose.yml) or use this command: See the docker-compose [here](https://github.com/DomiStyle/docker-idrac6/blob/master/docker-compose.yml) or use this command:
```
docker run -d -p 5800:5800 -p 5900:5900 -e IDRAC_HOST=idrac1.example.org -e IDRAC_USER=root -e IDRAC_PASSWORD=1234 domistyle/idrac6 docker run -d \
-p 5800:5800 \
-p 5900:5900 \
-e IDRAC_HOST=idrac1.example.org \
-e IDRAC_USER=root \
-e IDRAC_PASSWORD=1234 \
domistyle/idrac6
```
The web interface will be available on port 5800 while the VNC server can be accessed on 5900. Startup might take a few seconds while the Java libraries are downloaded. You can add a volume on /app if you would like to cache them. The web interface will be available on port 5800 while the VNC server can be accessed on 5900. Startup might take a few seconds while the Java libraries are downloaded. You can add a volume on /app if you would like to cache them.
## Configuration ## Configuration
@ -29,6 +35,7 @@ The web interface will be available on port 5800 while the VNC server can be acc
|`IDRAC_PASSWORD`| Password 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_PORT`| The optional port for the web interface. (443 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 | |`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 |
**For advanced configuration options please take a look [here](https://github.com/jlesage/docker-baseimage-gui#environment-variables).** **For advanced configuration options please take a look [here](https://github.com/jlesage/docker-baseimage-gui#environment-variables).**

View File

@ -11,6 +11,9 @@ services:
- IDRAC_HOST=idrac1.example.org - IDRAC_HOST=idrac1.example.org
- IDRAC_USER=root - IDRAC_USER=root
- IDRAC_PASSWORD=1234 - IDRAC_PASSWORD=1234
# Experimental! To directly mount an iso as iDRAC virtual media,
# uncomment the below and set to a filename that appears in /vmedia
# - VIRTUAL_ISO=name_of_iso.iso
volumes: volumes:
- /path/to/app:/app - /path/to/app:/app
- /path/to/media:/vmedia - /path/to/media:/vmedia

24
mountiso.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Wait for iDRAC to load
sleep 15s
# Click "Virtual Media"
xdotool mousemove 10 10 click 1
sleep 1s
# Click "Launch Virtual Media"
xdotool mousemove 10 30 click 1
sleep 3s
# Click "Add Image"
xdotool mousemove 500 80 click 1
sleep 1s
# Get image from $VIRTUAL_ISO var
xdotool type "/vmedia/$VIRTUAL_ISO"
xdotool key Return
sleep 1s
# Map image
xdotool mousemove 56 63 click 1

View File

@ -118,5 +118,8 @@ if [ -n "$IDRAC_KEYCODE_HACK" ]; then
export LD_PRELOAD=/keycode-hack.so export LD_PRELOAD=/keycode-hack.so
fi 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=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html" # If an iso exists at the specified location, mount it
[ -f "/vmedia/$VIRTUAL_ISO" ] && /mountiso.sh
wait