fix: Console output (#268)

* fix: Console output
This commit is contained in:
Kroese 2023-12-25 07:36:40 +01:00 committed by GitHub
parent 47fdecadbb
commit e35d99eec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 18 deletions

View file

@ -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

View file

@ -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
```

View file

@ -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
;;
*)
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