bhyve bhyve with FreeBSD as guest - basic question

I decided having a play with bhyve was long overdue. I'm following the handbook and have got a very basic question but can't see what I am meant to do:


So section "24.6.2. Creating a FreeBSD Guest". It has all gone as detailed, I've installed FreeBSD 13.3 from my ISO CD image, and I'm at the last step:

After installing a system in the virtual machine, when the system asks about dropping into a shell at the end of the installation, choose Yes.

Reboot the virtual machine. While rebooting the virtual machine causes bhyve to exit, the vmrun.sh script runs bhyve in a loop and will automatically restart it. When this happens, choose the reboot option from the boot loader menu to escape the loop.


So I'm at the shell after my install. It says "Reboot the virtual machine" - but how? Am I to type reboot (or shutdown -r now)?

If I do either of those I get stuck in the loop it mentions - and it reboots off my CD image. So "When this happens, choose the reboot option ... escape the loop."

But I don't escape the loop, it just starts a new 10 second countdown and then boots off my CD image again.

I want to get to the next stage in the instructions where I use a different vmrun.sh command to start booting off my fresh install, so I get what the objective is, but I'm not seeing the how.

What is the obvious step or two that I've missed?
 
shutdown -p now stops the VM and let's me get out of the vmrun.sh loop, but that's not a reboot so think I'm still missing something!
 
These instructions are confuse, indeed. Once you exit from the vmrun.sh script, just start the VM as indicated:
# sh /usr/share/examples/bhyve/vmrun.sh -c 4 -m 1024M -t tap0 -d guest.img guestname

I never used this script but this should work because, this time, there is no iso file inserted in the VM.
 
Once you exit from the vmrun.sh script
Well that’s just it - how do I exit the script when it’s in this loop?

I was running it over ssh so maybe it’s more obvious when sitting in front of the computer itself.

When run under ssh you go into the installer and then you are in the loop; maybe it’s different if you don’t use ssh.
 
This script exits when encountering an error or poweroff in the VM.
(I did exactly the same in my own script).

Code:
...
bhyve_exit=$?
    # bhyve returns the following status codes:
    #  0 - VM has been reset
    #  1 - VM has been powered off
    #  2 - VM has been halted
    #  3 - VM generated a triple fault
    #  all other non-zero status codes are errors
    #
    if [ $bhyve_exit -ne 0 ]; then
        break
    fi
 
That’s why my shutdown -p works, then. But that’s not a reboot so that’s why I’m wondering what the handbook is expecting me to do.
 
Back
Top