Howto close BHyVe console

Neel Natu neelnatu at
Wed Apr 4 06:33:20 UTC 2012

Hi Takuya,

On Tue, Apr 3, 2012 at 3:39 AM, Takuya ASADA <syuu at> wrote:
> Hi,
> Just for a little question,
> I could run BHyVe on my PC with neel's guest image by following CFT
> page(, it just worked without
> problem, but I couldn't shutdown guest OS safely.
> shutdown command in guest OS doesn't poweroff the VM, and I have no
> idea to close bhyve console.
> Is there any shortcut-key or commands to shutdown it?

If you type "quit" or "reboot" at the loader prompt in the guest it
will exit with a non-zero exit code. You could modify the script that
launches the 'bhyveload' and 'bhyve' programs to quit if the exit code
is non-zero.

Something like this, perhaps:

while [ 1 ]; do
    # Launch the userboot loader
    bhyveload <args> ...
    if [ $? -ne 0 ]; then
        exit 1

    # Launch bhyve
    bhyve <args> ...
    if [ $? -ne 0 ]; then
       exit 1

> I also tried vmmctl --vm=<vm name> --destroy, but it suddenly causes panic.
> kill <bhyve pid> && vmmctl --vm=<vm name> --destroy had worked, so I
> guess  the panic reason is because /usr/sbin/bhyve still holding
> /dev/vmm/<vm name>.

Yup, you got that right.


> Takuya ASADA
> _______________________________________________
> freebsd-virtualization at mailing list
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe at"

More information about the freebsd-virtualization mailing list