How to get target system display with qemu -nographic option?
Yay! I've almost got it. I'd appreciate a bit more help for the last few steps.
Thank you David for pointing out the command options wouldn't be recognized. Now, I see how it wouldn't make sense to pass in commands to a bootable image. I had previously added the same console parameters to grub, but the kernel was not recognizing it.
Vikram, thank you telling me about the -B option. That was the key :-) My kernel is not that old, 2.6.11, and so needed that option. Now I get the boot up messaged on my terminal!
-- But, after bootup messages are done, I do not see the login screen. After the last bootup messages are done, shouldn't the login screen magically appear on the terminal? I don't see anyting after the last bootup message of "Starting HAL daemon: [ OK ]". Why would that be?
-- Also, I'm easily able to switch to Qemu's Command window with Ctrl-a c, but cannot switch back to console. Shouldn't I be able to?
Below I've listed the changes (on a 2.6.11 Fedora Core guest) I've made in case someone needs to refer to it:
A) modified grub.conf as follows:
default=0
timout=10
serial --unit=0 --speed=9600
terminal serial console
title something
root (hd0,0)
kernel some_stuff -B console=ttyS0
initrd something
B) In /etc/inittab mgetty was giving me respawning error so I removed the below line. It seems that mgetty was not being recognized. #T0:2345:respawn:/sbin/mgetty dev=ttyS0 b 9600 ...
Vikram, have you tried mingetty? I don't have getty available.
C) Running qemu as follows:
$ qemu -hda myboot.img -m 512 -nographic
-----------------------------------------------------------------------
Note: my last last boot message are:
Checking filesystems
Checking all file systems.
...
[ OK ]
Remounting root filesystem in read-write mode: [ OK ]
Mounting local filesystems: [ OK ] Enabling local filesystem quotas: [ OK ] Enabling swap space: [ OK ] INIT: Entering runlevel: 3
Entering non-interactive startup
Checking for new hardware [ OK ]
Starting pcmcia: [ OK ]
Starting system logger: [ OK ]
...
Starting system message bus: [ OK ]
Starting HAL daemon: [ OK ]
-----------------------------------------------------------------------
Thank you.
Quoted 43 lines
Hi,
There are two components to making output appear on the serial port.
1. Getting GRUB to output (the menu etc.) to the serial port. You can do this via the following global directive
serial --unit=0 --speed=9600 terminal serialAdd this as a "global" entry to grub.conf i.e. at the same level as your "default" and "timeout" directives (i.e. outside the title block)
2. Getting the Linux kernel to output console to the serial port (once it takes over from GRUB). I don't
have experience doing console redirection on Linux but on Opensolaris we
do it via a property specified via
a -B option specified on the "kernel" line.Quoted 2 lines · Atoosah
title Fedora ....
console=ttyS0 ....This is unlikely to work - the "console" token is interpreted by GRUB as a command and there is no "console" command in legacy GRUB.
Vikram
----- Original Message ----
Ah, you're going well outside my area of familiarity -- I've never set up a console terminal over a serial line physically nor virtually.
However, I notice you're using the "-append" line -- I made that mistake as well, but learned that you can only use "-append" if you're also using "-kernel" and "-initrd". Basically, you can wholly specify the kernel in the qemu command line, or you need to go with the kernel defined by GRUB, but you can't selectively override grub using the command line.
Other than that, I'm not sure how to help. Good luck!
-david