Powering off FreeBSD VM with VM workstation 10

Zygomatic

Weaksauce
Joined
Dec 6, 2006
Messages
81
Here's the setup: VM Workstation 10 running on Ubuntu Server 12.04LTS, a few virtual clients including but not limited to FreeBSD, CentOS (UDAserver to be specific), Windows server etc.

I am trying to find an easy solution to soft power all these machines before rebooting or shutting down my physical server. I've tried many different approaches, mostly revolving around the "vmrun" command, so I can write a custom script (If needed). I haven't been able to find any solutions online to this kind of problem.

Code:
sudo vmrun stop /var/lib/vmware/Shared\ VMs/FreeBSD/FreeBSD.vmx
Stop's the machine cold, I tried editing the .vmx file and changing "hard" to "soft", and softpower "TRUE" (Not exact syntax), no changes.

Code:
sudo vmrun -gu root -gp LAMEPASSWORD runProgramInGuest /var/lib/vmware/Shared\ VMs/FreeBSD/FreeBSD.vmx /sbin/poweroff
This command seems to do nothing I have to ctrl C to stop it.

Code:
sudo vmrun -gu root -gp LAMEPASSWORD runProgramInGuest "/var/lib/vmware/Shared\ VMs/FreeBSD/FreeBSD.vmx" /sbin/poweroff

Error: Cannot open VM: /var/lib/vmware/Shared\ VMs/FreeBSD/FreeBSD.vmx, The virtual machine cannot be found

Can anyone point me in the right direction?
 
For the non-windows clients, can't you set up ssh keys and do something like 'ssh foo-vm -c poweroff' or somesuch?
 
Not a bad idea, It took me a few minutes to get it working on freeBSD and CentOS since they were a little different. I used ssh-keygen and ssh-copy-id commands to setup no password and the command "ssh Hostname 'poweroff'. I seem to have Server 2003 working besides the fact I have to sudo my script for it to see the VM. Tried the same with Server 2008, no go so far.
 
Ok so far I have 3 VM's that shutdown correctly with my script
Code:
sudo vmrun stop /var/lib/vmware/Shared\ VMs/Server\ 2003/Server\ 2003.vmx
ssh freebsd 'poweroff'
ssh -l root 192.168.5.150 'poweroff'
Using the same command (and many variations) I can't seem to get my server 2008 VM to shut down correctly (It just stops cold). I also noticed when I edited my 2003.vmx file (as root) my changes weren't saved, they seemed to have reverted to default. Any ideas (or workarounds :p) are appreciated!
 
Ok, Thanks a lot for the input, It really got me on the right track. I've been using my server 2008 machine more and more and finally ran across a solution for windows machines
Code:
net rpc shutdown -I 192.168.5.210 -U administrator%lamepassword

The guide is here, Must have samba and all that jazz
 
Back
Top