UTM icon indicating copy to clipboard operation
UTM copied to clipboard

FreeBSD 14.0-CURRENT does not boot

Open AwlsomeAlex opened this issue 2 years ago • 13 comments

Describe the issue Trying to install the latest snapshot of FreeBSD 14.0. Press enter at bootloader [multi-user mode], and stuck at kernel message saying "random: randomdev_wait_until_seeded unblock wait".

Issue does not occur with 12.3-RELEASE and 13.0-RELEASE.

Configuration

  • UTM Version: 3.0.2 Beta
  • OS Version: macOS Monterey 12.1
  • Intel or Apple Silicon? Apple Silicon

Crash log VM did not crash

Debug log debug.log

Upload VM config.txt

AwlsomeAlex avatar Jan 15 '22 15:01 AwlsomeAlex

Please test if this this OS boots in QEMU installed separately, via command line.

conath avatar Jan 15 '22 17:01 conath

I suspect it may be related to #3121 can you see if it works in v2.4.1?

osy avatar Jan 16 '22 00:01 osy

@osy Issue still occurs in v2.4.1 and v3.0.3. Although in 3.0.3 I'm sometimes also getting this panic: panic: mtx_lock() by idle thread 0xffffa0000058a6000 on sleep mutex vm map (system) @ /usr/src/sys/vm/vm_map.c:4935

@conath Tried running with qemu-system-aarch64 -M virt,highmem=off -accel hvf -cpu host -smp 4 -m 4096 -drive file=pflash0.img,format=raw,if=pflash,readonly=on -drive file=pflash1.img,format=raw,if=pflash -device virtio-gpu-pci -display default,show-cursor=on -device qemu-xhci -device usb-kbd -device usb-tablet -device intel-hda -device hda-duplex -cdrom FreeBSD-14.0-CURRENT-arm64-aarch64-20220113-0910a41ef3b-252413-disc1.iso -drive file=fbsd.img,if=virtio,cache=writethrough but I couldn't get very far because the window would say "Display output is not active" once I got past the bootloader. This also happens with UTM when I set the device driver to virtio-gpu-pci.

However, adding -nographic -serial mon:stdio allowed me to boot into FreeBSD's installer through my current terminal window.

EDIT: Adding -device virtio-rng-pci also brought me to the installer with the arguments above (plus -nographics)

AwlsomeAlex avatar Jan 16 '22 12:01 AwlsomeAlex

I booted freebsd 14 with 4 cores and it panicked with obvious multithreading problem and dropped me to the kernel debugger which did not work for me. I tried reducing the core to 2. and it booted just fine. Not sure this is a UTM bug.

jteloh avatar Jan 17 '22 15:01 jteloh

@jteloh Interesting, I tried that but my boot would hang at random: randomdev_wait_until_seeded unblock wait.

AwlsomeAlex avatar Feb 22 '22 04:02 AwlsomeAlex

Where do we stand now with FreeBSD 14? It seems that some folks are getting at least to some point: https://github.com/utmapp/UTM/issues/5964

I'd like to understand how the arm64 experience works with FreeBSD 14 on UTM installations as compared with VMware if at all possible and someone has compared the UX with each...

ylluminate avatar Jan 05 '24 09:01 ylluminate

