Create a new virtual switch called 'public' and assign em0 to it:
You can use any name you like (lan/internet/etc), although the included templates are set to create one interface on a switch called 'public'. (Obviously you can change the templates if you like)
This will run the bootloader then start bhyve in the background. Connect to the console to complete the install
Once complete, if you reboot the machine at the end of the install process, the machine will reboot as expected and boot up normally. Reboots will work as expected and the machine can be shutdown from the guest in the normal way.
# vm install vm1 FreeBSD-10.1-RELEASE-amd64-disc1.iso
# vm console vm1
To stop a single virtual machine, or all virtual machines from the host:
To account for the possibility of shared storage being used which contains other machines we don't want running on this host, the list of machines to start is set via the `vm_list=""` variable in `/etc/rc.conf`
All network interfaces and nmdm console devices are created dynamically as the guest is started. The entire time the guest is running, vm sits in the background waiting to handle the bhyve shutdown/reboot. Once a guest is shutdown or exits for any other non-reboot reason, all interfaces and nmdm devices are cleaned up.
As an additional example, a private switch to allow two guests to communicate can be created as follows: