Setting up a FreeBSD instance bootable from baremetal and KVM

Hi,

I'm in a position where I'd really like to migrate to FreeBSD as soon as possible [presently running Debian 13], yet in a graduated way that provides operational continuity.

I presently have a FreeBSD 15.1 install sitting cold on my workstation, with only basically functioning graphics support, and no ability to set workable resolutions for triple monitors.

My present object is to pass through the FreeBSD 15.1 zfs mirror drives individually to KVM, and to boot into FreeBSD from within my presently established operating environment. And to further build up and configure FreeBSD to the point where I can boot into it as baremetal as my main OS.

To do this successfully, I feel like I will need to understand how to work with X11 configuration very well. Is there any documentation that someone could link me to in order understand X11 architecture, construct, and configuration exceptionally well? The official documentation appears far more geared towards development and engineering concerns.

In addition to the above, would anyone know the specific drivers, and configurations required to have high resolution graphics in KVM with VirtIO. I've seen that there is a section for AMD GPU in the handbook, as well as address to VirtualBox, but I have not seen advice on KVM with VirtIO or even QXL.

Finally I'd like to understand what would need to be done in terms of device identifiers, to make the baremetal FreeBSD install bootable in both baremetal and KVM virt. I.e. is the default / stock setup using UUIDs in configuration files, or does it use OS specific device names, which will have to be converted to UUID form for successful interchangeable baremetal/ KVM virt boot.
 
Hi arnoldoree,

That dual-boot (Baremetal + KVM passthrough) approach is actually a great workflow for migrating smoothly without downtime.

Regarding the graphics setup in KVM with VirtIO vs baremetal:
1. For KVM VirtIO graphics: On FreeBSD 14/15, the standard KMS driver stack (drm-kmod) is primarily for physical GPUs (Intel/AMD/Nvidia). Inside KVM with VirtIO-GPU, FreeBSD typically uses the EFI GOP framebuffer via the vt(4) driver (vt_vga). Make sure you have kern.vty=vt in /boot/loader.conf. In X11, you can use the generic xf86-video-scfb driver (pkg install xf86-video-scfb), which drives the UEFI framebuffer at native host resolutions smoothly.
2. For triple monitors on baremetal later: Modern X11 on FreeBSD relies on KMS and udev/devd auto-detection rather than monolithic manual xorg.conf files. You mostly just install the appropriate DRM package (e.g. drm-515-kmod for AMD/Intel) and add kld_list="amdgpu" (or i915kms) to /etc/rc.conf. Multi-monitor layout is then managed dynamically via xrandr or your desktop environment (XFCE, KDE, etc.).

Are you using virt-manager / QEMU with UEFI (OVMF) for the VM, and what physical GPU do you have on the baremetal host?
 
That dual-boot (Baremetal + KVM passthrough) approach is actually a great workflow for migrating smoothly without downtime.
Thanks for this, honestly brings a smile :) I personally don't find many greater complements than those relating to workflow and process, be they technical or business. Moreover, as well as continuity of operations it increases productivity a great deal, especially in a new context, when you can have an established environment around you as you look in through the 'almost magical' window of virtualization, and work to build onto Terra Nova (New Earth).
1. For KVM VirtIO graphics: On FreeBSD 14/15, the standard KMS driver stack (drm-kmod) is primarily for physical GPUs (Intel/AMD/Nvidia). Inside KVM with VirtIO-GPU, FreeBSD typically uses the EFI GOP framebuffer via the vt(4) driver (vt_vga). Make sure you have kern.vty=vt in /boot/loader.conf. In X11, you can use the generic xf86-video-scfb driver (pkg install xf86-video-scfb), which drives the UEFI framebuffer at native host resolutions smoothly.
Got it, look forward to putting this into effect. With the two different driver stacks, will it be necessary to make any manual interventions switching between VM and baremetal? I.e. Will the order of proceedings need to be: (1) complete configurations and get/solidify bearings in FreeBSD (2) Change driver stack / X11 configurations (3) Boot into FreeBSD for ongoing ordinary operations?
2. For triple monitors on baremetal later: Modern X11 on FreeBSD relies on KMS and udev/devd auto-detection rather than monolithic manual xorg.conf files. You mostly just install the appropriate DRM package (e.g. drm-515-kmod for AMD/Intel) and add kld_list="amdgpu" (or i915kms) to /etc/rc.conf. Multi-monitor layout is then managed dynamically via xrandr or your desktop environment (XFCE, KDE, etc.).
Understood, so X11 configuration knowledge might not be that critical up-front. Will still like to get a firm grip on it after the fact! I already have some experience with xrandr, although not so much with triple monitors. I hope it will be straight forward to get the window elements onto the second and third monitor [KDE Plasma].
Are you using virt-manager / QEMU with UEFI (OVMF) for the VM, and what physical GPU do you have on the baremetal host?

I'm using virt-manager / QEMU with UEFI (OVMF) for the VM.

The GPU on the baremetal host is just a very basic 'Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]'; which I bought when I didn't want to use proprietary drivers for the Nvida QUADRO that came with the workstation. I may end up installing the Nvida P9000 QUADRO back however. But for now just the Radeon 550.

Thanks a great deal so far. Super valuable insight; and also so many great hooks for me to start reading up from, and to start getting very familiar with the FreeBSD platform.
 
Back
Top