tianon / docker-qemu

Dockerization of supported QEMU releases
https://qemu.org
137 stars 36 forks source link

qemu-system-x86_64: -boot 'order=d': Invalid parameter ''order' #49

Closed MasterZhang007 closed 6 months ago

MasterZhang007 commented 6 months ago

I tried to start the container but all failed.

Here's my docker-compose.yml:

services:
  qemu-container: 
    image: tianon/qemu
    container_name: qemu-container
    restart: unless-stopped
    devices:
      - /dev/kvm
    volumes:
      - /volume1/docker/qemu-container/hda.qcow2:/tmp/hda.qcow2
      - /volume1/OS/ubuntu-24.04-desktop-amd64.iso:/tmp/ubuntu.iso:ro
    environment:
      - QEMU_HDA=/tmp/hda.qcow2
      - QEMU_HDA_SIZE=100G
      - QEMU_CPU=4
      - QEMU_RAM=8192
      - QEMU_CDROM=/tmp/ubuntu.iso
      - QEMU_BOOT='order=d'
      - QEMU_PORTS='2375 2376'

docker logs:

qemu-system-x86_64: -boot 'order=d': Invalid parameter ''order'
+ exec qemu-system-x86_64 -enable-kvm -smp 4 -m 8192 -drive file=/tmp/hda.qcow2,index=0,media=disk,discard=unmap,detect-zeroes=unmap,if=none,id=hda -device virtio-scsi-pci -device scsi-hd,drive=hda -cdrom /tmp/ubuntu.iso -boot ''\''order=d'\''' -netdev 'user,hostname=ca3ac0626590,hostfwd=tcp::22-:22,hostfwd=udp::22-:22,hostfwd=tcp::'\''2375-:'\''2375,hostfwd=udp::'\''2375-:'\''2375,hostfwd=tcp::2376'\''-:2376'\'',hostfwd=udp::2376'\''-:2376'\'',id=net' -device virtio-net-pci,netdev=net -serial stdio -vnc :0
qemu-system-x86_64: -boot 'order=d': Invalid parameter ''order'
+ exec qemu-system-x86_64 -enable-kvm -smp 4 -m 8192 -drive file=/tmp/hda.qcow2,index=0,media=disk,discard=unmap,detect-zeroes=unmap,if=none,id=hda -device virtio-scsi-pci -device scsi-hd,drive=hda -cdrom /tmp/ubuntu.iso -boot ''\''order=d'\''' -netdev 'user,hostname=ca3ac0626590,hostfwd=tcp::22-:22,hostfwd=udp::22-:22,hostfwd=tcp::'\''2375-:'\''2375,hostfwd=udp::'\''2375-:'\''2375,hostfwd=tcp::2376'\''-:2376'\'',hostfwd=udp::2376'\''-:2376'\'',id=net' -device virtio-net-pci,netdev=net -serial stdio -vnc :0
tianon commented 6 months ago

Ah, this is a YAML vs Shell quoting issue. You'll want to change:

      - QEMU_BOOT='order=d'
      - QEMU_PORTS='2375 2376'

to:

      - QEMU_BOOT=order=d
      - QEMU_PORTS=2375 2376

or:

      - 'QEMU_BOOT=order=d'
      - 'QEMU_PORTS=2375 2376'

or swap the entire environment: block to a map so they could become:

      QEMU_BOOT: 'order=d'
      QEMU_PORTS: '2375 2376'
MasterZhang007 commented 6 months ago

@tianon Thank you so much. It worked.