KVMX currently needs a Debian-based system and the following dependencies:
- sudo apt install git qemu qemu-kvm virt-viewer spice-client spice-client-gtk
+ sudo apt install git qemu qemu-kvm virt-viewer spice-client spice-client-gtk socat
If you plan to create guest images, you may also want the following packages:
SPICELOG="$LOG_DIR/spice"
XPRALOG="$LOG_DIR/xpra"
XDMCPLOG="$LOG_DIR/xdmcp"
+ MONITORFILE="$STATE_DIR/monitor"
if [ -e "$STORAGE/ssh/$VM.key" ]; then
mkdir -p "$STORAGE/ssh"
-device virtio-serial-pci \
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
-chardev spicevmc,id=spicechannel0,name=vdagent \
+ -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-smp $smp -soundhw ac97 -cpu host -balloon virtio \
-net nic,model=$nic_model \
-net user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd $qemu_opts &> $LOGFILE < /dev/null &
kvmx_rename $*
}
+# Interface to QEMU monitor
+function kvmx_monitor {
+ if ! kvmx_running; then
+ echo "$BASENAME: guest $VM is not running"
+ exit 1
+ fi
+
+ if ! which socat &> /dev/null; then
+ echo "$BASENAME: please install socat"
+ exit 1
+ fi
+
+ socat $MONITORFILE STDIO
+}
+
# Install system
function kvmx_install {
if kvmx_running; then