aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 19:32:05 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 19:32:05 -0200
commitd340da83d72b102106922a426ee2ece60501ac61 (patch)
tree956948db6ef6969e0417318bf9edd0c8294aecb6
parent79dceafaec991c67822ebce8d998bc775f7afb46 (diff)
downloadkvmx-d340da83d72b102106922a426ee2ece60501ac61.tar.gz
kvmx-d340da83d72b102106922a426ee2ece60501ac61.tar.bz2
Adds spice config param
-rwxr-xr-xkvmx12
-rw-r--r--kvmxfile3
2 files changed, 11 insertions, 4 deletions
diff --git a/kvmx b/kvmx
index 242a3ff..43c132a 100755
--- a/kvmx
+++ b/kvmx
@@ -383,14 +383,18 @@ function kvmx_up {
net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0 -device virtio-net-pci,vlan=0,id=net0,mac=$mac_address,bus=pci.0"
fi
+ if [ -z "$spice" ] || [ "$spice" == "1" ]; then
+ spice_opts"-spice port=$PORT,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"
+ spice_opts"$spice_opts -device virtio-serial-pci"
+ spice_opts"$spice_opts -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0"
+ spice_opts"$spice_opts -chardev spicevmc,id=spicechannel0,name=vdagent"
+ fi
+
# Run virtual machine
# See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
nohup kvm -m $memory -name $VM \
-drive file=$image,if=$drive_interface $graphics $shared \
- -spice port=$PORT,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 \
+ $spice \
-chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-chardev "socket,id=serial0,path=$CONSOLEFILE,server" -device isa-serial,chardev=serial0 \
-smp $smp -soundhw ac97 -cpu host -balloon virtio \
diff --git a/kvmxfile b/kvmxfile
index a7971f2..66e19a9 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -64,6 +64,9 @@ graphics="-vga qxl"
#vnc_client="xvncviewer"
vnc_client="virt-viewer"
+# SPICE support
+spice="1"
+
# Set this if you want to attach an spice client when the machine boots.
run_spice_client="1"