Skip to main content

QEMU FAQ

RNG#

qemu-system-x86_64 -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x7

访问远程镜像#

# apk add qemu-block-sshqemu -drive file=ssh://host/path/to/file,if=virtio,cache=none

qemu: uncaught target signal 4 (Illegal instruction) - core dumped#

ppc64le 异常

qemu-s390x: warning: 'msa5-base' requires 'klmd-sha-512'#

s390x 异常

virtfs#

https://wiki.qemu.org/Documentation/9psetup

ProjectZero QEMU: virtfs permits guest to access entire host filesystem https://news.ycombinator.com/item?id=13753950

convert 后无法启动#

  • 在 macOS 下从 qcow2 转换为 raw 后分区信息丢失
  • Linux 未遇到这样的问题
  • 转换后可使用 fdisk 检查分区信息

Overhead#

Containerization vs. Virtualization – More on Overhead

USB#

qemu-system-x86_64 \    -enable-kvm \    -M q35 \    -m 2G \    -usb -usbdevice host:16b2:1001 \    -usb -usbdevice host:0529:0001 \    -usbdevice tablet \    -net nic \    -net bridge,br=br0 \    -vga qxl \    -spice port=5930,disable-ticketing \    -device virtio-serial-pci \    -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \    -chardev spicevmc,id=spicechannel0,name=vdagent \    -drive file=/mnt/data/win-patch.img,if=virtio