diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-12-26 20:07:41 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-12-26 20:07:41 -0200 |
commit | 9a82a06d0ab5acb8632cb250abbc09ea77ccffde (patch) | |
tree | 34f3218a690384373e6462d1443d17838d9dd96f | |
parent | 86ab015ea867a24d5400e4683c305e6eb0568b3b (diff) | |
download | vbox-9a82a06d0ab5acb8632cb250abbc09ea77ccffde.tar.gz vbox-9a82a06d0ab5acb8632cb250abbc09ea77ccffde.tar.bz2 |
Adds kvmx wrapper
-rwxr-xr-x | kvmx | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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 |