3

Ubuntu 20.04 both on host and guest.

I'm new to QEMU and trying to set up guest-host communication via serial port. The QEMU documentation says that -serial dev option:

Redirect the virtual serial port to host character device dev.

So I ran QEMU VM with the option -serial pty and got the following console output:

char device redirected to /dev/pts/9 (label serial0)

QUESTION: On host I have the specified device /dev/pts/9 and writing to it with

echo hello > /dev/pts/9

where should I read the output on the guest from?

1 Answer 1

4

When you expose a device with -serial, that will show up as a serial port in your virtual machine. If you look at the kernel log, you should see something like:

Dec 25 15:38:31 fedora kernel: 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

So if inside the virtual machine I run:

echo hello > /dev/ttyS0

Then on the host I will see:

$ cat /dev/pts/4
hello

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .