Skip to content
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
3 changes: 2 additions & 1 deletion infrastructure/cdn-in-a-box/optional/vnc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ ENV VNC_USER=$VNC_BUILD_USER

RUN dnf -y install "https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${RHEL_VERSION%%.*}.noarch.rpm" epel-release && \
dnf -y install xterm firefox git tigervnc-server sudo bind-utils net-tools which passwd which \
fluxbox 'google-noto*' terminus-fonts tigervnc vlc wget openssl curl nc && \
fluxbox 'google-noto*' terminus-fonts tigervnc vlc wget openssl curl nc \
xorg-x11-server-utils xorg-x11-fonts* && \
dnf -y clean all && rm -rf /var/cache/dnf

RUN if [[ "${RHEL_VERSION%%.*}" -ge 8 ]]; then \
Expand Down
22 changes: 21 additions & 1 deletion infrastructure/cdn-in-a-box/optional/vnc/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ else
sleep 1
fi

su -c "vncserver :$VNC_INSTANCE_NUM -depth $VNC_DEPTH -geometry $VNC_RESOLUTION" - "$VNC_USER"
su -c "Xvnc :$VNC_INSTANCE_NUM -depth $VNC_DEPTH -geometry $VNC_RESOLUTION -rfbauth /home/$VNC_USER/.vnc/passwd &" - "$VNC_USER"

# Wait a moment for Xvnc to start
sleep 2

# Set DISPLAY environment variable
export DISPLAY=:$VNC_INSTANCE_NUM

# Wait for Traffic Portal to be available
until nc 'trafficportal.infra.ciab.test' 443 </dev/null >/dev/null 2>&1; do
echo "Waiting for Traffic Portal to start"
sleep 2
done

# Start Fluxbox and desktop components
su -c "DISPLAY=:$VNC_INSTANCE_NUM fluxbox &" - "$VNC_USER"
su -c "DISPLAY=:$VNC_INSTANCE_NUM xterm &" - "$VNC_USER"
su -c "DISPLAY=:$VNC_INSTANCE_NUM firefox https://trafficportal.infra.ciab.test &" - "$VNC_USER"

# Set a nice background color
su -c "DISPLAY=:$VNC_INSTANCE_NUM xsetroot -solid '#4A7AA7' &" - "$VNC_USER"

tail -F -- /home/ciabuser/.vnc/vnc*:9.log
18 changes: 5 additions & 13 deletions infrastructure/cdn-in-a-box/optional/vnc/vnc_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,11 @@
# specific language governing permissions and limitations
# under the License.

VNC_DEPTH=${VNC_DEPTH:-32}
VNC_RESOLUTION=${VNC_DEPTH:-1440x900}
# startfluxbox &

startfluxbox &

sleep 3
# sleep 3

vncconfig -iconic &
xterm -bg black -fg white +sb &

until nc 'trafficportal.infra.ciab.test' 443 </dev/null >/dev/null 2>&1; do
echo "Waiting for Traffic Portal to start"
sleep 2
done

firefox 'http://trafficportal.infra.ciab.test' &
fluxbox &
xsetroot -solid '#4A7AA7' &
xterm &