diff --git a/docker-compose.yml b/docker-compose.yml index 25e34f2c..0e1bdbc7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,6 @@ services: container_name: qemu image: qemux/qemu-docker:latest environment: - DISPLAY: "vnc" RAM_SIZE: "1G" CPU_CORES: "1" DISK_SIZE: "16G" @@ -19,6 +18,5 @@ services: - NET_ADMIN ports: - 2222:22 - - 5900:5900 restart: on-failure stop_grace_period: 1m diff --git a/readme.md b/readme.md index 82d38959..b894fcb7 100644 --- a/readme.md +++ b/readme.md @@ -32,7 +32,6 @@ services: container_name: qemu image: qemux/qemu-docker:latest environment: - DISPLAY: "vnc" BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-standard-3.18.2-x86_64.iso" devices: - /dev/kvm @@ -40,7 +39,6 @@ services: - NET_ADMIN ports: - 2222:22 - - 5900:5900 restart: on-failure ``` diff --git a/src/display.sh b/src/display.sh index 364c6092..19d23be3 100644 --- a/src/display.sh +++ b/src/display.sh @@ -4,22 +4,14 @@ set -Eeuo pipefail # Docker environment variables : ${GPU:='N'} # GPU passthrough -: ${DISPLAY:='none'} # Display type +: ${DISPLAY:='curses'} # Display type case "${DISPLAY,,}" in vnc) - if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then - DISPLAY_OPTS="-nographic -vga std -vnc :0" - else - DISPLAY_OPTS="-vga std -vnc :0" - fi + DISPLAY_OPTS="-nographic -vga std -vnc :0" ;; *) - if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then - DISPLAY_OPTS="-nographic -display none" - else - DISPLAY_OPTS="" - fi + DISPLAY_OPTS="-nographic -display $DISPLAY" ;; esac @@ -27,6 +19,9 @@ if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then return 0 fi +DISPLAY_OPTS="-display egl-headless,rendernode=/dev/dri/renderD128" +DISPLAY_OPTS="$DISPLAY_OPTS -device virtio-vga,id=video0,max_outputs=1,bus=pcie.0,addr=0x1" + [ ! -d /dev/dri ] && mkdir -m 755 /dev/dri if [ ! -c /dev/dri/card0 ]; then @@ -44,7 +39,4 @@ fi addPackage "xserver-xorg-video-intel" "Intel GPU drivers" addPackage "qemu-system-modules-opengl" "OpenGL module" -DISPLAY_OPTS="$DISPLAY_OPTS -display egl-headless,rendernode=/dev/dri/renderD128" -DISPLAY_OPTS="$DISPLAY_OPTS -device virtio-vga,id=video0,max_outputs=1,bus=pcie.0,addr=0x1" - return 0