RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1683609 - [RFE] virt-install should add input devices when graphics are enabled
Summary: [RFE] virt-install should add input devices when graphics are enabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-manager
Version: 8.0
Hardware: s390
OS: Linux
low
low
Target Milestone: rc
: 8.1
Assignee: Andrea Bolognani
QA Contact: smitterl
URL:
Whiteboard:
Depends On:
Blocks: 1624641 1673330 1683681 1689815
TreeView+ depends on / blocked
 
Reported: 2019-02-27 10:54 UTC by Katerina Koukiou
Modified: 2021-04-29 15:24 UTC (History)
15 users (show)

Fixed In Version: virt-manager-2.2.0-1.el8
Doc Type: Bug Fix
Doc Text:
Cause: virt-install would not always automatically add the appropriate input devices when creating guests with graphics. Consequence: Interacting with the graphical console for such guests would work poorly, or not work at all. Fix: virt-install now always includes input devices when graphics are enabled for the guest. Result: Interacting with the graphical console now always works.
Clone Of:
Environment:
Last Closed: 2019-11-05 21:19:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Verified fix on s390x (1.08 KB, application/xml)
2019-08-07 14:57 UTC, smitterl
no flags Details


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 175866 0 None None None 2019-08-05 02:46:10 UTC
Red Hat Product Errata RHSA-2019:3464 0 None None None 2019-11-05 21:20:05 UTC

Description Katerina Koukiou 2019-02-27 10:54:34 UTC
Description of problem:

It would be useful if virt-install would add a keyboard by default when enabling graphical console.

On x86 the ps2 keyboard is a core part of the machine type but for s390 we need to configure that explicitly.

Comment 1 Martin Pitt 2019-02-27 11:04:40 UTC
This was originally reported as bug 1673330.

Comment 2 Andrea Bolognani 2019-02-27 13:44:31 UTC
This issue is actually not limited to s390x, nor it is limited to
keyboards.

For any guest with a graphical display, you want to have a keyboard
and a tablet (rather than a mouse, because absolute pointing devices
work much better than relative ones).

On x86, virt-install will already do the right thing:

  $ virt-install \
    --name test --os-variant rhel7.6 \
    --memory 2048 --disk size=5 --graphics vnc \
    --print-xml
  ...
  <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
  ...
  <input type="tablet" bus="usb"/>
  <graphics type="vnc" port="-1"/>
  <video>
    <model type="qxl"/>
  </video>
  ...

and so it will on aarch64:

  $ virt-install \
    --name test --os-variant rhel7.6 \
    --memory 2048 --disk size=5 --graphics vnc \
    --print-xml
  ...
  <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
  ...
  <input type="tablet" bus="usb"/>
  <input type="keyboard" bus="usb"/>
  <graphics type="vnc" port="-1"/>
  <video>
    <model type="virtio"/>
  </video>
  ...

In both cases, the USB tablet is added automatically, but the USB
keyboard is not added on x86 because the built-in PS/2 one will
work just fine. So far, so good.

ppc64 is where we run into problems:

  $ virt-install \
    --name test --os-variant rhel7.6 \
    --memory 2048 --disk size=5 --graphics vnc \
    --print-xml
  ...
  <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
  ...
  <graphics type="vnc" port="-1"/>
  <video>
    <model type="vga"/>
  </video>
  ...

As you can see, no input devices are included. I haven't tested on
s390x, but I assume the situation is the same as ppc64.

Now, that's where things get even more interesting: libvirt will
actually add an USB keyboard / USB mouse combo automatically to
ppc64 guests with <graphics>, so those will ultimately be present
despite not having been selected by virt-install; however, as
mentioned earlier, using a mouse instead of a tablet will result
in a pretty poor experience. Additionally, due to the way this
logic is implemented in libvirt, there is no way to have a ppc64
guest with no USB mouse, and it looks like when both a USB mouse
and a USB tablet are present only the former will work, resulting
once again in a virtually (ah!) unusable guest.

tl;dr

virt-install should be fixed to include

  <input type="tablet" bus="usb"/>
  <input type="keyboard" bus="usb"/>

on ppc64, as it already does on aarch64, and

  <input type="tablet" bus="virtio"/>
  <input type="keyboard" bus="virtio"/>

on s390x whenever graphics are requested.

At the same time, libvirt should be fixed so that it's possible to
have a ppc64 guest with no USB mouse. I'll file a bug for that in
a moment.

