diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2024-01-08 18:50:10 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2024-01-08 18:50:10 +0100 |
| commit | 39abd6b00a427ac4d33564d9a00cde35abe90be8 (patch) | |
| tree | c92ea389ab832929263612b556f8f141feb9ea1a /vm/netbsd.sh | |
| parent | 52ee08731eeebed097cf2d17c76597d7ded5b038 (diff) | |
.
Diffstat (limited to 'vm/netbsd.sh')
| -rw-r--r-- | vm/netbsd.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vm/netbsd.sh b/vm/netbsd.sh new file mode 100644 index 0000000..18aef3b --- /dev/null +++ b/vm/netbsd.sh @@ -0,0 +1,32 @@ +: ${VM_CACHE:?} ${VM_DATA:?} + +netbsd_url=https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/images/NetBSD-9.3-amd64.iso + +iso_path=$VM_CACHE/$(basename -- "$netbsd_url") + +image_path=$VM_DATA/netbsd.qcow2 + + +if [ ! -f $iso_path ]; then + curl -L -o $iso_path $netbsd_url +fi + +if [ ! -f $image_path ]; then + qemu-img create -f qcow2 $image_path 20G +fi + +exec qemu-system-x86_64 \ + -enable-kvm \ + -cpu host \ + -hda $image_path \ + -cdrom $iso_path \ + -m 2G \ + -device e1000,netdev=net0 \ + -netdev user,id=net0 \ + -usb \ + -device usb-tablet \ + -display curses \ + -vga std \ + "$@" + + |
