Simple Way: pass the USB device ID to the guest not seen by guest

eiger3970

Well-Known Member
Sep 9, 2012
276
3
58
Hi, I'm trying to pass the USB device from Proxmox to a VM.

I followed the simple way to pass the usb device id to the guest.

However, the guest does not work via the USB?

Proxmox shell output with USB device not connected:
Bash:
root@proxmox:~# lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Proxmox shell output with USB device connected:
Bash:
root@proxmox:~# lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 05ac:12a8 Apple, Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


I then connect the USB device successfully I think, as per Simple Way: pass the USB device ID to the guest:
Bash:
root@proxmox:~# qm set 145 -usb0 host=05ac:12a8
update VM 145: -usb0 host=05ac:12a8


I then check Proxmox connected the USB to the VM:
Bash:
root@proxmox:~# qm monitor 145
Entering Qemu Monitor for VM 145 - type 'help' for help
qm> info usbhost
  Bus 3, Addr 4, Port 10, Speed 480 Mb/s
    Class 00: USB device 05ac:12a8, iPhone


VM shell output seems to not be connected, or I don't understand, or I need to configure the VM some way I don't understand:
Bash:
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot: usbconfig
ugen0.1: <Intel UHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen0.2: <QEMU QEMU USB Tablet> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot: ifconfig
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=c00b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE>
    ether 42:63:7c:e4:6c:e3
    hwaddr 42:63:7c:e4:6c:e3
    inet6 fe80::4063:7cff:fee4:6ce3%vtnet0 prefixlen 64 scopeid 0x1
    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
    media: Ethernet 10Gbase-T <full-duplex>
    status: active
vtnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=c00b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE>
    ether a6:2d:d5:4f:6c:f3
    hwaddr a6:2d:d5:4f:6c:f3
    inet6 fe80::a42d:d5ff:fe4f:6cf3%vtnet1 prefixlen 64 scopeid 0x2
    inet 192.168.1.170 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    media: Ethernet 10Gbase-T <full-duplex>
    status: active
enc0: flags=0<> metric 0 mtu 1536
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    groups: enc
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
    inet 127.0.0.1 netmask 0xff000000
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    groups: lo
pflog0: flags=100<PROMISC> metric 0 mtu 33160
    groups: pflog
pfsync0: flags=0<> metric 0 mtu 1500
    groups: pfsync
    syncpeer: 224.0.0.240 maxupd: 128 defer: on
    syncok: 1


Maybe I need to implement the Assigning Devices to VMs, as the Simple Way doesn't seem to work (or I don't know what else to do to make the VM use the USB).
According to Assigning Devices to VMs, I think I might come up with a different USB ID using the USB1.x, USB2.0 syntax: qm set <VM-ID> -usb[<n>] host={ <bus>-<port>(.<port>)* | <vendor-id>:<product-id> }

Confused?
 
Last edited:
Well, I think it might be easier to upgrade Proxmox 4.4 to 6.1.
Proxmox 4.4 VM Hardware Add, has no option to add USBs.
Proxmox 6.1 VM Hardware Add, has options to add USBs.
However, my Proxmox has no Internet, meaning a PXE FAI install.
Not sure how easy a PXE FAI install will be from my Linux Mint computer, as the guide is for Debian Wheezy.
Any suggestions on installing Debian Wheezy with my current Linux Mint OS please?
 
Apparently, the guide needs an update to Debian Buster.
I think I'll stick to trying to figure out USB IDs. Any help welcome.
 
Ok, I'm editing the VMID.conf file and notice a strange line [PENDING]:
Bash:
bootdisk: virtio0
cores: 1
ide2: local:iso/pfSense-CE-2.4.4-RELEASE-p1-amd64.iso,media=cdrom
memory: 1024
name: Router
net0: virtio=42:63:7C:E4:6C:E3,bridge=vmbr0
net1: virtio=A6:2D:D5:4F:6C:F3,bridge=vmbr1
numa: 0
onboot: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=8617018b-baae-4738-a593-528bb3cbe193
sockets: 1
virtio0: local-zfs:vm-145-disk-1,size=8G

[PENDING]
usb0: host=05ac:12a8


I was going to edit the line to directly force port mapping the USB ID:
usb0: host=3-1

What's the PENDING mean?
 
Rebooted Promox. I thought that might complete the updated 145.conf PENDING settings.
Now there's no pinging the VM router and no SSH into Proxmox?
 