I am currently running FreeBSD 14 with X and i3 using VMware on a MacBook Pro M3. There is no vmgfx driver anymore in the drm-kmod port (and it doesn't look like the maintainer of that port has any intention of supporting it any longer) so drm or any 3D acceleration is not going to work for the time being in VMware. X does however start with the userland xf86-video-scfb driver. FreeBSD recognizes a VGA-compatible display under VMware on boot.

I was unable to get X to start on FreeBSD using any other VM manager (including UTM). FreeBSD has a virtio-gpu kernel module but in reading about it, seems to have been written to support 2D acceleration specifically for the FreeBSD virtual terminal (vt). And similar to the vmgfx drm driver, there is no drm virtio driver in the drm-kmod port. Under UTM, using any of the virtio drivers, and the same scfb userland driver fails when starting X with:

...
mmap returns: addr 0x0 len 0x3e8000, fd 12, off 0
(EE) Fatal server error:
(EE) AddScreen/ScreenInit failed for driver 0
...

Not sure if any of that is helpful.

mmpestorich avatar Feb 01 '24 00:02 mmpestorich

@mmpestorich, some thoughts:

  1. Did you try to circumvent or reduce acceleration impact via using remote access such as RDC/RDP?

  2. Can you share the VMware version and any key configurations for FreeBSD 14 with X, etc?

  3. How is the performance without 3D acceleration, especially for common workflows?

  4. Any workarounds, solutions, ideas for improved graphics or 3D acceleration on macOS with Apple Silicon?

  5. So you didn't get X to start at all with UTM on FBSD 14 given your error above, right? Looks like we need some UTM or other experienced help in this area...

  6. Have you done any research to find others who might have had graphical success with FBSD 14 on Apple Silicon virtual machine options? It seems there might be some discussions around and it would be interesting if you've stumbled upon any such more recent entries on this topic...

ylluminate avatar Feb 01 '24 09:02 ylluminate

@ylluminate

  1. Did you try to circumvent or reduce acceleration impact via using remote access such as RDC/RDP?

Not with RDP, but I did initially use VNC (pkg install xorg-minimal xf86-video-dummy tigervnc-server), which works. Completely usable, but performance is nowhere near as good as using the scfb driver with the VMware display. I should clarify, this was all done using UTM.

  1. Can you share the VMware version and any key configurations for FreeBSD 14 with X, etc?
Screenshot 2024-02-01 at 12 26 27 PM

Pretty standard configuration. Don't remember changing much of anything. Created a new virtual machine "Create Custom Virtual Machine > Select FreeBSD 14 64-bit Arm" and then replaced the vdmk with the one downloaded from FreeBSD's website.

Screenshot 2024-02-01 at 12 24 19 PM

Then ran: pkg install xorg-minimal libXcursor xf86-input-libinput xf86-input-evdev xf86-video-scfb i3 i3status dmenu alacritty dejavu terminus-font. Configured i3 and alacritty. Set Xft.dpi to an appropriate value in ~/.Xresources and started X: xinit i3.

Screenshot 2024-02-01 at 1 00 37 PM
  1. How is the performance without 3D acceleration, especially for common workflows?

More than fine. There are some refresh issues in X when switching from a virtual terminal back to X/i3, but moving the mouse immediately clears everything up. Other than that I haven't noticed anything substantial.

  1. Any workarounds, solutions, ideas for improved graphics or 3D acceleration on macOS with Apple Silicon?

Nope, unless something happens here or here...

  1. So you didn't get X to start at all with UTM on FBSD 14 given your error above, right? Looks like we need some UTM or other experienced help in this area...

Yup. A bit out of my depth. VNC is all I could get going in UTM.

  1. Have you done any research to find others who might have had graphical success with FBSD 14 on Apple Silicon virtual machine options? It seems there might be some discussions around and it would be interesting if you've stumbled upon any such more recent entries on this topic...

I've looked all over and not found much. Seems like running/virtualizing FBSD 14 on Apple Silicon is not all that common yet.

I even attempted to get FBSD to boot under Apple's Virtualization Framework (using this person's work as a starting point) but never got past the boot screen.

mmpestorich avatar Feb 01 '24 21:02 mmpestorich

Interesting, thanks for the additional details. Fwiw, I believe RDC/RDP can be more efficient and responsive than VNC. I've never had any particularly good experiences with VNC over the past couple decades to be frank. When possible I use Jump Connect as it's about the best remote access option I've found, but with it's lack of a native Linux (and obviously FBSD client), it doesn't really facilitate anything here. I've tried some other options as well for Linux in the past, but the setup rituals are usually significantly more involved than setting up RDP access.

The VMware situation really gives me a lot of concern. I think the product is effectively dead after the ESXi stuff and the general hostility of Broadcom. Glad to see your steps there - I had similar success with KDE, but trying to get the open source drivers to function didn't shake out.

Really appreciate those two links for the drm-kmod work as well as the others.

ylluminate avatar Feb 01 '24 22:02 ylluminate

@mmpestorich note: https://github.com/freebsd/drm-kmod/pull/119#issuecomment-1922499177

ylluminate avatar Feb 01 '24 23:02 ylluminate

@conath @osy I've tested this with the latest FreeBSD-14.0-RELEASE image and didn't experience any issues. Since the discussion of this issue is going a bit off-course, I'm okay with closing it. Perhaps something was broken at the time of opening this?

AwlsomeAlex avatar Feb 14 '24 14:02 AwlsomeAlex

Any progress in this matter ? I have also tried installing FreeBSD 14 on utm MacBook m1 , installation was successful but no luck with gui , xfce, gnome kde nothing works. If anyone had any success please do share the steps and configuration

imrohitkumar avatar Apr 21 '24 21:04 imrohitkumar