windows-arm: Startup error after modifying configuration.

When I added configuration to Docker Compose.yml to modify RAM and CPU, there was a startup error, whether it was the first creation or modification after creation.

    environment:
      VERSION: "win11"
      RAM_SIZE: "4G"
      CPU_CORES: "4"
root@orangepi5:/root/win# docker-compose up
[+] Building 0.0s (0/0)                                                                                                      docker:default
[+] Running 1/1
 ✔ Container windows  Recreated                                                                                                        0.2s 
Attaching to windows
windows  | ❯ Starting Windows for Docker v1.08...
windows  | ❯ For support visit https://github.com/dockur/windows-arm
windows  | 
windows  | ❯ Booting Windows using QEMU emulator version 8.2.1 ...
windows  | ❯ ERROR: qemu-system-aarch64: Failed to put registers after init: Invalid argument
windows exited with code 0

If the default configuration is used, there will be no errors.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 33 (11 by maintainers)

Most upvoted comments

Rockchip RK3588 have 4 core Cortex-A76 and 4 core Cortex-A55. If disable 4 core Cortex-A76 or 4 core Cortex-A55 and after this container running normally, but with both core, we get an error “qemu-system-aarch64: Failed to put registers after init: Invalid argument”.

  1. sudo chcpu --disable 0,1,2,3
  2. docker compose up
  3. sudo chcpu --enable 0,1,2,3

The problem seems to be due to different kernels

P.S. It doesn’t work with base qemux/qemu-arm image due to

❯ Booting image using QEMU v8.2.4...
taskset: failed to execute exec: No such file or directory

Need to patch

- taskset -c "$CPU_PIN" exec qemu-system-aarch64 ${ARGS:+ $ARGS}
+ taskset -c "$CPU_PIN" qemu-system-aarch64 ${ARGS:+ $ARGS}

It works! Well done 😃

@sund3RRR I will create a new release, with this feature added, thanks!

I think the easiest solution is to override /run/entry.sh and change this line:

- { qemu-system-aarch64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
+ { taskset -c $CPU_TASK_SET qemu-system-aarch64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :

Then add this env to the environment section of compose file:

environment:
  - CPU_TASK_SET: "4,5,6,7"