aboutsummaryrefslogtreecommitdiff
path: root/vm/openbsd/run.sh
blob: ac5d7a9105b3f1511e80de2f6f1ca49533c8cc28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

cd $(dirname -- "$0")

if [ ! -f openbsd.iso ]; then
    curl -L -o openbsd.iso https://cdn.openbsd.org/pub/OpenBSD/6.9/i386/cd69.iso
fi

if [ ! -f openbsd.qcow2 ]; then
    qemu-img create -f qcow2 openbsd.qcow2 20G
fi

exec qemu-system-x86_64 \
    -enable-kvm \
    -cpu host \
    -hda openbsd.qcow2 \
    -cdrom openbsd.iso \
    -m 2G \
    -device e1000,netdev=net0 \
    -netdev user,id=net0 \
    -usb \
    -device usb-tablet \
    "$@"