Re: issues with Qemu output in terminal

2022-07-14 Thread James Miller

On Thu, 14 Jul 2022, Peter Maydell wrote:


'-nographic' just tells QEMU to emulate a machine with no graphics
and with a serial terminal connected to your terminal window. It
doesn't (and cannot) do anything to ensure that the software
running on the machine is actually going to send text output to
the serial terminal. This is like real hardware -- you can take
a PC, and unplug the monitor, and connect a serial cable from the
PC's serial port to a serial terminal. But unless the OS you're
booting on the PC knows about the serial port, it will just try to
display its output on the monitor that's not plugged in, and the
serial terminal will not display anything.


Thanks for your reply, Peter. Yeah, I kinda figured the man page might be 
oversimplifying a bit and that some further behind-the-scenes plumbing 
might be required. That's why I suggested that perhaps the terminal I'm 
using was not being detected as a console. Short of reconfiguring the 
guest OS for something more like actual terminal output through the serial 
port, is there a way to get a better display using the current -display 
curses -vga virtio method? Like, one that takes up more than about 50% of 
the terminal window? I suppose what's happening is that some emulated vga 
hardware is displaying shell input/output at a low resolution (640x480?) 
in my terminal, right?


I've had some better success trying to accomplish my aim using Docker, at 
least so far as getting an interactive shell from the guest OS that 
displays fine in my ssh/tmux session. But I had a fair amount of 
experience in former years (maybe 15 years ago?) with setting up guest 
OS's under Qemu, so I wanted to give it a shot as well.




Re: issues with Qemu output in terminal

2022-07-14 Thread Peter Maydell
On Thu, 14 Jul 2022 at 20:43, James Miller  wrote:
> I would think the -nographic switch would be the one to get me
> command-line access to the guest OS, since the man page says "Normally, if
> QEMU is compiled with graphical window support, it displays output such as
> guest graphics, guest console, and the QEMU monitor in a window. With this
> option, you can totally disable graphical output so that QEMU is a simple
> command line application. The emulated serial port is redirected on the
> console and muxed with the monitor (unless redirected elsewhere
> explicitly). Therefore, you can still use QEMU to debug a Linux kernel
> with a serial console. Use C-a h for help on switching between the console
> and monitor." I guess the terminal I start Qemu from is not being detected
> as a console or something?

'-nographic' just tells QEMU to emulate a machine with no graphics
and with a serial terminal connected to your terminal window. It
doesn't (and cannot) do anything to ensure that the software
running on the machine is actually going to send text output to
the serial terminal. This is like real hardware -- you can take
a PC, and unplug the monitor, and connect a serial cable from the
PC's serial port to a serial terminal. But unless the OS you're
booting on the PC knows about the serial port, it will just try to
display its output on the monitor that's not plugged in, and the
serial terminal will not display anything.

So generally you need both to use -nographic and *also* to use
a suitably configured guest OS. How to configure the guest OS,
and to what extent it can just figure out to use the serial port
without much extra configuration, is entirely dependent on the
guest OS. You should be able to use any howtos/documentation for
how to get that guest OS to work with a real-hardware serial console.

thanks
-- PMM



issues with Qemu output in terminal

2022-07-14 Thread James Miller
Actually what I'm trying to do is get a guest OS with no graphics 
installed to display it's command line in a terminal I can access in an 
ssh/tmux session.


Nothing I tried, mostly focusing on the -nographic and -display curses 
options was working until I came across 
https://lists.nongnu.org/archive/html/qemu-discuss/2016-12/msg00042.html, 
which sort of works. I believe the operative bit from that post is -vga 
virtio. That allows me to get command line access to the guest OS, albeit 
in small window that takes up only about 50% of the terminal window in 
which it displays. So, is this the best I can hope for?


I would think the -nographic switch would be the one to get me 
command-line access to the guest OS, since the man page says "Normally, if 
QEMU is compiled with graphical window support, it displays output such as 
guest graphics, guest console, and the QEMU monitor in a window. With this 
option, you can totally disable graphical output so that QEMU is a simple 
command line application. The emulated serial port is redirected on the 
console and muxed with the monitor (unless redirected elsewhere 
explicitly). Therefore, you can still use QEMU to debug a Linux kernel 
with a serial console. Use C-a h for help on switching between the console 
and monitor." I guess the terminal I start Qemu from is not being detected 
as a console or something?


Any input on getting guest OS command line output something more like the 
actual size of the terminal I'm using will be appreciated.


Thanks