Using USB Port on VM Like Normal Computer?

rdreasn

New Member
Oct 7, 2023
5
0
1
Hi!
I’m new to Proxmox. I’ve tried to add “USB Device ID” as well as “USB Port” to the VM from Web GUI. But the VM only detect flashdisks that had been added in the Proxmox.

Expected result, naturally:
(From VM)
Insert flashdisk A —> VM detect flashdisk A
—> Eject flashdisk A
—> Insert flashdisk B —> VM detect flashdisk B,
all without having to restart the VM. Just like normal computer.

Is there a workarround to achieve this? Or anything close?

Sorry for the noob question.

Proxmox 8.02, Kernel 6.2

Code:
lsusb -t

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 20000M/x2
    |__ Port 10: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 5: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 5: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 6: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 6: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 9: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 10: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
    |__ Port 11: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
    |__ Port 14: Dev 7, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 14: Dev 7, If 1, Class=Wireless, Driver=btusb, 12M
 
if you passthrough Flashdisk A to your VM ones then the VM will always detect flashdrive A if it is inserted. Same goes for flashdrive B, etc. No reboot is required
 
if you passthrough Flashdisk A to your VM ones then the VM will always detect flashdrive A if it is inserted. Same goes for flashdrive B, etc. No reboot is required
But if you passthrough flashdisk A for the first time, you have to reboot the VM?
Also, if you remove flashdisk A from passthrough, and then in the future add it again, we still need to reboot the VM, don't we?
 
To solve problem in general, I can recommend PCIe passthrough of a controller directly to the VM. Afterwards, everything that is plugged in will automatically be detected in the VM.
 
  • Like
Reactions: hd--
But if you passthrough flashdisk A for the first time, you have to reboot the VM?
Also, if you remove flashdisk A from passthrough, and then in the future add it again, we still need to reboot the VM, don't we?
I've tried it and did not have to reboot at all.
 
To solve problem in general, I can recommend PCIe passthrough of a controller directly to the VM. Afterwards, everything that is plugged in will automatically be detected in the VM.
Would you please point out which one?


Code:
lspci -v

00:00.0 Host bridge: Intel Corporation Device 4650 (rev 05)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, fast devsel, latency 0, IOMMU group 1

00:01.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 (rev 05) (prog-if 00 [Normal decode])
        Subsystem: Micro-Star International Co., Ltd. [MSI] 12th Gen Core Processor PCI Express x16 Controller
        Flags: bus master, fast devsel, latency 0, IRQ 122, IOMMU group 2
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 5000-5fff [size=4K] [16-bit]
        Memory behind bridge: 81000000-820fffff [size=17M] [32-bit]
        Prefetchable memory behind bridge: 6000000000-6011ffffff [size=288M] [32-bit]
        Capabilities: [40] Express Root Port (Slot+), MSI 00
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [98] Subsystem: Micro-Star International Co., Ltd. [MSI] 12th Gen Core Processor PCI Express x16 Controller
        Capabilities: [a0] Power Management version 3
        Capabilities: [100] Null
        Capabilities: [220] Access Control Services
        Capabilities: [150] Precision Time Measurement
        Capabilities: [a30] Secondary PCI Express
        Capabilities: [a90] Data Link Feature <?>
        Capabilities: [a9c] Physical Layer 16.0 GT/s <?>
        Capabilities: [edc] Lane Margining at the Receiver <?>
        Capabilities: [adc] Extended Capability ID 0x2a
        Kernel driver in use: pcieport

00:02.0 Display controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] (rev 0c)
        DeviceName: Onboard - Video
        Subsystem: Micro-Star International Co., Ltd. [MSI] Alder Lake-S GT1 [UHD Graphics 730]
        Flags: bus master, fast devsel, latency 0, IRQ 158, IOMMU group 0
        Memory at 6012000000 (64-bit, non-prefetchable) [size=16M]
        Memory at 4000000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 6000 [size=64]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Capabilities: [320] Single Root I/O Virtualization (SR-IOV)
        Kernel driver in use: i915
        Kernel modules: i915

00:06.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 (rev 05) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 123, IOMMU group 3
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
        I/O behind bridge: [disabled] [16-bit]
        Memory behind bridge: 82c00000-82cfffff [size=1M] [32-bit]
        Prefetchable memory behind bridge: [disabled] [64-bit]
        Capabilities: [40] Express Root Port (Slot+), MSI 00
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [90] Subsystem: Device 0000:0000
        Capabilities: [a0] Power Management version 3
        Capabilities: [100] Null
        Capabilities: [220] Access Control Services
        Capabilities: [150] Precision Time Measurement
        Capabilities: [280] Virtual Channel
        Capabilities: [a30] Secondary PCI Express
        Capabilities: [a90] Data Link Feature <?>
        Capabilities: [a9c] Physical Layer 16.0 GT/s <?>
        Capabilities: [edc] Lane Margining at the Receiver <?>
        Kernel driver in use: pcieport

