Bug 1683609
| Summary: | [RFE] virt-install should add input devices when graphics are enabled | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Katerina Koukiou <kkoukiou> | ||||
| Component: | virt-manager | Assignee: | Andrea Bolognani <abologna> | ||||
| Status: | CLOSED ERRATA | QA Contact: | smitterl | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 8.0 | CC: | abologna, berrange, bugproxy, crobinso, dzheng, gscrivan, hannsj_uhl, juzhou, mpitt, mzhan, phrdina, ptoscano, smitterl, tburke, tzheng | ||||
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
||||
| Target Release: | 8.1 | ||||||
| Hardware: | s390 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| 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.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2019-11-05 21:19:40 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1624641, 1673330, 1683681, 1689815 | ||||||
| Attachments: |
|
||||||
|
Description
Katerina Koukiou
2019-02-27 10:54:34 UTC
This was originally reported as bug 1673330. 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.
(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. Patches posted upstream. https://www.redhat.com/archives/virt-tools-list/2019-March/msg00103.html 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>
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.
Created attachment 1601399 [details]
Verified fix on s390x
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.
Re Comment#18, kernel releases were: 4.18.0-80.7.1.el8_0.s390x 4.18.0-128.el8.s390x (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. 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.
Thanks for your work, smitterl. I move this bug from ON_QA to VERIFIED based on Comment 13 and Comment 21 testing, thanks. I was missing permissions, thanks for transitioning zhoujunqin. (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. 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 |