I want to run some programs on the High Performance Computer (With 8-core processor) in my department. Now I use that machine with ssh using terminal. The machine has Red Hat li
Linux: -append 'console=ttyS0'
That option was also needed for Linux kernel be besides -nographic
mentioned by osgx as in:
qemu-system-x86_64 -append 'console=ttyS0' \
-initrd rootfs.cpio.gz \
-kernel bzImage \
-nographic \
-serial mon:stdio \
Now you can do the following:
-append 'console=ttyS0'
makes QEMU pass the console=ttyS0
kernel command line option to LInux, which tells the kernel to use a serial port instead of the display. The serial port sends characters between host and guest, instead of pixels on a display, and then QEMU can display those characters on the terminal.
-serial mon:stdio
is optional in this minimal command, but it is generally a good idea to have around. E.g., it improves behaviour if you also want to add a handy -monitor telnet
later on:
This can be easily tested with Buildroot qemu_x86_64_defconfig
. I've created this is a highly self-contained and automated setup that allows you to try this out easily
Related but with less OS constraints:
Tested on Ubuntu 18.04, QEMU 2.11.1.
FreeBSD
How to boot FreeBSD image under Qemu