diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-12-28 11:48:19 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-12-28 11:48:19 -0200 |
commit | 9291fe73ccb0cfc002bf5efa338ff02df2706766 (patch) | |
tree | bafa591e4f5ddb26066ce52c860ed3c6f9f69401 | |
parent | 77dc2e1d2e0ecc5c9f5cd1b91923a471d23533bc (diff) | |
download | vbox-9291fe73ccb0cfc002bf5efa338ff02df2706766.tar.gz vbox-9291fe73ccb0cfc002bf5efa338ff02df2706766.tar.bz2 |
Randomize SPICE port, allowing multiple running VMs on kvmx
-rwxr-xr-x | kvmx | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -7,6 +7,7 @@ BASENAME="`basename $0`" STORAGE="/var/cache/qemu" SHARED="/var/data/load" +PORT="$(($RANDOM + 1024))" VM="$1" # Check @@ -20,7 +21,7 @@ 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 \ + -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 \ @@ -28,4 +29,4 @@ kvm -m 2048 -name $VM -drive file=$STORAGE/$VM.img,if=virtio -vga qxl \ -fsdev local,id=$VM,path=$SHARED,security_model=none -device virtio-9p-pci,fsdev=$VM,mount_tag=$VM & # Run spice client -spicec --host localhost --port 3001 +spicec --host localhost --port $PORT |