Not sure if this is still a Proxmox issue or the VM now?
The VM can see the USB device, however the VM cannot issue an interface.

Usually, the VM can issue an interface named ue0.
This is what I've done on the VM, but still unsure if the issue is caused by the hypervisor or VM?

Phone is USB connected to a hypervisor > hypervisor is passing USB through to FreeBSD > FreeBSD sees USB > FreeBSD does not generate interface ue0.

FreeBSD 11.2-RELEASE-p6 has kernel module if_ipheth.ko downloaded, installed and loaded in /boot/modules:
C:
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot/modules: ls
bwi_v3_ucode.ko if_ipheth.ko    linker.hints


/boot/loader.conf has configuration with line added: if_ipheth="YES"
C:
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot: ls
beastie.4th        brand.4th          frames.4th         loader.efi         menu-commands.4th  userboot.so
boot               cdboot             gptboot            loader.help        menu.4th           version.4th
boot0              check-password.4th gptzfsboot         loader.rc          menu.rc            zfs
boot0sio           color.4th          isoboot            logo-beastie.4th   menusets.4th       zfsboot
boot1              defaults           kernel             logo-beastiebw.4th modules            zfsloader
boot1.efi          delay.4th          kernel.old         logo-fbsdbw.4th    pmbr
boot1.efifat       device.hints       loader             logo-orb.4th       pxeboot
boot2              dtb                loader.4th         logo-orbbw.4th     screen.4th
brand-fbsd.4th     entropy            loader.conf        logo-pfSensebw.4th shortcuts.4th
brand-pfSense.4th  firmware           loader.conf.origin mbr                support.4th


loader.conf:
C:
kern.cam.boot_delay=10000
kern.ipc.nmbclusters="1000000"
kern.ipc.nmbjumbop="524288"
kern.ipc.nmbjumbo9="524288"
if_ipheth_load="YES"
autoboot_delay="3"
hw.usb.no_pf="1"


USB device is seen by operating system (last line):
C:
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot: usbconfig
ugen1.1: <Intel UHCI root HUB> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen0.1: <Intel UHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen3.1: <Intel UHCI root HUB> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen2.1: <Intel UHCI root HUB> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen4.1: <Intel EHCI root HUB> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <QEMU QEMU USB Tablet> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen4.2: <Apple Inc. iPhone> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)


Interfaces does not generate the promised and required ue0:
C:
[2.4.4-RELEASE][admin@pfSense.localdomain]/boot: ifconfig
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=c00b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE>
    ether 42:63:7c:e4:6c:e3
    hwaddr 42:63:7c:e4:6c:e3
    inet6 fe80::4063:7cff:fee4:6ce3%vtnet0 prefixlen 64 scopeid 0x1
    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
    media: Ethernet 10Gbase-T <full-duplex>
    status: active
vtnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=c00b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE>
    ether a6:2d:d5:4f:6c:f3
    hwaddr a6:2d:d5:4f:6c:f3
    inet6 fe80::a42d:d5ff:fe4f:6cf3%vtnet1 prefixlen 64 scopeid 0x2
    inet 192.168.1.170 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    media: Ethernet 10Gbase-T <full-duplex>
    status: active
enc0: flags=0<> metric 0 mtu 1536
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    groups: enc
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
    inet 127.0.0.1 netmask 0xff000000
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    groups: lo
pflog0: flags=100<PROMISC> metric 0 mtu 33160
    groups: pflog
pfsync0: flags=0<> metric 0 mtu 1500
    groups: pfsync
    syncpeer: 224.0.0.240 maxupd: 128 defer: on
    syncok: 1
 
Maybe I need to edit the VMID.conf file?
I'm wondering about the Network Device on the VM.
net0=vmbr0, which was the previous WAN connection for internet. This was an Ethernet port.
However, now the WAN is a USB port.
 
Almost there...the VM router is seeing and adding the USB interface.

I think I might need to add some new VM Hardware?
Like instead of net0 = vmbr1, update to OPT1 = vmbr1?

Previous ethernet modem:
Network topology 2019 detailed.jpg

New USB modem:
Network topology 2020 detailed.jpg
 
Ok, I have forced the USB to the VM, so now the VM sees and creates an inteface ue0.
However no internet or DHCP traffic.

i'm wondering if I should be tethering the phone to the hypervisor/host machine and then the guest machine will receive internet from the hypervisor. This might need a NAT?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!