qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] How do I redirect console IO for script use?


From: Alexei Colin
Subject: Re: [Qemu-discuss] How do I redirect console IO for script use?
Date: Mon, 4 Mar 2019 09:32:39 -0500
User-agent: Mutt/1.11.2 (2019-01-07)

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 address@hidden

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

[Prev in Thread] Current Thread [Next in Thread]