1

I run an Ubuntu Iso as:

#!/bin/bash

MEM_SIZE=4096

qemu-system-x86_64 \
-accel kvm \
-cpu host \
-m ${MEM_SIZE} \
-M q35 \
-bios /usr/share/ovmf/OVMF.fd \
-device qemu-xhci \
-usb -device usb-host,vendorid=0x2357,productid=0x010c \
-cdrom /home/pcmagas/Λήψεις/Isos/Ubuntu/64/ubuntu-22.04.3-desktop-amd64.iso

And I try to usb-passthrough the device:

$ lsusb | grep "TP-Link"
Bus 001 Device 004: ID 2357:010c TP-Link TL-WN722N v2/v3 [Realtek RTL8188EUS]

But upon my LiveCD I booted I do not see it (I have not setup the shared clipboard upon qemu yet): Ubuntu Quest VM

But I did compare using Virtualbox and works like fine:

TPLink USB device showing upon Ubuntu running in Virtualbox USB passthrough virtualbox setup

Edit 1

I did:

$ ls -l /dev/bus/usb/001/004
crw-rw-r-- 1 root root 189, 3 Ιουν 23 21:42 /dev/bus/usb/001/004

$ lsusb
Bus 002 Device 002: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 002: ID 4e53:5407  USB OPTICAL MOUSE 
Bus 001 Device 004: ID 2357:010c TP-Link TL-WN722N v2/v3 [Realtek RTL8188EUS]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

6
  • Why do you have -usb between the host controller and the passthrough'd device? Also, what's the permission of the device /dev/bus/usb/xxx/xxx (assuming you are not running qemu as root)?
    – Tom Yan
    Commented Jun 22 at 15:18
  • @TomYan I am running as normal user. Commented Jun 23 at 18:32
  • Running as root did fix the issue. Is there a way to do it as a normal user??? Commented Jun 23 at 18:45
  • Fix the permission of the device node of the respective USB device (with chmod for a volatile change; with udev rule for a persistent change).
    – Tom Yan
    Commented Jun 23 at 19:55
  • But Virtualbox allow me to usb passthrough withoput sudo only qemu needs sudo. Maybe it is a group issue. Commented Jun 24 at 12:11

1 Answer 1

0

Run it using SUDO (or as a root user):

#!/bin/bash

MEM_SIZE=4096

sudo qemu-system-x86_64 \
-accel kvm \
-cpu host \
-m ${MEM_SIZE} \
-M q35 \
-bios /usr/share/ovmf/OVMF.fd \
-device qemu-xhci \
-usb -device usb-host,vendorid=0x2357,productid=0x010c \
-cdrom /home/pcmagas/Λήψεις/Isos/Ubuntu/64/ubuntu-22.04.3-desktop-amd64.iso

USB device will be available upon vm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .