Solved bhyve and freebsd as guest

Trying to install freebsd as guest in bhyve:

Code:
vm install -f freebsd-test /pool/main/Images/FreeBSD-13.0-RELEASE-amd64-bootonly.iso

It not boots from iso. I see only grub prompt: "grub>"

here is log:

Code:
Apr 30 21:37:29: initialising
Apr 30 21:37:29:  [loader: grub]
Apr 30 21:37:29:  [cpu: 4]
Apr 30 21:37:29:  [memory: 4096M]
Apr 30 21:37:29:  [hostbridge: standard]
Apr 30 21:37:29:  [com ports: com1]
Apr 30 21:37:29:  [uuid: 82bb003a-c8b1-11ec-90c4-ecf4bbbef78c]
Apr 30 21:37:29:  [utctime: yes]
Apr 30 21:37:29:  [debug mode: no]
Apr 30 21:37:29:  [primary disk: disk0.img]
Apr 30 21:37:29:  [primary disk dev: file]
Apr 30 21:37:29: initialising network device tap0
Apr 30 21:37:29: adding tap0 -> vm-public (public addm)
Apr 30 21:37:30: bring up tap0 -> vm-public (public addm)
Apr 30 21:37:30: booting
Apr 30 21:37:30: create file /pool/vm/freebsd-test/device.map
Apr 30 21:37:30:  -> (cd0) /pool/main/Images/FreeBSD-13.0-RELEASE-amd64-bootonly.iso
Apr 30 21:37:30:  -> (hd0) /pool/vm/freebsd-test/disk0.img
Apr 30 21:37:30: /usr/local/sbin/grub-bhyve -m /pool/vm/freebsd-test/device.map -M 4096M -r cd0 freebsd-test

Ubuntu image starts ok. What im doing wrong?
 
Use a good template for FreeBSD, FreeBSD doesn't boot via Grub.

Code:
dice@hosaka:~ % cat /vm/.templates/freebsd-zvol.conf
utctime="yes"
loader="bhyveload"
cpu=1
memory=512M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
#zfs_dataset_opts="compress=off"
zfs_zvol_opts="volblocksize=8k compress=on"

Set the default, so you don't have to supply -t
Code:
dice@hosaka:~ % ll /vm/.templates/default.conf
lrwxr-xr-x  1 root  wheel  17 Jan  6  2018 /vm/.templates/default.conf@ -> freebsd-zvol.conf

Code:
             -t template   Specifies the template to use from within the
                           $vm_dir/.templates directory.  The .conf suffix is
                           not required.
 
disk0_type="virtio-blk"
nvme works well too and was faster. than virtio-blk the last time I measured it.

I gave up on vm. I just use bhyve directly. For example
bhyve -c 4 \
-S \
-s 0,hostbridge \
-s 5,nvme,$PWD/fbsd14.img \
-s 7,passthru,7/0/0 \
-s 8,virtio-9p,sharename=export \
-s 10,e1000,tap4,mac=12:34:fc:0c:17:be \
-s 11,fbuf,tcp=0.0.0.0:5904 \
-s 20,xhci,tablet \
-s 31,lpc \
-l com1,/dev/nmdm0B \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-m 4G -H -w \
fbsd14
 
You will need something like this:
kldload virtio_9pfs
mount -t virtfs -o trans=virtio sharename
ls -l /mnt

Assuming you created a directory named export on the host in the dir where you ran bhyve.
 
Back
Top