VirtualBox

Opened 8 months ago

Last modified 7 months ago

#21864 new defect

Sharing multiple usb_8dev devices to guest VM causes received CAN frames to "leak" between interfaces

Reported by: pht Owned by:
Component: guest additions Version: VirtualBox-7.0.10
Keywords: can, can2.0b, usb_8dev, Korlan, Cc:
Guest type: Linux Host type: Linux

Description

There seems to be an issue when using multiple usb_8dev devices on a single guest. CAN frames received via a usb_8dev device monitoring either bus appear on the CAN log of the other bus from within the guest. Separating the two devices by only allowing the guest to access one results in no common messages being logged on either bus.

I do not know if this is in OHCI/EHCI packet passthrough, usb_8dev driver, socketcan, or something else. I do not see this issue when running two or more usb_8dev devices on a single host. It only appears when multiple devices are shared to a guest.

To reproduce:

  1. Set up physical CAN Bus A with nodes transmitting various IDs at 500kbit
  2. Set up a different physical CAN Bus B with nodes transmitting various IDs at 500kbit; do not connect Bus A and Bus B physically or through a gateway.
  3. Connect a Korlan usb_8dev device to each bus
  4. Connect each Korlan device to the Host machine (6.5.5-arch1-1)
  5. Launch a Ubuntu 20.04 Guest machine on the Host machine.
  6. Enable sharing / USB passthrough of both usb_8dev devices to the Guest machine
  7. Activate both devices in the Guest machine as can1, can0 respectively via ip link
  8. Dump each usb_8dev device's bus to terminal via candump
  9. Observe that some CAN packets from CAN Bus A are seen on both can0 and can1, though only ~5% of all messages
  10. Observe that some CAN packets from CAN Bus B are seen on both can0 and can1, though only ~5% of all messages
  11. Disconnect one of the usb_8dev devices from the Guest, activate it on the Host as can0 or can1
  12. Observe that only messages from one CAN bus are seen on either the Host or Guest CAN interfaces.
  13. Disconnect the remaining usb_8dev device from the Guest, activate it on the Host
  14. Observe again that only messages from one CAN bus are seen on each usb_8dev can interface.

Change History (1)

comment:1 by Klaus Espenlaub, 7 months ago

Could it be that the devices are indistinguishable (no serial number, ... and the host OS doesn't provide a usable port number)? Because then they could get confused by either VirtualBox or the host's USB stack.

Can you provide the output of VBoxManage list usbhost?

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use