A tool for AI to interact with a QEMU Virtual Machine via its console.
QEMU Console Bridge gives you direct, bidirectional read/write access to a QEMU VM's serial console — no VNC, no SSH, no networking required. It connects over a Unix socket so you can drive a virtual machine programmatically from the moment it boots, which makes it a clean fit for development, debugging, and automation.
Highlights
- Bidirectional console access. Read from and write to the VM console programmatically through a live session.
- No network dependencies. Works from boot — it doesn't need SSH or networking, so you can reach the VM even when those are down.
- Development focused. Built for debugging boot processes, init systems, and other early-system issues — including PID 1 replacements.
- Universal compatibility. Works with any QEMU VM regardless of the guest OS.
- Automation ready. Send a single command, replay a script, or use the Python API to wire VM interactions into CI/CD.
- Emergency access. A console lifeline for system recovery when SSH and networking have failed.
A taste
from src.qemu_console import QEMUConsole
with QEMUConsole('/tmp/vm-console.sock') as console:
console.send_command('login root')
console.send_command('echo "Hello from VM!"')
output = console.read_until('# ')
print(f"VM responded: {output}")
Installation
Clone the source, then start your VM with its serial console redirected to a Unix socket:
git clone https://github.com/Solifugus/qemu-console-bridge.git
qemu-system-x86_64 \
-drive file=your-vm.qcow2,format=qcow2 \
-serial unix:/tmp/vm-console.sock,server,nowait \
-nographic
Then connect to the console:
# Interactive console session
./src/console-bridge.py /tmp/vm-console.sock
# Send a single command
./src/console-bridge.py /tmp/vm-console.sock --command "ls -la"
# Replay an automated script
./src/console-bridge.py /tmp/vm-console.sock --script setup-vm.txt
Downloads & installation
Builds are coming soon. Grab the source from GitHub for now.