Archive for September, 2013

Connecting QEMU/KVM virtual machines via serial port

If for some weird reason you need to connect two QEMU/KVM instances via a virtual null modem cable, here’s how to do it:

$ mkfifo null-cable-1.{in,out}
$ ln null-cable-1.in null-cable-2.out
$ ln null-cable-1.out null-cable-2.in
$ qemu -m 512 -nographic -serial pty -serial pipe:null-cable-1 -hda image1.qcow2
$ qemu -m 512 -nographic -serial pty -serial pipe:null-cable-2 -hda image2.qcow2

For each instance, you’ll be dropped into a monitor prompt:

char device redirected to /dev/pts/9
QEMU 0.12.1 monitor - type 'help' for more information

The machine is running already, but in the background. To access its console, open the pty mentioned in the output:

$ screen /dev/pts/9

Read Full Post »