This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 523623 - virt-install: add console=hvc0 to kernel cli for xen PV guests
virt-install: add console=hvc0 to kernel cli for xen PV guests
Status: CLOSED WONTFIX
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Cole Robinson
:
: 611210 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-16 04:19 EDT by Andrew Jones
Modified: 2013-08-17 10:01 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-17 10:01:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Andrew Jones 2009-09-16 04:19:44 EDT
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 07:37:58 EDT
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 11:28:22 EDT
Can we even tell when we're doing a domU install?
Comment 3 Andrew Jones 2009-09-16 13:08:32 EDT
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 14:01:52 EDT
Removing from F12VirtTarget for now, since we're waiting to see how virtio_console settles down AFAIR
Comment 5 Cole Robinson 2010-05-05 15:43:28 EDT
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 03:08:46 EDT
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 06:03:00 EDT
*** Bug 611210 has been marked as a duplicate of this bug. ***
Comment 8 Yufang Zhang 2010-07-12 23:24:20 EDT
(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 02:16:39 EDT
(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 15:12:05 EDT
virtinst has been merged into virt-manager.git. Moving all virtinst bugs to the virt-manager component.
Comment 11 Cole Robinson 2013-08-17 10:01:16 EDT
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.