00:08.0 System peripheral: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator (rev 05)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] 12th Gen Core Processor Gaussian & Neural Accelerator
        Flags: fast devsel, IRQ 255, IOMMU group 4
        Memory at 601312f000 (64-bit, non-prefetchable) [disabled] [size=4K]
        Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [a0] Vendor Specific Information: Len=14 <?>
        Capabilities: [dc] Power Management version 2
        Capabilities: [f0] PCI Advanced Features

00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01)
        DeviceName: Onboard - Other
        Flags: fast devsel, IOMMU group 5
        Memory at 6013110000 (64-bit, non-prefetchable) [size=32K]
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [d0] Power Management version 3
        Capabilities: [100] Designated Vendor-Specific: Vendor=8086 ID=0002 Rev=1 Len=16 <?>
        Capabilities: [110] Designated Vendor-Specific: Vendor=8086 ID=0003 Rev=1 Len=16 <?>
        Capabilities: [120] Designated Vendor-Specific: Vendor=8086 ID=0004 Rev=1 Len=16 <?>
        Kernel driver in use: intel_vsec
        Kernel modules: intel_vsec

00:14.0 USB controller: Intel Corporation Device 7a60 (rev 11) (prog-if 30 [XHCI])
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, medium devsel, latency 0, IRQ 127, IOMMU group 6
        Memory at 6013100000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [70] Power Management version 2
        Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
        Capabilities: [90] Vendor Specific Information: Len=14 <?>
        Capabilities: [b0] Vendor Specific Information: Len=00 <?>
        Kernel driver in use: xhci_hcd
        Kernel modules: mei_me, xhci_pci

00:14.2 RAM memory: Intel Corporation Device 7a27 (rev 11)
        DeviceName: Onboard - Other
        Flags: fast devsel, IOMMU group 6
        Memory at 6013128000 (64-bit, non-prefetchable) [disabled] [size=16K]
        Memory at 601312e000 (64-bit, non-prefetchable) [disabled] [size=4K]
        Capabilities: [80] Power Management version 3

00:14.3 Network controller: Intel Corporation Device 7a70 (rev 11)
        DeviceName: Onboard - Ethernet
        Subsystem: Intel Corporation Device 0094
        Flags: bus master, fast devsel, latency 0, IRQ 18, IOMMU group 7
        Memory at 6013124000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [c8] Power Management version 3
        Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [80] MSI-X: Enable+ Count=16 Masked-
        Capabilities: [100] Latency Tolerance Reporting
        Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 <?>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

00:16.0 Communication controller: Intel Corporation Device 7a68 (rev 11)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, fast devsel, latency 0, IRQ 142, IOMMU group 8
        Memory at 601312d000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: [50] Power Management version 3
        Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [a4] Vendor Specific Information: Len=14 <?>
        Kernel driver in use: mei_me
        Kernel modules: mei_me

00:17.0 SATA controller: Intel Corporation Device 7a62 (rev 11) (prog-if 01 [AHCI 1.0])
        DeviceName: Onboard - SATA
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 125, IOMMU group 9
        Memory at 82d00000 (32-bit, non-prefetchable) [size=8K]
        Memory at 82d03000 (32-bit, non-prefetchable) [size=256]
        I/O ports at 6090 [size=8]
        I/O ports at 6080 [size=4]
        I/O ports at 6060 [size=32]
        Memory at 82d02000 (32-bit, non-prefetchable) [size=2K]
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [70] Power Management version 3
        Capabilities: [a8] SATA HBA v1.0
        Kernel driver in use: ahci
        Kernel modules: ahci

00:1c.0 PCI bridge: Intel Corporation Device 7a38 (rev 11) (prog-if 00 [Normal decode])
        Flags: fast devsel, IOMMU group 10
        Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
        I/O behind bridge: 4000-4fff [size=4K] [16-bit]
        Memory behind bridge: 82100000-82afffff [size=10M] [32-bit]
        Prefetchable memory behind bridge: 4017000000-40171fffff [size=2M] [32-bit]
        Capabilities: [40] Express Root Port (Slot+), MSI 00
        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [90] Null

