Bug 280481

Summary: virtualization/bhyve: When bhyve virtualizes Linux Ubuntu,the Raspberry PI Imager does not recognizes any USB stick / sd card
Product: Base System Reporter: mario felicioni <marietto2008>
Component: bhyveAssignee: freebsd-virtualization (Nobody) <virtualization>
Status: New ---    
Severity: Affects Many People CC: emaste
Priority: ---    
Version: Unspecified   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
raspberry pi imager frozen when it should recognize the sd card passed thru bhyve. none

Description mario felicioni 2024-07-28 18:30:27 UTC
Created attachment 252338 [details]
raspberry pi imager frozen when it should recognize the sd card passed thru bhyve.

Hello.

I'm running Ubuntu 24.04 virtualized with bhyve using these parameters :

/usr/sbin/./bhyve-lin -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A \
-s 0,hostbridge \

-s 1,ahci-hd,/mnt/$vmdisk4'p2'/bhyve/img/Linux/Ubuntu-2404-Android.img,bootindex=1 \

-s 2,ahci-hd,/dev/$vmdisk15 \

-s 8:0,passthru,2/0/0 \
-s 8:1,passthru,2/0/1 \
-s 8:2,passthru,2/0/2 \
-s 8:3,passthru,2/0/3 \
-s 11,hda,play=/dev/dsp,rec=/dev/dsp \
-s 13,virtio-net,tap9 \
-s 14,virtio-9p,sharename=/ \
-s 29,fbuf,tcp=0.0.0.0:5909,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:9 < /dev/null & sleep 2 && vncviewer 0:9


Where /dev/$vmdisk15 is :

Disk /dev/sdb: 953,68 GiB, 1024005767168 bytes, 2000011264 sectors
Disk model: BHYVE SATA DISK 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E0E79E7B-DC41-4DD7-9B8C-62B075FAF126

Dispositivo   Start       Fine    Settori   Size Tipo
/dev/sdb1      2048      34815      32768    16M ChromeOS kernel
/dev/sdb2     34816      67583      32768    16M ChromeOS kernel
/dev/sdb3     67584    1116159    1048576   512M Linux filesystem
/dev/sdb4   1116160 2000009215 1998893056 953,1G Linux filesystem

My intention was to write the Lineage OS to the sd card using the Raspberry PI Imager,without to rebooting and without using Linux natively. Well,it is not able to detect my sd card (that I have placed inside my SD card TO USB adapter).

The images below shows that the sd card passed through bhyve is not recognized by the RaspBerry Pi Imager,that freezes.


What can I do to unfreezes it ? Let us know,thanks.
Comment 1 mario felicioni 2024-07-28 18:31:40 UTC
@mark peek
Comment 2 mario felicioni 2024-07-28 18:50:16 UTC
Opened a bug ticket on the rpi-imager github :

https://github.com/raspberrypi/rpi-imager/issues/898
Comment 3 mario felicioni 2024-07-29 19:38:12 UTC
Bhyve can't pass thru USB drives. Its a not implemented function. I think that a patch that convert the disk from SATA to USB is needed....or better,that allows to identify the disk as USB disk and not as SATA disk.