Unverified Commit e35d99ee authored by Kroese's avatar Kroese Committed by GitHub
Browse files

fix: Console output (#268)

* fix: Console output
parent 47fdecad
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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
```

+6 −14
Original line number Diff line number Diff line
@@ -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