bhyve Setting up bhyve

Code:
# sh /usr/share/examples/bhyve/vmrun.sh -h
Usage: vmrun.sh [-aAEhiTuvw] [-c <CPUs>] [-C <console>] [-d <disk file>]
                [-e <name=value>] [-f <path of firmware>] [-F <size>]
                [-G [w][address:]port] [-H <directory>]
                [-I <location of installation iso>] [-l <loader>]
                [-L <VNC IP for UEFI framebuffer>]
                [-m <memsize>] [-n <network adapter emulation type>]
                [-p <pcidev|bus/slot/func>]
                [-P <port>] [-t <tapdev>] <vmname>

       -h: display this help message
       -a: force memory mapped local APIC access
       -A: use AHCI disk emulation instead of virtio-blk
       -c: number of virtual cpus (default: 2)
       -C: console device (default: stdio)
       -d: virtio diskdev file (default: ./diskdev)
       -e: set FreeBSD loader environment variable
       -E: Use UEFI mode (amd64 only)
       -f: Use a specific boot firmware (e.g., EDK2, U-Boot)
       -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768) (amd64 only)
       -G: bind the GDB stub to the specified address
       -H: host filesystem to export to the loader
       -i: force boot of the Installation CDROM image
       -I: Installation CDROM image location (default: ./release.iso)
       -l: the OS loader to use (default: /boot/userboot.so) (amd64 only)
       -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)
       -m: memory size (default: 512M)
       -n: network adapter emulation type (default: virtio-net)
       -p: pass-through a host PCI device (e.g ppt0 or bus/slot/func) (amd64 only)
       -P: UEFI GOP VNC port (default: 5900)
       -t: tap device for virtio-net (default: tap0)
       -T: Enable tablet device (for UEFI GOP) (amd64 only)
       -u: RTC keeps UTC time
       -v: Wait for VNC client connection before booting VM
       -w: ignore unimplemented MSRs (amd64 only)

Looks like it does what the handbook said it would;
The following command lists all available program argument options:
 
If you are not root, vmm is not loaded, or it is not amd64 or arm64, the usage will not be displayed, so it may be written for checking purposes.
 
Looks like I must have screwed up my environment in some way. I did try the same thing numerous times, but it worked as advertised when I started a new sh shell from tmux.
 
OK, I've got as far installing FreeBSD 15.0 as a guest and it starts the installation process but can't get an IP address.

Looks like I have misconfigured the virtual interface.

I'm using the default.conf interface and it is identified as vtnet0 by ifconfig. Is that to be expected?

Maybe I should have used disc1.iso rather than bootonly.iso then I wouldn't have had that problem.
 
So I have now used dsic1.iso and installed and logged on to the system, although I don't know the correct way to terminate the session which I have connected to. I did a poweroff but the session has not closed. Is there anything I can enter in that session, maybe to start it up.

Should I be able to ping outside of the vm or install any pkgs?
 
I'm using the default.conf interface and it is identified as vtnet0 by ifconfig. Is that to be expected?
If that VM uses virtio-net, yes. A FreeBSD guest will detect it as vtnet(4).

Code:
     virtio-net      Virtio network interface.
bhyve(8)

although I don't know the correct way to terminate the session which I have connected to.
Did you use cu(1) to connect to the (virtual) serial console? You can exit that with ~^D
Code:
     ~^D or ~.
             Drop the connection and exit.  Only the connection is dropped –
             the login session is not terminated.
cu(1)
 
bhyve is bare bone just like qemu, if it's okay for you go with it, but if you struggle vm-bhyve is simpler to manage and does a good job.

I already post that link several times on this forum, but just in case, there is an article easy to follow from vermaden, before applying any commands read it entirely several times until you understand what it is, then pick the parts you need.
If you need help search in their wiki on the github project, or through reported issues this might help too, well obviously you may also find few interesting threads here too.

Good luck.
 
but if you struggle vm-bhyve is simpler to manage and does a good job.
It's extremely powerful in its simplicity. Definitely a useful tool to use for a fairly basic VM host.
Code:
# vm list
NAME               DATASTORE  LOADER     CPU  MEMORY  VNC           AUTO      STATE
case               default    bhyveload  4    4096M   -             Yes [4]   Running (5455)
jenkins            default    bhyveload  4    4096M   -             Yes [6]   Running (11502)
kdc                default    uefi       2    2048M   0.0.0.0:5900  Yes [1]   Running (2881)
lady3jane          default    bhyveload  4    16384M  -             Yes [3]   Running (3685)
errol              stor10k    bhyveload  2    4096M   -             Yes [8]   Running (7647)
fbsd-test          stor10k    bhyveload  2    4096M   -             Yes [12]  Running (6174)
fbsd-test-pkgbase  stor10k    bhyveload  4    4096M   -             No        Stopped
gl-runner-1        stor10k    bhyveload  4    4096M   -             Yes [11]  Running (72914)
haos               stor10k    uefi       4    4096M   -             No        Stopped
kibana             stor10k    bhyveload  4    8192M   -             No        Stopped
riviera            stor10k    bhyveload  2    4096M   -             Yes [10]  Running (2350)
sdgame01           stor10k    uefi       4    8192M   0.0.0.0:5901  Yes [7]   Running (4694)
tessierashpool     stor10k    bhyveload  2    4096M   -             Yes [5]   Running (97360)
wintermute         stor10k    bhyveload  4    4096M   -             Yes [9]   Running (3729)
 
It's extremely powerful in its simplicity. Definitely a useful tool to use for a fairly basic VM host.
Totally agree, it's the kind of wrapper you do not regret to install.
I do not do crazy stuff, but still I enjoy short commands.
Otherwise with all possible bhyve's parameters, things can quickly go sideways, like qemu.
Talking about it I am experimenting qemu since few weeks and I already wrote a couple of scripts to handle my pain ... well it's another world.

vm-bhyve is on my home server since 13.something (I don't remember exactly) and since it's just flawless.
It runs NetBSD OpenBSD and FreeBSD like a charm, few linux distro, one of them even runs docker without any particular issue.
So far so good, but I must admit templates in their github wiki helped me a lot though.
 
  • Thanks
Reactions: drr
Back
Top