]> gitweb.fluxo.info Git - vbox.git/commitdiff
Adds kvmx wrapper
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Dec 2016 22:07:41 +0000 (20:07 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Dec 2016 22:07:41 +0000 (20:07 -0200)
kvmx [new file with mode: 0755]

diff --git a/kvmx b/kvmx
new file mode 100755 (executable)
index 0000000..0f4dfcd
--- /dev/null
+++ b/kvmx
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# KVM and SPICE client wrapper
+#
+
+# Parameters
+BASENAME="`basename $0`"
+STORAGE="/var/cache/qemu"
+VM="$1"
+
+# Check
+if [ -z "$VM" ]; then
+  echo "usage: $BASENAME <vm>"
+  exit 1
+elif [ ! -e "$STORAGE/$VM.img" ]; then
+  echo "file not found: $STORAGE/$VM.img"
+  exit 1
+fi
+
+# Run virtual machine
+kvm -m 2048 -name $VM -drive file=$STORAGE/$VM.img,if=virtio -vga qxl \
+    -spice port=3001,addr=127.0.0.1,disable-ticketing,streaming-video=off,jpeg-wan-compression=never,playback-compression=off,zlib-glz-wan-compression=never,image-compression=off \
+    -device virtio-serial-pci \
+    -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
+    -chardev spicevmc,id=spicechannel0,name=vdagent \
+    -smp 2 -soundhw ac97 -cpu host -balloon virtio &
+
+# Run spice client
+spicec --host localhost --port 3001