packer-qemu/run-image.sh

16 lines
362 B
Bash
Raw Normal View History

2020-11-12 13:05:18 +00:00
#!/bin/bash
2020-11-13 15:09:22 +00:00
# pass qcow2 image path as first parameter
2020-11-13 03:02:41 +00:00
if [ "$#" -lt 1 ]; then
2020-11-12 13:05:18 +00:00
exit 1
fi
# -cdrom ./packer/assets/install-amd64-minimal-20200205T214502Z.iso \
qemu-system-x86_64 \
-boot order=d -m 1024 \
-smp cpus=1,sockets=2,maxcpus=2 \
2020-11-13 15:09:22 +00:00
-drive "file=$1,format=qcow2,index=1" \
2020-11-13 03:02:41 +00:00
-net nic,model=virtio \
-net user,hostfwd=tcp::5556-:22
2020-11-12 13:05:18 +00:00