Comment 3 Andrea Bolognani 2019-02-27 14:42:49 UTC
(In reply to Andrea Bolognani from comment #2)
> At the same time, libvirt should be fixed so that it's possible to
> have a ppc64 guest with no USB mouse. I'll file a bug for that in
> a moment.

The libvirt part is tracked by Bug 1683681.

Comment 4 Andrea Bolognani 2019-03-20 15:53:52 UTC
Patches posted upstream.

  https://www.redhat.com/archives/virt-tools-list/2019-March/msg00103.html

Comment 5 Andrea Bolognani 2019-03-21 15:07:35 UTC
Patches merged upstream.

  commit f23b01be53aa8b5b8d91aadbfb0c06268fa5c7b9
  Author: Andrea Bolognani <abologna>
  Date:   Wed Mar 20 16:52:35 2019 +0100

    guest: Add VirtIO input devices to s390x guests with graphics
    
    We're not including any input devices in the generated XML
    for s390x guests, and the results is that it's not possible
    to interact with them short of using the serial console or
    connecting through ssh, which is fine but probably not what
    is expected when graphics are present.
    
    USB input devices are not a good fit for s390x guests: USB
    requires PCI, and PCI is not widely available or used on
    s390x; VirtIO devices, on the other hand, are a perfect
    match since s390x guests use basically no emulated devices
    and rely on VirtIO for most functionality.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1683609
    
    Signed-off-by: Andrea Bolognani <abologna>

  commit 5dad99216e80cfcb84432c4d1266ce731a522937
  Author: Andrea Bolognani <abologna>
  Date:   Wed Mar 20 16:52:33 2019 +0100

    guest: Add USB input devices to pSeries guests with graphics
    
    libvirt already does this for us, sort of: it will automatically
    add a USB keyboard and mouse to ppc64 guests with graphics;
    in addition, these devices are impossible to remove.
    
    Unfortunately this results in a pretty poor experience for the
    user, since the relative pointing device makes interacting with
    the GUI an exercise in frustration.
    
    As of commit 186bb479d0f4, libvirt will still add the USB
    keyboard automatically but will skip the USB mouse if a USB
    tablet is already present, so by explicitly including USB input
    devices in the generated XML we can create guests that are
    actually usable.
    
    We can do this unconditionally, without having to worry about
    what version of libvirt we're running against: if it's new
    enough we'll take advantage of the fix, and if not then the
    resulting guest will not be any more broken than it would have
    been before.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1683609
    
    Signed-off-by: Andrea Bolognani <abologna>

Comment 13 zhoujunqin 2019-07-31 10:30:38 UTC
Testing on ppc64 platform:

Reproduce with:
virt-manager-2.0.0-5.el8.noarch

Steps:
# virt-install --name test --os-variant rhel8.1 --memory 2048 --nodisk --graphics vnc --print-xml
<domain type="kvm">
  <name>test</name>
  <uuid>fe295bbe-47da-4fe4-b32d-74235a164484</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://redhat.com/rhel/8.1"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch="ppc64le" machine="pseries">hvm</type>
    <boot dev="hd"/>
  </os>
  <clock offset="utc"/>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:11:ff:0b"/>
      <model type="virtio"/>
    </interface>
    <console type="pty"/>
    <channel type="unix">
      <source mode="bind"/>
      <target type="virtio" name="org.qemu.guest_agent.0"/>
    </channel>
    <graphics type="vnc" port="-1"/>
    <video>
      <model type="vga"/>
    </video>
    <rng model="virtio">
      <backend model="random">/dev/urandom</backend>
    </rng>
  </devices>
</domain>
Result: No input device is added.

Verify with:
virt-manager-2.2.1-1.el8.noarch
virt-install-2.2.1-1.el8.noarch
libvirt-4.5.0-30.module+el8.1.0+3574+3a63752b.ppc64le
qemu-kvm-2.12.0-82.module+el8.1.0+3738+0d8c0249.ppc64le

Steps:
1. Install a vm with graphics are enabled.

# virt-install --name test --os-variant rhel8.1 --memory 2048 --nodisk --graphics vnc --print-xml
<domain type="kvm">
  <name>test</name>
...
    <input type="tablet" bus="usb"/>
    <input type="keyboard" bus="usb"/>
    <graphics type="vnc" port="-1"/>
    <video>
      <model type="vga"/>
    </video>
...

Result: Input devices are added when graphics are enabled.

Comment 17 smitterl 2019-08-07 14:57:25 UTC
Created attachment 1601399 [details]
Verified fix on s390x

Comment 18 smitterl 2019-08-07 15:00:15 UTC
Verified fixed on s390x (s. attachment) in 8.1 Beta.

RHEL 8.0 (Ootpa)
virt-manager-2.0.0-5.1.el8_0.src.rpm

ibm-z-142.rhts.eng.bos.redhat.com redhat
RHEL 8.1 Beta (Oopta)
virt-manager-2.2.1-1.el8.src.rpm

$ virt-install \
    --name test --os-variant rhel7.6 \
    --memory 2048 --disk size=5 --graphics vnc \
    --print-xml

adds

  <input type="tablet" bus="virtio"/>
  <input type="keyboard" bus="virtio"/>

as requested.

Comment 19 smitterl 2019-08-07 15:06:16 UTC
Re Comment#18, kernel releases were:
4.18.0-80.7.1.el8_0.s390x
4.18.0-128.el8.s390x

Comment 20 zhoujunqin 2019-08-08 09:12:27 UTC
(In reply to smitterl from comment #18)
> Verified fixed on s390x (s. attachment) in 8.1 Beta.
> 
> RHEL 8.0 (Ootpa)
> virt-manager-2.0.0-5.1.el8_0.src.rpm

Hi smitterl,
Thanks for your work.
And one suggestion for bug verification, we'd better not use .z(virt-manager-2.0.0-5.1.el8_0.src.rpm) version to reproduce a Y stream bug.
Here you can use version <= virt-manager-2.2.0-1.el8( such as virt-manager-2.0.0-5.el8)

BR,
juzhou 

> 
> ibm-z-142.rhts.eng.bos.redhat.com redhat
> RHEL 8.1 Beta (Oopta)
> virt-manager-2.2.1-1.el8.src.rpm
> 
> $ virt-install \
>     --name test --os-variant rhel7.6 \
>     --memory 2048 --disk size=5 --graphics vnc \
>     --print-xml
> 
> adds
> 
>   <input type="tablet" bus="virtio"/>
>   <input type="keyboard" bus="virtio"/>
> 
> as requested.

Comment 21 smitterl 2019-08-08 11:24:00 UTC
Testing on s390x platform:

Reproduce with:
virt-manager-2.0.0-5.1.el8_0.noarch
virt-install-2.0.0-5.1.el8_0.noarch

Steps:
# virt-install --name test --os-variant rhel8.0 --memory 2048 --nodisk --graphics vnc --print-xml
<domain type="kvm">
  <name>test</name>
  <uuid>7ddb1b17-6ee5-45a1-9df7-33ba28a26fce</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://redhat.com/rhel/8.0"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch="s390x" machine="s390-ccw-virtio">hvm</type>
    <boot dev="hd"/>
  </os>
  <clock offset="utc"/>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:a8:45:8d"/>
      <model type="virtio"/>
    </interface>
    <console type="pty">
      <target type="sclp"/>
    </console>
    <graphics type="vnc" port="-1"/>
    <video>
      <model type="virtio"/>
    </video>
  </devices>
</domain>

Verified with:
virt-manager-2.2.1-1.el8.noarch   
virt-install-2.2.1-1.el8.noarch                                                                           
libvirt-4.5.0-31.module+el8.1.0+3808+3325c1a3.s390x                                                       
qemu-kvm-15:2.12.0-83.module+el8.1.0+3852+0ba8aef0.s390x

Steps:
# virt-install --name test --os-variant rhel8.1 --memory 2048 --nodisk --graphics vnc --print-xml                                       
...
    <input type="tablet" bus="virtio"/>
    <input type="keyboard" bus="virtio"/>
    <graphics type="vnc" port="-1"/>
    <video>
      <model type="virtio"/>
    </video>
...

Result: Input devices are added when graphics are enabled.

Comment 22 zhoujunqin 2019-08-09 02:44:46 UTC
Thanks for your work, smitterl.
I move this bug from ON_QA to VERIFIED based on Comment 13 and Comment 21 testing, thanks.

Comment 23 smitterl 2019-08-09 13:28:50 UTC
I was missing permissions, thanks for transitioning zhoujunqin.

Comment 24 zhoujunqin 2019-08-12 02:33:22 UTC
(In reply to smitterl from comment #23)
> I was missing permissions, thanks for transitioning zhoujunqin.

My pleasure, and your permissions will be ok later, thanks.

Comment 26 errata-xmlrpc 2019-11-05 21:19:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3464


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