bhyve Pass-through of external USB disk problems

I don't know if this is a problem originating from bhyve passthrough, but logic tells me that the guest system wouldn't show this kind of error if the external 8TB USB disk was attached to a bare metal Devuan Linux instead of a virtualized one.

A PCIe card with four USB connections is passed through to a Devuan Linux guest. It's only partition is encrypted with LUKS and formatted with ext4.
My purpose was to have the external disk as a source of data. Only later it would be the destination of some backups.
Regarding the former purpose, I want to copy about 900GB of data to a geli encrypted spin disk.
The copy process from the Devuan Linux to FreeBSD, via rsync (ssh'ed) (or copied via NFS) begins well, seems to transfer a lot of files, but after some time it aborts and the amount copied is only a few GBs.
The USB disk goes to sleep mode after some time of inactivity, which should not be the case when copying (or rsync'ing) files.
The cryptsetup luks partition in Linux is still mounted, but after umounting, cannot mount it back as it says:
mount: /usb_8tb_backups: can't read superblock on /dev/mapper/usb8t
I can only mount it after closing and opening the encrypted container.

The rsync process in FreeBSD reports errors like, for example:
Code:
rsync: read errors mapping "/usb_8tb_backups/partilha_casa/dlna/covid/Nanoparticles could damage DNA at a distance, study suggests _ Nanotechnology _ The Guardian_files/EditionDropdown.legacy.d665139b2851780b80b6.js": Input/output error (5)

Are there any clues about this? Do other people have external USB disk being passed-through without problems?
Any way to dig into this?
 
Last edited:
In /var/log/messages of the Devuan VM there are a lot of messages like:
Code:
Oct  7 23:37:44 devuan kernel: [30077.603352] usb 2-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
Oct  7 23:37:44 devuan kernel: [30077.624267] sd 12:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
Oct  7 23:37:44 devuan kernel: [30077.624269] sd 12:0:0:0: [sdb] tag#0 CDB: Read(16) 88 00 00 00 00 00 00 00 8b 08 00 00 00 f8 00 00
Should I address the bhyve development?
 
Do other people have external USB disk being passed-through without problems?
I have Startech 4 port USB3 card with 2 channels. I pass each channel thru to seperate FreeBSD VM's.
When I hotplug a UBB mass storage device I see the device show up on the console but it takes exactly 60 seconds for the CAM subsystem to bring up the drive. So there is some kind of timeout or error happening at insertion.
I have not had a chance to check with large files. Just config files.
 
There's some problem. Now, I'm using Midnight Commander's fish tool and I can clearly see the symptoms.
The copy process begins fast, but then it gets suspended. Then restarts again after some minutes, like bursts.
In 56 minutes, it has transferred 10GB, so at an average of 3MB/s.
After some time, the process seems to stop.
The disk partition is mounted read only.
 
I will test my speeds when I get a chance.
What USB controller are you passing thru?

Mine is Startech PEXUSB3S42V advertising 2 dedicated 5Gbps channels

I earlier bought a PEXUSB3S44V that is a similar 4 channel controller.
It had so many PCI addresses I didn't know what to pass through.
With the 2 Channel card there were fewer interfaces to figure out.
So I basically had to pass thru all pci addresses for the card then the ppt numbers showed up.
That led me to figure out what was base PLX address and what USB could be passed thru.
The pcb is the same for the two models. The 2 port version has 2 empty controller solder pads.

I don't know that it is any better than cheap NEC USB3 cards but it eats less PCIe slots allowing me more NVMe.
$80-$100 is alot to pay for a USB card.
 
The controller of my (cheap) PCIe card is
VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)
 
Here is a sample of my interfaces
Code:
ppt4@pci0:12:0:0:    class=0x0c0330 card=0x00151912 chip=0x00151912 rev=0x02 hdr=0x00
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
ppt5@pci0:13:0:0:    class=0x0c0330 card=0x00151912 chip=0x00151912 rev=0x02 hdr=0x00
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
ppt6@pci0:14:0:0:    class=0x0c0330 card=0x00151912 chip=0x00151912 rev=0x02 hdr=0x00
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
ppt7@pci0:15:0:0:    class=0x0c0330 card=0x00151912 chip=0x00151912 rev=0x02 hdr=0x00
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
 
This is mine, only one channel:


ppt0@pci0:4:0:0: class=0x0c0330 rev=0x01 hdr=0x00 vendor=0x1106 device=0x3483 subvendor=0x1106 subdevice=0x3483 vendor = 'VIA Technologies, Inc.' device = 'VL805/806 xHCI USB 3.0 Controller' class = serial bus subclass = USB
 
How are you firing up bhyve? Manually or with vm-bhyve?
Mine: /usr/local/sbin/grub-bhyve -m /vm/device.map -r hd0,msdos1 -M 4096M -S devuan1 -d /boot/grub/ &
 
I'm using vm-bhyve. The template for devuan is this:

devuan.conf
loader="uefi" loader_timeout="3" cpu=4 memory=4G #wired_memory="yes" #hostbridge="amd" #bhyve_options="-p 1:1" utctime="yes" network0_type="virtio-net" network0_switch="public" disk0_type="ahci-hd" disk0_name="disk0.img" disk0_dev="file" passthru0="4/0/0" virt_random="2" xhci_mouse="yes"
 
Back
Top