vbox Slow Ubuntu/Lubuntu Boot on VirtualBox 6.x under FreeBSD

After upgrading to VirtualBox 6.x on FreeBSD, I started encountering an issue that I’ve been trying to solve for quite some time. It affects Ubuntu and Lubuntu guests. The slowdown occurs in a very early stage of the boot process, and it even seems possible that it happens before the boot manager appears — but I’m not entirely sure. For about 30 to 60 seconds, something is being read from the disk extremely slowly (around 1 MB/s). After this phase, the system continues booting at a normal speed.

I’m using BIOS boot and SATA. I also tried switching the virtual disk to VirtIO, but it didn’t change anything. The issue appears consistently on FreeBSD 12.x, 13.x, and 14.x. On Windows, everything works fine, and a FreeBSD guest also runs without issues in VirtualBox on FreeBSD.

Does anyone have an idea what might be causing this?
 
Take a look at the .../VirtualBox VMs/Ubuntu/Logs/VBox.log, maybe it shows what happening during the slowdown.

The timestamps should show the slowdown phase, check what's happening during that phase.
 
Below is a snippet from the log. The slowdown occurs between timestamps 00:00:05.182917 and 00:00:39.236100. Nothing appears in the log during the slowdown itself.
Code:
00:00:01.474394 VMMDev: Guest Log: BIOS: VirtualBox 6.1.50
00:00:01.474573 PCI: Setting up resources and interrupts
00:00:01.474858 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:01.490925 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0 flags=0x0 origin=0,0
00:00:01.492285 VMMDev: Guest Log: CPUID EDX: 0x178bfbff
00:00:01.492422 PIIX3 ATA: Ctl#1: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:01.492456 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:01.493713 AHCI#0: Reset the HBA
00:00:01.493726 VD#0: Cancelling all active requests
00:00:01.493780 AHCI#0: Port 0 reset
00:00:01.493808 VD#0: Cancelling all active requests
00:00:01.494376 VMMDev: Guest Log: BIOS: AHCI 0-P#0: PCHS=16383/16/63 LCHS=1024/255/63 0x0000000002800000 sectors
00:00:01.496202 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
00:00:01.511944 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00000008ada24000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0 origin=0,0
00:00:01.967765 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 1360x952
00:00:01.969115 GUI: 2D video acceleration is disabled
00:00:01.969197 GUI: HID LEDs sync is not supported on this platform
00:00:01.976754 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:01.976977 GUI: Machine-window #0 deactivated
00:00:01.977008 GUI: Releasing mouse on focus out
00:00:01.977017 GUI: Releasing keyboard on focus out
00:00:01.977282 GUI: Machine-view #0 unfocused, reason=3
00:00:03.973895 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:03.974171 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0032
00:00:03.974621 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
00:00:04.029000 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0 flags=0x0 origin=0,0
00:00:05.182917 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00000008ada24000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0 origin=0,0
00:00:39.236100 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0 flags=0x0 origin=0,0
00:00:39.444387 GIM: KVM: VCPU  0: Enabled system-time struct. at 0x000000001f401000 - u32TscScale=0xb6fcb41a i8TscShift=-1 uVersion=2 fFlags=0x1 uTsc=0x18bd976a31 uVirtNanoTS=0x8d79ad739 TscKHz=2798010
00:00:39.444462 TM: Switching TSC mode from 'Dynamic' to 'RealTscOffset'
 
6.1? You might want to upgrade further, 6.1 is EoL upstream (since January 2024), any bug that pops up will never get fixed.
If I'm not mistaken, VirtualBox 6.x is still the default version in the ports. Why is that?
 
Back
Top