machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.44k stars 354 forks source link

How can i check a list of xhyve vms running on my macOS host ? #145

Open mshahat opened 6 years ago

mshahat commented 6 years ago

Hi Team,

how can i check a list of xhyve vms running on my macOS host ? any tooling ?

Thank you

peterlobster commented 5 years ago

I could be wrong, but in bhyve...ls -al /dev/vmm, will list of all the machines.

# ls -al /dev/vmm
total 1
dr-xr-xr-x   2 root  wheel    512 Mar 17 12:19 ./
dr-xr-xr-x  14 root  wheel    512 Mar 17 06:38 ../
crw-------   1 root  wheel  0x1a2 Mar 17 12:20 guestname
crw-------   1 root  wheel  0x19f Mar 17 12:19 linuxguest
crw-------   1 root  wheel  0x1a1 Mar 17 12:19 otherguest

A specified virtual machine can be destroyed using bhyvectl: # bhyvectl --destroy --vm=guestname

Maybe it works the same in xhyve. It doesn't.

Examples from https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html

UPDATE: I decided to actually try this. It didn't work for me. However what I did notice was that xhyve will create another TTYS. You can look at your all your /dev if you simply put in $ls -al /dev. If you scroll down to your TTYS you'll see some that are owned by your account (these are created by the terminal window(s) your probably using) and other owned by root. I assume the ones owned by root would be the xhyve because it only shows up when I create a new VM and when I create it.

Full disclosure...I was using Minikube to make the xhyve machines but maybe it solves the need or at least gives you an idea. Also, all this also applies to HyperKit. As it works the same way.