Closed ghost closed 6 years ago
Could this be rewritten and worked into the doc directory somewhere or as src/qemu-ssh.sh?
@TechnologyClassroom any idea why it uses VGA for the console? Is there a particular reason?
VGA is a very standard way to get a display on a large number of bare metal systems and VMs. I have never seen anyone boot like you did, but I think it is cool, useful, and worth mentioning.
VGA is a very standard way to get a display on a large number of bare metal systems and VMs
Yes that makes sense.
@bootrino - your research is impressive!
MLL uses vga=ask
only for demonstration purpose. This approach is the easiest and the most compatible way to provide basic graphical console support with the VESA framebuffer driver. The default wait timeout of 30 seconds comes either from the boot loader or from the kernel (I never researched this) and I'm not sure if it can be changed at all.
The first time I found out that MLL can be run in pure "QEMU console" mode was approximately 3 years ago. Back then I found @coopermaa's Docker solution:
https://github.com/coopermaa/my-docker-library/blob/master/minimal-linux-live/run
https://hub.docker.com/r/coopermaa/minimal-linux-live/~/dockerfile/
Till now I wasn't aware that we can provide more than one console
argument in the kernel invocation parameters. This means that MLL's default boot behavior could be changed slightly to provide console output on both tty0
and ttyS0
and as @TechnologyClassroom suggested, there could be additional qemu-console
helper script in order to automate the "QEMU console" mode.
I will leave this issue opened for further refining of this idea.
Yes you can output boot messages to multiple consoles, but there can be only one /dev/console that displays a root signin prompt as far as I am aware.
It must be possible for the system to start with login prompts on all consoles via operating system configuration rather than syslinux.cfg configuration, but I don't know how. Something to do with getty setup?
The ideal would be a configuration that automatically outputs to both serial and VGA and automatically displays to both serial and VGA but I have not yet found a way to do that.
If you go to this link, to Examples/Multiplexing mode http://cc.bingj.com/cache.aspx?q=qemu+console+device+ttys0+site%3anairobi-embedded.org&d=4760083908069298&mkt=en-US&setlang=en-US&w=KXdO9hLXzjx0orlwzDMp4vgQCN_LVlLk
Find the text on that page that says this: To allow login on both the UART (/dev/ttyS0) and USB-serial (/dev/ttyUSB0), the following files were prepared in the guest before booting with the QEMU command line shown above:
It seems to indicate how to have /dev/console on multiple devices but I could not make it work.
I have implemented the option to run MLL in QEMU console mode here. Note that the console mode works fine only if you override the default boot entry with the console
boot entry.
The defaults work fine (nothing has changed) and the new QEMU console script seems to work fine, provided that the user enters the console
boot entry.
I found I could not launch MLL from qemu via ssh - nothing was displayed although it appears to start. This is because the console is displayed on VGA
qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm
Adding the curses option to the qemu command line fixes this by displaying the VGA text output via curses.
But that's kinda hacky and weird when doing ssh terminal oriented work. I wanted it to work natively in the ssh console.
To fix this you can replace MLL's default syslinux.cfg. The default syslinux.cfg looks like this:
I don't really know why MLL is configured to use VGA for its console - presumably there is a reason but IMHO it would be better configured by default to use something other than VGA. Anyhow that's the project owner's choice of course.
To fix MLL to use a console accessible via SSH, after building MLL, go to the src directory.
Replace the ./minimal_boot/bios/boot/syslinux/syslinux.cfg with this:
Then rebuild the iso without recompiling by:
sh repackage.sh
You can now boot the iso via qemu using ssh and the console will be displayed within your terminal. Note that we now use the qemu 'nographic' option.
qemu-system-x86_64 -cdrom minimal_linux_live.iso -boot d -m 1024 -localtime --enable-kvm -nographic
You will then see all the startup messages and get a cli. awesome! Here's what it looks like: