diff options
Diffstat (limited to 'tools/scripts/runvm')
-rw-r--r-- | tools/scripts/runvm/profile/crux | 3 | ||||
-rw-r--r-- | tools/scripts/runvm/runvm.sh | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tools/scripts/runvm/profile/crux b/tools/scripts/runvm/profile/crux new file mode 100644 index 0000000..eb2dc63 --- /dev/null +++ b/tools/scripts/runvm/profile/crux @@ -0,0 +1,3 @@ +iso=iso/crux-3.2.iso +image=img/crux-img.qcow2 +tap="tap1" diff --git a/tools/scripts/runvm/runvm.sh b/tools/scripts/runvm/runvm.sh new file mode 100644 index 0000000..db479cc --- /dev/null +++ b/tools/scripts/runvm/runvm.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +function rmac_addr (){ +printf '54:60:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) +} + +source profile/$1 +boot=$2 + +mac=$(rmac_addr) + +qemu-system-x86_64 \ + -enable-kvm \ + -m 1024 \ + -boot ${boot} \ + -cdrom ${iso} \ + -hda ${image} \ + -vga std \ + -display sdl \ + -device e1000,netdev=t0,mac=${mac} \ + -netdev tap,id=t0,ifname=${tap},script=no,downscript=no \ + & |