| Summary: | Virt-Manager: The USB passthrough does not work | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | marcioadriano.sistemas | ||||||
| Component: | virt-manager | Assignee: | Cole Robinson <crobinso> | ||||||
| Status: | CLOSED DUPLICATE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | unspecified | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 23 | CC: | berrange, crobinso, javiertury, marcioadriano.sistemas, virt-maint | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2016-05-18 01:02:08 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: | |||||||
| Attachments: |
|
||||||||
|
Description
marcioadriano.sistemas
2015-12-22 19:13:39 UTC
Thanks for the report, it seems to work for me though, but I'm using virt-manager 1.3.1 from updates-testing (sudo yum --enablerepo=updates-testing update virt-manager) How are you trying to attach the USB device... via the File->Redirect USB Device option, or via 'Add Hardware' ? Can you provide the output of virt-manager --debug when reproducing? Good evening everyone,
I generally try to add the USB device via the "Add Hardware", below is my attempt at creating a virtual machine Fedora 23 x86("Customize configuration before install"):
================================================================
[Ter, 29 Dez 2015 02:43:17 virt-manager 14048] DEBUG (addhardware:125) Showing addhw
[Ter, 29 Dez 2015 02:43:28 virt-manager 14048] DEBUG (connection:635) There are 2 node devices with vendorId: 0x046d, productId: 0xc05a
[Ter, 29 Dez 2015 02:43:28 virt-manager 14048] DEBUG (addhardware:1319) Running setup() for device=<virtinst.devicehostdev.VirtualHostDevice object at 0x7f1b64305bd0>
[Ter, 29 Dez 2015 02:43:28 virt-manager 14048] DEBUG (addhardware:1321) Device setup() complete
[Ter, 29 Dez 2015 02:43:28 virt-manager 14048] DEBUG (addhardware:1334) Adding device:
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc05a"/>
<address bus="8" device="2"/>
</source>
</hostdev>
[Ter, 29 Dez 2015 02:43:28 virt-manager 14048] DEBUG (libvirtobject:74) Redefining <vmmDomainVirtinst name=Fedora23x86> with XML diff:
--- Original XML
+++ New XML
@@ -70,6 +70,13 @@
<video>
<model type="qxl"/>
</video>
+ <hostdev mode="subsystem" type="usb" managed="yes">
+ <source>
+ <vendor id="0x046d"/>
+ <product id="0xc05a"/>
+ <address bus="8" device="2"/>
+ </source>
+ </hostdev>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
</devices>
[Ter, 29 Dez 2015 02:43:29 virt-manager 14048] DEBUG (addhardware:135) Closing addhw
[Ter, 29 Dez 2015 02:47:35 virt-manager 14048] DEBUG (addhardware:125) Showing addhw
[Ter, 29 Dez 2015 02:47:52 virt-manager 14048] DEBUG (connection:635) There are 1 node devices with vendorId: 0x046d, productId: 0xc31c
[Ter, 29 Dez 2015 02:47:52 virt-manager 14048] DEBUG (addhardware:1319) Running setup() for device=<virtinst.devicehostdev.VirtualHostDevice object at 0x7f1b6441bcd0>
[Ter, 29 Dez 2015 02:47:52 virt-manager 14048] DEBUG (addhardware:1321) Device setup() complete
[Ter, 29 Dez 2015 02:47:52 virt-manager 14048] DEBUG (addhardware:1334) Adding device:
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc31c"/>
</source>
</hostdev>
[Ter, 29 Dez 2015 02:47:53 virt-manager 14048] DEBUG (libvirtobject:74) Redefining <vmmDomainVirtinst name=Fedora23x86> with XML diff:
--- Original XML
+++ New XML
@@ -77,6 +77,12 @@
<address bus="8" device="2"/>
</source>
</hostdev>
+ <hostdev mode="subsystem" type="usb" managed="yes">
+ <source>
+ <vendor id="0x046d"/>
+ <product id="0xc31c"/>
+ </source>
+ </hostdev>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
</devices>
[Ter, 29 Dez 2015 02:47:53 virt-manager 14048] DEBUG (addhardware:135) Closing addhw
================================================================
Virtual machine results starting for the first time (with USB mouse and keyboard not working):
================================================================
[Ter, 29 Dez 2015 02:49:58 virt-manager 14048] DEBUG (details:655) Closing VM details: <vmmDomainVirtinst object at 0x7f1b6445c140 (virtManager+domain+vmmDomainVirtinst at 0x55e54e5fb320)>
[Ter, 29 Dez 2015 02:49:59 virt-manager 14048] DEBUG (create:1806) User finished customize dialog, starting install
[Ter, 29 Dez 2015 02:49:59 virt-manager 14048] DEBUG (create:1872) Starting background install process
[Ter, 29 Dez 2015 02:49:59 virt-manager 14048] DEBUG (storage:765) Creating storage volume 'Fedora23x86.qcow2' with xml:
<volume>
<name>Fedora23x86.qcow2</name>
<capacity>10737418240</capacity>
<allocation>0</allocation>
<target>
<format type="qcow2"/>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>
[Ter, 29 Dez 2015 02:49:59 virt-manager 14048] DEBUG (storage:798) Using vol create flags=1
[Ter, 29 Dez 2015 02:50:00 virt-manager 14048] DEBUG (storage:805) Storage volume 'Fedora23x86.qcow2' install complete.
[Ter, 29 Dez 2015 02:50:01 virt-manager 14048] DEBUG (guest:460) Generated install XML:
<domain type="kvm">
<name>Fedora23x86</name>
<uuid>dcbfce0c-991b-40c2-b025-eb5cb7c15b84</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<boot dev="cdrom"/>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<vmport state="off"/>
</features>
<cpu mode="custom" match="exact">
<model>Opteron_G4</model>
</cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/zen/virtuais/hdd/Fedora23x86.qcow2"/>
<target dev="vda" bus="virtio"/>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="/zen/virtuais/iso/Fedora-Workstation-netinst-i386-23.iso"/>
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci2">
<master startport="2"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
</controller>
<interface type="network">
<source network="default"/>
<mac address="52:54:00:24:3b:3f"/>
<model type="virtio"/>
</interface>
<input type="tablet" bus="usb"/>
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
<image compression="off"/>
</graphics>
<console type="pty"/>
<channel type="unix">
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
</channel>
<sound model="ich6"/>
<video>
<model type="qxl"/>
</video>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc05a"/>
<address bus="8" device="2"/>
</source>
</hostdev>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc31c"/>
</source>
</hostdev>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
</devices>
</domain>
[Ter, 29 Dez 2015 02:50:01 virt-manager 14048] DEBUG (guest:461) Generated boot XML:
<domain type="kvm">
<name>Fedora23x86</name>
<uuid>dcbfce0c-991b-40c2-b025-eb5cb7c15b84</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<vmport state="off"/>
</features>
<cpu mode="custom" match="exact">
<model>Opteron_G4</model>
</cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/zen/virtuais/hdd/Fedora23x86.qcow2"/>
<target dev="vda" bus="virtio"/>
</disk>
<disk type="block" device="cdrom">
<target dev="hda" bus="ide"/>
<readonly/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci2">
<master startport="2"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
</controller>
<interface type="network">
<source network="default"/>
<mac address="52:54:00:24:3b:3f"/>
<model type="virtio"/>
</interface>
<input type="tablet" bus="usb"/>
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
<image compression="off"/>
</graphics>
<console type="pty"/>
<channel type="unix">
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
</channel>
<sound model="ich6"/>
<video>
<model type="qxl"/>
</video>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc05a"/>
<address bus="8" device="2"/>
</source>
</hostdev>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x046d"/>
<product id="0xc31c"/>
</source>
</hostdev>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
</devices>
</domain>
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (connection:722) domain lifecycle event: domain=Fedora23x86 event=4 reason=0
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (connection:722) domain lifecycle event: domain=Fedora23x86 event=2 reason=0
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (guest:491) XML fetched from libvirt object:
<domain type='kvm' id='1'>
<name>Fedora23x86</name>
<uuid>dcbfce0c-991b-40c2-b025-eb5cb7c15b84</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-2.4'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<vmport state='off'/>
</features>
<cpu mode='custom' match='exact'>
<model fallback='allow'>Opteron_G4</model>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/zen/virtuais/hdd/Fedora23x86.qcow2'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/zen/virtuais/iso/Fedora-Workstation-netinst-i386-23.iso'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<readonly/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<alias name='usb'/>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<alias name='usb'/>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<alias name='usb'/>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='virtio-serial' index='0'>
<alias name='virtio-serial0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:24:3b:3f'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/5'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/5'>
<source path='/dev/pts/5'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Fedora23x86.org.qemu.guest_agent.0'/>
<target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
<alias name='channel1'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
<input type='tablet' bus='usb'>
<alias name='input0'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
<image compression='off'/>
</graphics>
<sound model='ich6'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x046d'/>
<product id='0xc05a'/>
<address bus='8' device='2'/>
</source>
<alias name='hostdev0'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x046d'/>
<product id='0xc31c'/>
<address bus='8' device='3'/>
</source>
<alias name='hostdev1'/>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir0'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<alias name='redir1'/>
</redirdev>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='selinux' relabel='yes'>
<label>system_u:system_r:svirt_t:s0:c433,c973</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c433,c973</imagelabel>
</seclabel>
</domain>
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (create:1874) Install completed
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (connection:722) domain lifecycle event: domain=Fedora23x86 event=0 reason=0
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (connection:1005) domain=Fedora23x86 status=Executando added
[Ter, 29 Dez 2015 02:50:03 virt-manager 14048] DEBUG (create:167) Closing new vm wizard
[Ter, 29 Dez 2015 02:50:04 virt-manager 14048] DEBUG (details:619) Showing VM details: <vmmDomain object at 0x7f1b64384320 (virtManager+domain+vmmDomain at 0x55e551476620)>
[Ter, 29 Dez 2015 02:50:04 virt-manager 14048] DEBUG (engine:357) window counter incremented to 2
[Ter, 29 Dez 2015 02:50:04 virt-manager 14048] DEBUG (console:650) Starting connect process for proto=spice trans= connhost=127.0.0.1 connuser= connport= gaddr=127.0.0.1 gport=5900 gtlsport=None gsocket=None
[Ter, 29 Dez 2015 02:50:05 virt-manager 14048] DEBUG (connection:999) New domain=Fedora23x86 requested, but it's already tracked.
[Ter, 29 Dez 2015 02:50:05 virt-manager 14048] DEBUG (connection:999) New domain=Fedora23x86 requested, but it's already tracked.
[Ter, 29 Dez 2015 02:50:05 virt-manager 14048] DEBUG (console:771) Viewer connected
================================================================
The option "File->Redirect USB Device" it is apparently working correctly with USB keyboard and flash drive.
Can you attach /var/log/libvirt/qemu/YOUR-VM-NAME.log ? Also, can you try reproducing with latest virt-manager from updates-testing: sudo yum --enablerepo=updates-testing update virt-manager Created attachment 1111556 [details]
Log of the virtual machine
Good afternoon everyone, The virt-manager was recently updated to version 1.3.2 (regular Fedora updates, unfortunately it is a production machine). This attached log file represents my attempt to add USB Flash Drive, Keyboard and Mouse when creating a virtual machine. Secondly I tried to remove the USB Flash Drive and add it again without success. Are you running virt-manager and the VMs on the same physical machine, or connecting to a remote machine? Also provide these bits on the virt host: - genenforce - getsebool virt_use_usb - after reproducing, attach the output of: ausearch -m avc Created attachment 1119422 [details]
Output of: ausearch -m avc
Good Morning,
I am running on the same physical machine.
# genenforce
bash: genenforce: command not found...
# getenforce
Enforcing
# getsebool virt_use_usb
virt_use_usb --> on
Thanks for the info, it looks like this is another case of bug 1323501. So duping to that because it has more info *** This bug has been marked as a duplicate of bug 1323501 *** |