Also see https://gist.github.com/pojntfx/9ed00ff118fc1894abc83061491c252f for a cattle Alpine Linux in QEMU
On macOS? See https://gist.github.com/pojntfx/c41e9daed0a087a11eb83e786a15b199
curl -o ~/Downloads/alpine.iso https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-virt-3.13.0-x86_64.iso
mkdir -p ~/Pets/Alpine
qemu-img create -f qcow2 ~/Pets/Alpine/alpine.qcow2 20G
qemu-system-x86_64 -accel hvf -m 4096 -smp $(sysctl -n hw.ncpu) -boot d -cdrom ~/Downloads/alpine.iso -drive format=qcow2,file=$HOME/Pets/Alpine/alpine.qcow2
qemu-system-x86_64 -accel hvf -m 4096 -smp $(sysctl -n hw.ncpu) -drive format=qcow2,file=$HOME/Pets/Alpine/alpine.qcow2 -nic user,hostfwd=tcp::10022-:22
- To disable the GUI, append
-nographic
. - To pass through a USB device, append
-device nec-usb-xhci -device usb-host,vendorid=0x18d1,productid=0xd00d
. On macOS, you can findvendorid
andproductid
inAbout This Mac/System Report/Hardware/USB
.