tianon / docker-qemu

Dockerization of supported QEMU releases
https://qemu.org
133 stars 34 forks source link

Adds cloud-init support #42

Closed awapf closed 1 year ago

awapf commented 1 year ago

Works with version 7.1 but I could not get it to work with version 7.2-rc.

7.2-rc throws the following error which I guess is not related to my changes:

exec qemu-system-x86_64 -enable-kvm -smp 4 -m 4096 -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 -boot order=d -netdev user,hostname=243a5e1aaf8e,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 -drive if=virtio,format=raw,file=/tmp/seed.img qemu-system-x86_64: -netdev user,hostname=243a5e1aaf8e,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: network backend 'user' is not compiled into this binary

berlin4apk commented 1 year ago

please source the /usr/bin/cloud-localds file via the deb package, and not directly via a wget as this way is unsecure without gpg or sha256sum check.

tianon commented 1 year ago

Unfortunately, https://packages.debian.org/bullseye/cloud-image-utils has some problematic Depends: (like qemu-utils, that we definitely do not want in our image), so I don't think we can use Debian's cloud-localds package directly unless that gets split. :disappointed:

It seems like genisoimage only adds ~6-8MiB of additional size to the image, so that's probably pretty reasonable, but we'll need to figure out something secure and repeatable for cloud-localds (pinning to a specific version or commit, checksum, etc), or perhaps we document how to do this instead so that we don't add any extra size to the image?

(It kind of feels like this is something QEMU should be able to do by itself, but I guess it's not too surprising that it isn't. :sweat_smile:)