aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xkvmx17
2 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index 7d4158d..6d0eb54 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ sources, you'll feel welcome here :)
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:
diff --git a/kvmx b/kvmx
index ee32862..f896815 100755
--- a/kvmx
+++ b/kvmx
@@ -166,6 +166,7 @@ function __kvmx_initialize {
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"
@@ -376,6 +377,7 @@ function kvmx_up {
-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 &
@@ -1370,6 +1372,21 @@ function kvmx_mv {
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