dockur / windows-arm

Windows for ARM in a Docker container.
MIT License
825 stars 91 forks source link

ERROR: Timeout while waiting for QEMU to boot the machine! #149

Closed rogerdk closed 3 weeks ago

rogerdk commented 5 months ago

Operating system

Debian 12 on Orange Pi 5 Plus

Description

When starting docker I see the following error and it dies.

[···]
windows  | ❯ Booting Windows using QEMU v8.2.4...
windows  | ❯ ERROR: Timeout while waiting for QEMU to boot the machine!
windows  | qemu-system-aarch64: terminating on signal 15 from pid 203 (bash)
windows  | ❯ Shutdown completed!
windows exited with code 0

I was following the #37 issue but could not get past this timeout. however since version 2.09 it now dies after giving timeout. before it would hang with some CPU usage.

Docker compose


version: '3.8'

services:
  windows:
    image: dockurr/windows-arm:2.10
    container_name: windows
    environment:
      VERSION: "win11"
      KEYBOARD: "es-ES"
      KVM: "Y"
      DEBUG: "Y"
      CPU_CORES: "2"
      RAM_SIZE: "4G"
      CPU_TASK_SET: "0,1,2,3"
    devices:
      - /dev/kvm
    volumes:
      - ./storage2:/storage
      - ./iso/win11arm64.iso:/custom.iso

    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3389:3389/tcp
      - 3389:3389/udp
      - 5901-5909:5901-5909
    stop_grace_period: 2m
    networks:
      - windows

networks:
  windows:
    name: windows
    ipam:
      config:
        - subnet: '172.17.12.0/24'

Docker log

windows  | ❯ Starting Windows for Docker v2.10...
windows  | ❯ For support visit https://github.com/dockur/windows-arm
windows  | ❯ CPU: Cortex A55 | RAM: 9/16 GB | DISK: 206 GB (ext4) | HOST: 5.10.110-rockchip-rk3588...
windows  |
windows  | ❯ Host: 0bf665e41008  IP: 172.17.12.2  Gateway: 172.17.12.1  Interface: eth0  MAC: 02:D0:B1:0D:0B:02
windows  | nameserver 127.0.0.11
windows  |
windows  | ++ /usr/sbin/dnsmasq --dhcp-range=20.20.20.21,20.20.20.21 --dhcp-host=02:D0:B1:0D:0B:02,,20.20.20.21,QEMU,infinite --dhcp-option=option:netmask,255.255.255.0 --dhcp-option=option:dns-server,20.20.20.1 --dhcp-option=option:router,20.20.20.1 --address=/host.lan/20.20.20.1
windows  |
windows  | Arguments:
windows  |
windows  | -nodefaults
windows  | -cpu host
windows  | -smp 2,sockets=1,dies=1,cores=2,threads=1
windows  | -m 4G
windows  | -machine type=virt,secure=off,dump-guest-core=off,accel=kvm
windows  | -enable-kvm
windows  | -display vnc=:0,websocket=5700
windows  | -device virtio-gpu
windows  | -monitor telnet:localhost:7100,server,nowait,nodelay
windows  | -daemonize
windows  | -D /run/shm/qemu.log
windows  | -pidfile /run/shm/qemu.pid
windows  | -name windows,process=windows,debug-threads=on
windows  | -serial pty
windows  | -device qemu-xhci,id=xhci
windows  | -device usb-kbd
windows  | -device usb-tablet
windows  | -netdev tap,ifname=qemu,script=no,downscript=no,id=hostnet0
windows  | -device virtio-net-pci,romfile=,netdev=hostnet0,mac=02:D0:B1:0D:0B:02,id=net0
windows  | -drive file=/storage/windows.5916098560.iso,id=cdrom0,format=raw,readonly=on,media=cdrom,if=none
windows  | -device virtio-scsi-pci,id=cdrom0b,bus=pcie.0,addr=0x5,iothread=io2
windows  | -device scsi-cd,drive=cdrom0,bus=cdrom0b.0,bootindex=10
windows  | -drive file=/storage/data.img,id=data3,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on,if=none
windows  | -device virtio-scsi-pci,id=data3b,bus=pcie.0,addr=0xa,iothread=io2
windows  | -device scsi-hd,drive=data3,bus=data3b.0,channel=0,scsi-id=0,lun=0,rotation_rate=1,bootindex=3
windows  | -object iothread,id=io2
windows  | -rtc base=localtime
windows  | -drive file=/storage/windows.rom,if=pflash,unit=0,format=raw,readonly=on
windows  | -drive file=/storage/windows.vars,if=pflash,unit=1,format=raw
windows  | -object rng-random,id=objrng0,filename=/dev/urandom
windows  | -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c
windows  | ❯ Booting Windows using QEMU v8.2.4...
windows  | ❯ ERROR: Timeout while waiting for QEMU to boot the machine!
windows  | qemu-system-aarch64: terminating on signal 15 from pid 203 (bash)
windows  | ❯ Shutdown completed!
windows exited with code 0

