Bug 523623 - virt-install: add console=hvc0 to kernel cli for xen PV guests
Summary: virt-install: add console=hvc0 to kernel cli for xen PV guests
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
: 611210 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-16 08:19 UTC by Andrew Jones
Modified: 2018-11-27 20:55 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-17 14:01:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Andrew Jones 2009-09-16 08:19:44 UTC
When installing Fedora as a DomU guest the kernel command line needs the option 'console=hvc0' appended.

For example,

        kernel /vmlinuz-2.6.31-0.204.rc9.fc12.x86_64 ro root=/dev/mapper/vg_dhcplab136-lv_root rhgb quiet LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us

becomes

        kernel /vmlinuz-2.6.31-0.204.rc9.fc12.x86_64 ro root=/dev/mapper/vg_dhcplab136-lv_root rhgb quiet console=hvc0 LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us

Comment 1 Andrew Jones 2009-09-16 11:37:58 UTC
An improvement on this is to add 'console=tty0 console=hvc0' instead of just console=hvc0. This allows the vnc connection to the DomU to still output boot messages as well. After the boot has completed only hvc0 will get the console messages. Whether or not to honor both consoles throughout the whole session is something to discuss elsewhere, but I think for at least for the boot, since already possible, it should be done.

Please add 'console=tty0 console=hvc0' to the kernel command-line for DomU installations.

Comment 2 Chris Lumens 2009-09-16 15:28:22 UTC
Can we even tell when we're doing a domU install?

Comment 3 Andrew Jones 2009-09-16 17:08:32 UTC
There are several ways to detect this, and I see anaconda used to detect it by checking for the existence of /proc/xen.

That said, I started a discussion about this with others on the virt team, and
it was more or less agreed to try and change this in virt-install instead, i.e.
always set console=hvc0, even if we're not currently using it, which allows anaconda to pick it up.

Reassigning to that component.

Comment 4 Mark McLoughlin 2009-09-17 18:01:52 UTC
Removing from F12VirtTarget for now, since we're waiting to see how virtio_console settles down AFAIR

Comment 5 Cole Robinson 2010-05-05 19:43:28 UTC
What does setting console=hvc0 do? Provide PV guest xm console behavior for FV guests? If we add this at install time to the kernel cli, does anaconda then know to add it permanently to the generated grub.conf?

If virt-install needs to set this, the downside is that it will only work for URL installs (which is the only time we can pass kernel parameters in).

Comment 6 Andrew Jones 2010-05-06 07:08:46 UTC
console=hvc0 is for PV guests only. To get console for FV we would use the normal serial, e.g. console=ttyS0,115200n8

Here's the breakdown of all the cases (again this is for PV guests)

1) With _NO_ console= params we only get early boot messages to the console, and then nothing else, not even a login prompt. The VNC gets all console output, including shutdown messages and of course a vterm login.

2) With console=hvc0 we get a full console (all boot messages and a login). VNC _only_ gets a vterm login. All shutdown and other console messages go to the console (hvc0).
 
3) With 'console=tty0 console=hvc0' we get the same as (2), but we also get boot messages to the VNC. VNC doesn't get anything else, but boot messages are nice to have there, so I see this as an improvement.

At the time I wrote this bug we only got (1) after a normal installation, so VNC had to be used until the kernel command line was manually modified. I don't know the state of this now since I've been adding console=hvc0 to my kickstarts for months.  We should recheck it.

Comment 7 Miroslav Rezanina 2010-07-12 10:03:00 UTC
*** Bug 611210 has been marked as a duplicate of this bug. ***

Comment 8 Yufang Zhang 2010-07-13 03:24:20 UTC
(In reply to comment #6)
> console=hvc0 is for PV guests only. To get console for FV we would use the
> normal serial, e.g. console=ttyS0,115200n8
> 
> Here's the breakdown of all the cases (again this is for PV guests)
> 
> 1) With _NO_ console= params we only get early boot messages to the console,
> and then nothing else, not even a login prompt. The VNC gets all console
> output, including shutdown messages and of course a vterm login.
> 
> 2) With console=hvc0 we get a full console (all boot messages and a login). VNC
> _only_ gets a vterm login. All shutdown and other console messages go to the
> console (hvc0).
> 
> 3) With 'console=tty0 console=hvc0' we get the same as (2), but we also get
> boot messages to the VNC. VNC doesn't get anything else, but boot messages are
> nice to have there, so I see this as an improvement.

I don't get shutdown message from VNC with (3). Is it expected? Is there a way to get both boot and shutdown message from both console and VNC?

> At the time I wrote this bug we only got (1) after a normal installation, so
> VNC had to be used until the kernel command line was manually modified. I don't
> know the state of this now since I've been adding console=hvc0 to my kickstarts
> for months.  We should recheck it.

Comment 9 Andrew Jones 2010-07-13 06:16:39 UTC
(In reply to comment #8)
> > 3) With 'console=tty0 console=hvc0' we get the same as (2), but we also get
> > boot messages to the VNC. VNC doesn't get anything else, but boot messages are
> > nice to have there, so I see this as an improvement.
> 
> I don't get shutdown message from VNC with (3). Is it expected? Is there a way
> to get both boot and shutdown message from both console and VNC?
> 

This is what I mean when I say we get boot messages to VNC, but nothing else. So no, you can't get shutdown messages or any other messages to VNC while the guest is running. This is because the last console= parameter on the kernel command line is one with control after booting. If you reverse the order then you'll get shutdown messages in VNC, but the console will only show boot messages and not work for anything else. If this is a problem, then a different bug should be opened to the kernel to investigate it.

Comment 10 Cole Robinson 2013-04-21 19:12:05 UTC
virtinst has been merged into virt-manager.git. Moving all virtinst bugs to the virt-manager component.

Comment 11 Cole Robinson 2013-08-17 14:01:16 UTC
Modern Fedora uses systemd, which is smart enough to start a tty on hvc0 if it exists, so virtio console and xenconsole work out of the box for logging in at least. That more or less 'fixes' this without having to test this change on a bunch of older OS, deal with the fact that it only works for certain install methods, etc.


Note You need to log in before you can comment on or make changes to this bug.