On Sun, Mar 03, 2019 at 10:56:53AM +0100, Joachim Durchholz wrote:
> - redirect just the physical console
>   (not a pty or anything inside the VM)

This part is confusing. The '-serial pty' argument redirects a physical
serial port (UART) on the emulated (target) machine to a pseudo-terminal
device on the host (a PTY). The "PTY" is not inside the VM. Redirecting
to PTY is one of many options, among the others are redirecting to
a TCP or UDP network endpoint. The redirection endpoint has no bearing
on the serial port within the emulated machine. I use -serial pty.

If you're running Linux in the target, configure to run a getty on that
serial port, with /etc/inittab or with systemd [email protected].

To attach to a PTY with a terminal, you can use 'screen' or 'minicom':
    screen /dev/pty/123
This will also accept keyboard input. In short, it is no different
than connecting with screen to a real HW UART dongle, like with:
    screen /dev/ttyUSB0 115200.

You can script the launching of screen, of course (presumably in a
separate shell, possibly in a separate xterm window if you wish).

There's also -serial stdio which will redirect the target UART to the
stdin/stdout of the shell that invoked qemu.

Reply via email to