From cbb7e3a042274b8d77e74c6474b6822970180278 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 15:03:24 +0100 Subject: [PATCH] fix: Display fallback (#636) --- src/display.sh | 10 ++++++---- src/network.sh | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/display.sh b/src/display.sh index 9df2cace..732b95e5 100644 --- a/src/display.sh +++ b/src/display.sh @@ -8,17 +8,19 @@ set -Eeuo pipefail : "${DISPLAY:="web"}" # Display type : "${RENDERNODE:="/dev/dri/renderD128"}" # Render node +[[ "$DISPLAY" == ":0" ]] && DISPLAY="web" + case "${DISPLAY,,}" in - vnc) + "vnc" ) DISPLAY_OPTS="-display vnc=:0 -vga $VGA" ;; - web) + "web" ) DISPLAY_OPTS="-display vnc=:0,websocket=5700 -vga $VGA" ;; - disabled) + "disabled" ) DISPLAY_OPTS="-display none -vga $VGA" ;; - none) + "none" ) DISPLAY_OPTS="-display none -vga none" ;; *) diff --git a/src/network.sh b/src/network.sh index 44e525bf..8063cbbe 100644 --- a/src/network.sh +++ b/src/network.sh @@ -177,6 +177,7 @@ configureUser() { configureNAT() { local tuntap="TUN device is missing. $ADD_ERR --device /dev/net/tun" + local tables="The 'ip_tables' kernel module is not loaded. Try this command: sudo modprobe ip_tables iptable_nat" # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then @@ -198,8 +199,6 @@ configureNAT() { fi fi - local tables="The 'ip_tables' kernel module is not loaded. Try this command: sudo modprobe ip_tables iptable_nat" - # Create a bridge with a static IP for the VM guest { ip link add dev dockerbridge type bridge ; rc=$?; } || :