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
os terminal will not working qemu. So you should use putty on windows pc or you should use linux machine terminal.
I've struggled this for a while and finally figured out how to get it to work for me:
You need to have SGABIOS installed. Interestingly this BIOS is not included in the debian qemu package, so you need to install it (as the superuser):
apt install sgabios
Then when you run qemu use the -device option to tell the virtural machine to use the sga output
qemu-system-i386 -nographic -device sga discimage.bin
Voila! works perfectly over ssh with both the monitor and text output sent through stdio. You can access the qemu monitor with C-a c.
cheers, ben
You can compile qemu for youself and install it into your home directory. There will be no kernel-mode qemu accelerator, but the qemu will work and the speed will be rather high.
Qemu has two options for non-gui start: http://wiki.qemu.org/download/qemu-doc.html
2.3.4 Display options:
-nographic
- Normally, QEMU uses SDL to display the VGA output. 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. Therefore, you can still use QEMU to debug a Linux kernel with a serial console.
-curses
- Normally, QEMU uses SDL to display the VGA output. With this option, QEMU can display the VGA output when in text mode using a curses/ncurses interface. Nothing is displayed in graphical mode.
Also it can send graphic output to another machine via VNC protocol (-vnc
option)