fix: Use VGA adaptor for Windows (#3)

This commit is contained in:
Kroese 2024-02-02 18:58:31 +01:00 committed by GitHub
parent d5c6697f85
commit d4feec5a06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View file

@ -11,7 +11,7 @@ MON_OPTS="-monitor $MONITOR"
USB_OPTS="-device $USB -device usb-kbd -device usb-tablet" USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
RAM_OPTS=$(echo "-m $RAM_SIZE" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g') RAM_OPTS=$(echo "-m $RAM_SIZE" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
CPU_OPTS="-cpu $CPU_FLAGS -smp $CPU_CORES,sockets=1,dies=1,cores=$CPU_CORES,threads=1" CPU_OPTS="-cpu $CPU_FLAGS -smp $CPU_CORES,sockets=1,dies=1,cores=$CPU_CORES,threads=1"
MAC_OPTS="-machine type=${MACHINE},dump-guest-core=off,${KVM_OPTS}" MAC_OPTS="-machine type=${MACHINE},virtualization=true,dump-guest-core=off${KVM_OPTS}"
DEV_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4" DEV_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4"
DEV_OPTS="$DEV_OPTS -object rng-random,id=objrng0,filename=/dev/urandom" DEV_OPTS="$DEV_OPTS -object rng-random,id=objrng0,filename=/dev/urandom"
DEV_OPTS="$DEV_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c" DEV_OPTS="$DEV_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c"

View file

@ -6,6 +6,10 @@ set -Eeuo pipefail
: "${DISPLAY:="web"}" # Display type : "${DISPLAY:="web"}" # Display type
: "${VGA:="virtio-gpu"}" # VGA adaptor : "${VGA:="virtio-gpu"}" # VGA adaptor
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
[[ "$VGA" == "virtio-gpu" ]] && VGA="VGA"
fi
case "${DISPLAY,,}" in case "${DISPLAY,,}" in
vnc) vnc)
DISPLAY_OPTS="-display vnc=:0 -device $VGA" DISPLAY_OPTS="-display vnc=:0 -device $VGA"
@ -15,7 +19,7 @@ case "${DISPLAY,,}" in
;; ;;
ramfb) ramfb)
DISPLAY_OPTS="-display vnc=:0,websocket=5700 -device ramfb" DISPLAY_OPTS="-display vnc=:0,websocket=5700 -device ramfb"
;; ;;
none) none)
DISPLAY_OPTS="-display none" DISPLAY_OPTS="-display none"
;; ;;

View file

@ -9,9 +9,9 @@ cd /run
. reset.sh # Initialize system . reset.sh # Initialize system
. install.sh # Get bootdisk . install.sh # Get bootdisk
. disk.sh # Initialize disks . disk.sh # Initialize disks
. display.sh # Initialize graphics
. network.sh # Initialize network . network.sh # Initialize network
. boot.sh # Configure boot . boot.sh # Configure boot
. display.sh # Initialize graphics
. proc.sh # Initialize processor . proc.sh # Initialize processor
. config.sh # Configure arguments . config.sh # Configure arguments

View file

@ -33,7 +33,7 @@ fi
if [[ "$KVM" != [Nn]* ]]; then if [[ "$KVM" != [Nn]* ]]; then
CPU_FEATURES="kvm=on" CPU_FEATURES="kvm=on"
KVM_OPTS=",accel=kvm,virtualization=true -enable-kvm" KVM_OPTS=",accel=kvm -enable-kvm"
if [[ "${BOOT_MODE,,}" == "windows" ]]; then if [[ "${BOOT_MODE,,}" == "windows" ]]; then
@ -51,7 +51,7 @@ else
if [[ "$ARCH" == "arm"* ]]; then if [[ "$ARCH" == "arm"* ]]; then
CPU_MODEL="max" CPU_MODEL="max"
else else
CPU_MODEL="cortex-a76" CPU_MODEL="cortex-a57"
fi fi
fi fi