There was one problem with restarting the VM, but it was solved by installing bhyve+
I've decided to start out using vm-bhyve.No. Everything went well. I do not use cbsd or vm though, I use bhyve directly. But I don't think this should have any affect on the operation of the VM. (maybe in the future I'll switch to vm or cbsd).
My experience - https://forums.freebsd.org/threads/...husiast-triple-boot-desktop.89521/post-616072
(post #5).
'bootrom' option specifies the name of the boot ROM to use for starting the virtual machine.Is this the line that shows the installer where to find the boot loader?
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd
'bootrom' option specifies the name of the boot ROM to use for starting the virtual machine.
Does /var/log/messages tell you anything useful?Server freezes, o/s crash, total lockup, have to reboot.
truncate -s 5G /tmp/alpine.img
cp /usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd /tmp/alpine-uefi-vars.fd
bhyve -k /tmp/alpine.conf
name=alpine
cpus=1
cores=1
threads=1
sockets=1
memory.size=1024M
acpi_tables=true
x86.vmexit_on_hlt=true
x86.vmexit_on_pause=true
pci.0.0.0.device=hostbridge
#pci.0.2.0.device=virtio-net
#pci.0.2.0.backend=tap0
pci.0.4.0.device=virtio-blk
pci.0.4.0.path=/tmp/alpine.img
pci.0.6.0.device=ahci
pci.0.6.0.port.0.type=cd
pci.0.6.0.port.0.path=/tmp/alpine-extended-3.18.3-x86_64.iso
pci.0.29.0.device=fbuf
pci.0.29.0.wait=true
pci.0.30.0.device=xhci
pci.0.30.0.slot.1.device=tablet
pci.0.31.0.device=lpc
lpc.bootrom=/usr/local/share/uefi-firmware/BHYVE_UEFI.fd
lpc.bootvars=/tmp/alpine-uefi-vars.fd
reboot
at the alpine:~#
prompt. Next, I comment out the lines starting with pci.0.6.0
in /tmp/alpine.conf. Then, I recreate the vm by running bhyvectl --vm=alpine --destroy
, followed by bhyve -k /tmp/alpine.conf
.I was able to complete an offline installation of Alpine Linux 3.18.3. I also had to use a BHYVE_UEFI_VARS.fd file (as pointed out earlier by Emrion) to make sure the vm can boot after installation.
Steps:
truncate -s 5G /tmp/alpine.img
cp /usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd /tmp/alpine-uefi-vars.fd
bhyve -k /tmp/alpine.conf
Have you looked at bhyve_config(5) ? To be honest, I myself didn't use too many configuration options when installing/running Debian 11 (I have not tried installing Debian 12, which has a 6.x.x kernel, maybe I will encounter the same problems when installing it on my machine)
I'll try to install Debian 12 today and post the resultsIf you can find the time, could you please try to install Debian 12 and let me know how you come out?
[lanin@freebsd ~/v/deb12]$ cat deb12_inst.sh
sudo bhyve -c 8,sockets=2,cores=2,threads=2 -m 16G -H -w -S \
-s 0,hostbridge \
-s 3,ahci-cd,/mirlo/iso/debian-12.1.0-amd64-DVD-1.iso \
-s 4,ahci-hd,/mirlo/bsd/vms/deb12.img \
-s 5,virtio-net,tap0 \
-s 7,passthru,94/0/0 \
-s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1200,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
deb12
vncviewer :0
. sudo bhyvectl --vm=deb12 --destroy
vncviewer :0
truncate -s 300G deb12.img
...
ifconfig_igb0="DHCP"
...
cloned_interfaces="bridge0 tap0 tap1"
ifconfig_bridge0="addm igb0 addm tap0 addm tap1 up"
...
...
vmm_load="YES"
vmm_name="/boot/kernel/vmm.ko"
...
if_bridge_load="YES"
if_tap_load="YES"
pptdevs="94/0/0 216/0/0"
...
I'll try to install Debian 12 today and post the results
The installation started without problems, and everything installed well. I did exactly what is written in post #37. For installation I used the same two files - one to launch bhyve, the other to launch TigerVNC (~/v/d5/d5_i, ~/v/d5/d5_c - see picture d5_05). After the line "fbuf frame buffer base: ...." appeared in the ~/v/d5/d5_i window (picture d5_01), I launched TigerVNC (picture d5_02). At this moment two lines appeared in the ~/v/d5/d5_i window (after a couple of dozen empty lines) : "BdsDxe:..." (picture d5_03). Despite this, the installation goes well (picture d5_04). Final picture - d5_05 (bhyve is launched by the script ~/v/d5/d5_r).I wonder what would happen if you try to install the same .iso I've been trying to install.
See devuan.org: devuan_daedalus_5.0.0_amd64_netinstall.iso
No need to run through the whole install.
Just see if the installer will load.
The installation started without problems, and everything installed well. I did exactly what is written in post #37.
Yes.Question about the following line of your script:
-s 7,passthru,94/0/0 \
Is this for PCI Passthru?
Yes.
I forgot to delete it, I made a copy-paste from my old script. Delete this line. And try again.
Quite possible....I'm not very good with hardware. I think it’s better to look in PRs for something related to VT-d on dual-processor systems.You don't think any of my "possible hardware issues" deserve attention?
Quite possible....I'm not very good with hardware. I think it’s better to look in PRs for something related to VT-d on dual-processor systems.
In BIOS: CSM enabled, UEFI and Legacy (both allowed), UEFI be tried first.
UEFI in both cases.Are you using Legacy or UEFI boot for FreeBSD Host?
Are you using Legacy or UEFI boot for Guests?