vm-bhyve icon indicating copy to clipboard operation
vm-bhyve copied to clipboard

Purging a borked OS install requires rebooting the entire host

Open stratacast opened this issue 5 years ago • 1 comments

Trying to set up Windows Server and found out that the configuration file is incorrect for it. Went back to edit the file and my VM was in a "locked" state. Couldn't shut it down or stop it, removed the lock and it always says it's running. Killed the processes, restart the vm service, nothing works until I reboot the entire darn host. Also can't even delete the vm without forcing a deletion of the zfs dataset. Is there no simple solution to this?

stratacast avatar Jun 15 '19 22:06 stratacast

When you start a VM, vm-bhyve will create a bhyve instance using the VM's name. as you can see, after you start a VM by vm-bhyve, the process will create two like this: (my vm name is xl207)

 3611  0- I         0:00.02 /bin/sh /usr/local/sbin/vm _run xl207
 3934  0- SC      593:57.50 bhyve: xl207 (bhyve)

When you stop bhyve or kill process id 3934, the vm-bhyve will do the clean up. such as destroy the instance of that VM. Sometimes when process vm-bhyve(3611) is killed or end before bhyve(3934), the VM instance will remain. and you cannot start the same VM anymore unless you destroy that instance by following command

bhyvectl --vm=<VM> --destroy

WanpengQian avatar Jul 19 '19 05:07 WanpengQian