VirtIO Ethernet driver in DragonFlyBSD under FreeBSD bhyve

Jan Beich jbeich at
Tue Jun 28 22:06:51 UTC 2016

Oleg Ginzburg <olevole at> writes:

>>> /usr/sbin/bhyve -c 1 -m 4294967296 -A -H -P -s 0:0,hostbridge -s 2:0,virtio-
>>> rnd -s 3:0,virtio-net,tap0 ...

Does it crash with less than 4G of RAM for you as well?

  $ bhyve -m 1G ...
  Unhandled memory access to 0x100000000
  Failed to emulate instruction [0x81 0x3c 0x8f 0x5f 0x4d 0x50 0x5f 0x75 0x0e 0xeb 0x05 0xb9 0x00 0x00 0x00] at 0xffffffff80a2e0a7

Peter Grehan <grehan at> writes:

>> Any news since then? virtio-net and virtio-blk work fine if using Qemu +
>> OVMF 20160418 (a8c39ba) on the same DragonFly disk image where Bhyve +
>> BHYVE_UEFI_20160526.fd fails.

VirtIO issue isn't specific to UEFI but also happens with Grub2.

>>   virtio_pci0: <VirtIO PCI Block adapter> port 0x2000-0x203f mem
>> 0xc0002000-0xc0003fff irq 6 at device 4.0 on pci0
>  The irq value doesn't seem correct for that slot compared to booting
> FreeBSD.
>  Was this with a recent Dragonfly snapshot ? If you can point me to
> the release I'd like to give it a try.

I've used a daily snapshot where the installer still doesn't support
GPT/EFI yet. Tested as

  $ bhyve -l com1,stdio -l bootrom,BHYVE_UEFI.fd -m 4G -s 0,hostbridge \
    -s 31,lpc -s 4,virtio-blk,/dev/md0 -s 5,virtio-net,tap0 vm0


  $ qemu-system-x86_64 -nographic -bios OVMF.fd -m 256M \
    -drive if=virtio,file=/dev/md0 -net nic,model=virtio -net tap,ifname=tap0

after preparing image as follows

  # see
  $ fetch
  $ bunzip2 DragonFly-x86_64-20160628-DEV-v4.5.0.1264.gc57fa.img.bz2
  $ mdconfig -f DragonFly-x86_64-20160628-DEV-v4.5.0.1264.gc57fa.img

  $ gpart destroy -F md0
  $ gpart create -s GPT md0
  $ gpart add -b 2112 -t dragonfly-ufs md0
  $ gpart add -t efi md0

  $ newfs_msdos -F 12 -m 0xf8 /dev/md0p2
  $ mount -t msdosfs /dev/md0p2 /mnt
  $ mkdir -p /mnt/efi/boot/

  $ mkdir /mnt2
  $ mount -t ufs /dev/md0p1 /mnt2

  $ install -p /mnt2/boot/boot1.efi /mnt/efi/boot/bootx64.efi
  $ echo boot_serial=YES >>/mnt2/boot/loader.conf
  $ echo vfs.root.mountfrom=\"ufs:vbd0s0\" >>/mnt2/boot/loader.conf

  $ umount /mnt; umount /mnt2; rmdir /mnt2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 602 bytes
Desc: not available
URL: <>

More information about the freebsd-virtualization mailing list