bhyve Title: Read-Only Filesystem in MX Linux VM on Bhyve After Switching to Ryzen 5 5600G – SATA or BIOS Issue?

Hello everyone,

I am experiencing issues booting an SSD with an MX Linux installation using Bhyve on FreeBSD. This problem appears to have started after I switched from an Intel B85 motherboard with a Xeon E3 CPU to an AMD Ryzen 5 5600G on an ASUS B450M-A II motherboard. The VM worked fine on the Intel setup, and the SSD still boots without issues on bare metal with AMD CPU, but now I am encountering a read-only filesystem with ATA errors when running it through Bhyve. I am hoping someone can help me resolve this.

Setup:
- Host: FreeBSD 14.2-RELEASE-p3
- Hardware: Ryzen 5 5600G, ASUS B450M-A II motherboard, GTX 750 Ti (planned for passthrough)
- VM: MX Linux on /dev/ada2 (220GB SSD, GPT: EFI on /dev/ada2p1, ext4 on /dev/ada2p2, swap on /dev/ada2p3)

Bhyve Command:
Code:
bhyve -c 6 -m 12G -HAPS \
  -l com1,/dev/nmdm-mx-linux.1A \
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
  -s 0:0,hostbridge \
  -s 1:0,virtio-net,tap2 \
  -s 2:0,ahci-hd,/dev/ada2 \
  -s 29,fbuf,tcp=0.0.0.0:5902,w=1280,h=1024 \
  -s 31,lpc \
  mx-linux

Problem:
When using the `ahci-hd` device, the VM boots, but the root filesystem (/dev/sda2) is mounted read-only. The dmesg output (as seen from inside the vm, connected via ssh) shows the following errors:
Code:
[    2.175529] ata1.00: failed command: FLUSH CACHE EXT
[    2.175559] ata1.00: error: { ABRT }
[    2.209971] sd 0:0:0:0: [sda] tag#7 Add. Sense: Unaligned write command
[    2.688818] EXT4-fs (sda2): I/O error while writing superblock

Switching to `virtio-blk` results in the VM dropping to an EFI shell, even though EFI/BOOT/BOOTX64.EFI exists on /dev/ada2p1.

On bare metal, booting the SSD works perfectly, with video output switching to the GTX 750 Ti after Xorg starts. My goal is to passthrough the Nvidia card to the MX Linux VM, which is why I upgraded to the AMD platform with its integrated graphics.

What I Have Tried:
- Ran fsck.ext4 -f /dev/ada2p2 on the host—no major errors were found or fixed that resolved the issue.
- BIOS settings: IOMMU enabled, SATA mode set to AHCI, SVM enabled.

Questions:
1. Could the Ryzen SATA controller or specific BIOS settings be causing `ahci-hd` to fail write operations? Are there any ASUS B450M-A II-specific tweaks I might be missing?
2. Why does `virtio-blk` drop to an EFI shell despite a valid EFI partition? Do I need to adjust the Bhyve UEFI configuration?
3. Are there any diagnostics i can see from FreeBSD to help me Understand why the SSD is mounting read only?

Some details: sysctl hw.vmm.amdvi.enable returns 1, I am not entirely certain that the hardware swap caused this, as I did not test the VM for about two weeks around the time of the change. I am considering reinstalling the Intel B85 board to confirm if the platform switch is the root cause.

I am stumped—this setup worked without issue. Any insights on SATA configuration, BIOS settings, or Bhyve adjustments for AMD platforms would be greatly appreciated.

Thank you in advance for your help!
 
Back
Top