about summary refs log tree commit diff stats
path: root/tools/scripts/runvm/runvm.sh
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2017-08-02 01:04:50 +0100
committerSilvino Silva <silvino@bk.ru>2017-08-02 01:04:50 +0100
commitb1b5779493352c72cced0251625d0b850ebac5b8 (patch)
tree0f40548a2b5c8eaf9bd99423e21b8baf63b83d65 /tools/scripts/runvm/runvm.sh
parented23bb3344ec5be2893db8d8d838c38c9f2baacd (diff)
parent65167272a3ba52dc4d032a1c60a9ff030408047d (diff)
downloaddoc-b1b5779493352c72cced0251625d0b850ebac5b8.tar.gz
new release 0.3.1
Diffstat (limited to 'tools/scripts/runvm/runvm.sh')
-rw-r--r--tools/scripts/runvm/runvm.sh22
1 files changed, 22 insertions, 0 deletions
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 \
+    &