00:1c.2 PCI bridge: Intel Corporation Device 7a3a (rev 11) (prog-if 00 [Normal decode])
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, fast devsel, latency 0, IRQ 124, IOMMU group 11
        Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
        I/O behind bridge: 3000-3fff [size=4K] [16-bit]
        Memory behind bridge: 82b00000-82bfffff [size=1M] [32-bit]
        Prefetchable memory behind bridge: [disabled] [64-bit]
        Capabilities: [40] Express Root Port (Slot+), MSI 00
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [98] Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Capabilities: [a0] Power Management version 3
        Capabilities: [100] Null
        Capabilities: [220] Access Control Services
        Capabilities: [150] Precision Time Measurement
        Capabilities: [a30] Secondary PCI Express
        Capabilities: [a90] Data Link Feature <?>
        Kernel driver in use: pcieport

00:1f.0 ISA bridge: Intel Corporation Device 7a06 (rev 11)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: bus master, fast devsel, latency 0, IOMMU group 12

00:1f.3 Audio device: Intel Corporation Device 7a50 (rev 11)
        DeviceName: Onboard - Sound
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 9d99
        Flags: bus master, fast devsel, latency 32, IRQ 159, IOMMU group 12
        Memory at 6013120000 (64-bit, non-prefetchable) [size=16K]
        Memory at 6013000000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: [50] Power Management version 3
        Capabilities: [80] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel, snd_sof_pci_intel_tgl

00:1f.4 SMBus: Intel Corporation Device 7a23 (rev 11)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: medium devsel, IRQ 18, IOMMU group 12
        Memory at 601312c000 (64-bit, non-prefetchable) [size=256]
        I/O ports at efa0 [size=32]
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801

00:1f.5 Serial bus controller: Intel Corporation Device 7a24 (rev 11)
        DeviceName: Onboard - Other
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d99
        Flags: fast devsel, IOMMU group 12
        Memory at 80800000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: intel-spi
        Kernel modules: spi_intel_pci

01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: eVga.com. Corp. GP107 [GeForce GTX 1050 Ti]
        Flags: bus master, fast devsel, latency 0, IRQ 157, IOMMU group 13
        Memory at 81000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 6000000000 (64-bit, prefetchable) [size=256M]
        Memory at 6010000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 5000 [size=128]
        Expansion ROM at 82000000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express
        Kernel driver in use: nouveau
        Kernel modules: nvidiafb, nouveau

01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)
        Subsystem: eVga.com. Corp. GP107GL High Definition Audio Controller
        Flags: bus master, fast devsel, latency 0, IRQ 17, IOMMU group 13
        Memory at 82080000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel

02:00.0 Non-Volatile memory controller: ADATA Technology Co., Ltd. Device 5370 (rev 01) (prog-if 02 [NVM Express])
        Subsystem: ADATA Technology Co., Ltd. Device 5370
        Flags: bus master, fast devsel, latency 0, IRQ 16, NUMA node 0, IOMMU group 14
        Memory at 82c00000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [b0] MSI-X: Enable+ Count=66 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Alternative Routing-ID Interpretation (ARI)
        Capabilities: [158] Secondary PCI Express
        Capabilities: [178] Physical Layer 16.0 GT/s <?>
        Capabilities: [19c] Lane Margining at the Receiver <?>
        Capabilities: [1b4] Single Root I/O Virtualization (SR-IOV)
        Capabilities: [1f4] Latency Tolerance Reporting
        Capabilities: [1fc] L1 PM Substates
        Capabilities: [20c] Vendor Specific Information: ID=0001 Rev=1 Len=038 <?>
        Capabilities: [244] Data Link Feature <?>
        Kernel driver in use: nvme
        Kernel modules: nvme

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
        Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8125 2.5GbE Controller
        Flags: bus master, fast devsel, latency 0, IRQ 18, IOMMU group 15
        I/O ports at 3000 [size=256]
        Memory at 82b00000 (64-bit, non-prefetchable) [size=64K]
        Memory at 82b10000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [b0] MSI-X: Enable+ Count=32 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Virtual Channel
        Capabilities: [168] Device Serial Number 01-00-00-00-68-4c-e0-00
        Capabilities: [178] Transaction Processing Hints
        Capabilities: [204] Latency Tolerance Reporting
        Capabilities: [20c] L1 PM Substates
        Capabilities: [21c] Vendor Specific Information: ID=0002 Rev=4 Len=100 <?>
        Kernel driver in use: r8169
        Kernel modules: r8169
 

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!