Screenshots (optional)

No response

kroese commented 5 months ago

Strange.. I thought we had confirmation in #37 now that it works in Pi 5.

But this timeout is maybe a different issue, because that other one produced an error message about registers.

I dont have a clue why it hangs unfortunately :( I only tested this container on the Raspberry Pi 5 and there it worked fine.

rogerdk commented 5 months ago

At the beginning of #37 I was able to solve the: ❯ ERROR: qemu-system-aarch64: Failed to put registers after init: Invalid argument but then I had the timout error.

I started the docker with bash as entrypoint and ran step by step the /run/entry.sh to debug. It seems to fail to start the tty for the vnc but I couldn't find any other log even though there was some CPU usage. Although in the last 2 versions, after the timeout the container died.

bad luck I guess...

kroese commented 5 months ago

Yes, because I added this line to kill QEMU when there is no output for 15 seconds:

https://github.com/dockur/windows-arm/blob/7a5536eec79027c9a53262690e7f7a3958f26d5d/src/power.sh#L41

How did you find that it fails to start the TTY?

Because all that complicated code with pseudo-terminals is just so that I can launch QEMU in the background to be able to do graceful shutdown when the container stops. It can technically all be removed if needed.

Shaun-Fong commented 2 months ago

Same error on Orange Pi 3B☹️

guigoruiz1 commented 1 month ago

Same error on Raspberry Pi 4

kroese commented 1 month ago

Is this issue still present with the latest version (v2.18)?

Shaun-Fong commented 3 weeks ago

Is this issue still present with the latest version (v2.18)?

Yes.

kroese commented 3 weeks ago

Should be fixed now in v2.20, it was confirmed that this version runs on the Orange Pi 5 Plus now.

Shaun-Fong commented 3 weeks ago

Should be fixed now in v2.20, it was confirmed that this version runs on the Orange Pi 5 Plus now.

well, that's weird.

Operating system: Ubuntu 22.04.4 LTS on OrangePi 3B

Compose File:

services:
  windows:
    container_name: windows
    image: dockurr/windows-arm
    environment:
      VERSION: "win11"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3389:3389/tcp
      - 3389:3389/udp
    stop_grace_period: 2m

Log:

windows  | ❯ Starting Windows for Docker v2.20...
windows  | ❯ For support visit https://github.com/dockur/windows-arm
windows  | ❯ CPU: Cortex A55 | RAM: 6/8 GB | DISK: 853 GB (fuseblk) | HOST: 5.10.160-rockchip-rk356x...
windows  | 
windows  | ❯ Warning: the filesystem of /storage is FUSE, this extra layer will negatively affect performance!
windows  | ❯ ERROR: Samba daemon failed to start!
windows  | invalid permissions on directory '/var/log/samba/cores': has 0777 should be 0700
windows  | Failed to create /var/log/samba/cores for user 0 with mode 0700
windows  | Unable to setup corepath for smbd: File exists
windows  | smbd version 4.21.0-Debian-4.21.0+dfsg-1 started.
windows  | Copyright Andrew Tridgell and the Samba Team 1992-2024
windows  | invalid permissions on directory '/run/samba/msg.lock': has 0777 should be 0755
windows  | ❯ Booting Windows using QEMU v9.1.0...
windows  | ❯ ERROR: Timeout while waiting for QEMU to boot the machine!
windows  | qemu-system-aarch64: terminating on signal 15 from pid 202 (<unknown process>)
windows  | ❯ Shutdown completed!
windows exited with code 0
kroese commented 3 weeks ago

@Shaun-Fong I fixed it for the Pi 5 Plus, you have a 3B.

I am not sure what the problem is, but Im pretty sure that the 3B will not have enough power to run Windows in any case.

Shaun-Fong commented 3 weeks ago

@Shaun-Fong I fixed it for the Pi 5 Plus, you have a 3B.

I am not sure what the problem is, but Im pretty sure that the 3B will not have enough power to run Windows in any case.

okay, thanks.

rogerdk commented 3 weeks ago

@kroese I am still experiencing timeouts. I started from zero but I have the same timeout problem. Do I have to have any specific configuration? Just to confirm, I have the OrangePI 5 Plus.