From d340da83d72b102106922a426ee2ece60501ac61 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 30 Dec 2017 19:32:05 -0200 Subject: Adds spice config param --- kvmx | 12 ++++++++---- kvmxfile | 3 +++ 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" -- cgit v1.2.3