I want to attach / eject / swap virtual floppies whilt it runs; perhaps doable via QEMU monitor? #45
Replies: 4 comments
-
I just tried it and this seems to work when using QEMU as the frontend. So in the gui, that would be changing the viewing mode to Direct, or in CLI using the
Yes, I added that in part of my RAM allocation improvement, to communicate with the QEMU balloon driver to tell it how much RAM to make available to the guest. The code used to communicate with the socket is nearby: #try to keep free_ram_goal MB free RAM on Linux at all times by setting the balloon size of the VM
#Windows will eat as much RAM as possible for caches, so it can be reallocated as needed.
#This "balloon_popper" process is what's needed to make the virtio-balloon driver actually do something.
while true;do
sleep 1
qemu_pid="$(cat "$vmdir/qemu.pid" 2>/dev/null)"
[ -z "$qemu_pid" ] && continue
free_ram=$(grep MemFree /proc/meminfo | awk '{print int($2/1024)}')
qemu_used_ram=$(grep VmRSS /proc/$qemu_pid/status | awk '{print $2/1024}' | sed 's/\..*//g')
other_tasks_ram=$((total_ram - (qemu_used_ram + free_ram)))
#echo "other taks use $other_tasks_ram"
balloon_size=$((total_ram - other_tasks_ram - free_ram_goal))
#echo "qemu using $qemu_used_ram, free $free_ram, balloon_size: $balloon_size"
echo "balloon $balloon_size" | socat - UNIX-CONNECT:"$vmdir/qemu.sock" &>/dev/null
done &If you put this into chatgpt, and asked how to open an interactive shell to that socket, it would probably work. |
Beta Was this translation helpful? Give feedback.
-
|
I did "bvm boot", and I could enter the Ctrl-Alt-2 key chord, but I get a mostly black screen with is a couple of lines of text, no command prompt: |
Beta Was this translation helpful? Give feedback.
-
|
So, under bvm with the socket used as it is, I believe I can't do a Ctrl-Alt-2 and get to a qemu prompt. But I could hack together something to talk to qemu via YOUR socket? |
Beta Was this translation helpful? Give feedback.
-
|
Already answered.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
See this link here regarding using QEMU monitor to enter commands to qemu while its running.
Supposedly available two ways :
You're already using -monitor with a much more complicated operand:
-monitor unix:"$vmdir/qemu.sock",server,nowait \(My mostly ignorant guess being that YOU'RE sending commands via that socket somehow?)
In any case, do you see how the user could get command access to the live qemu instance?
I acknowledge that its weird to be handed a way to run the very latest Windows (thank you again!), and then want to use it to install and run the very oldest sorts of 32-bit DOS software...
Beta Was this translation helpful? Give feedback.
All reactions