View Single Post
  #21  
Old 18th August 2008, 17:44
thanis thanis is offline
Member
 
Join Date: Aug 2007
Location: somewhere over the rainbox
Posts: 30
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Actually, this is quite easy. VMWare Server 2.0 uses a different way of starting VM's. So, if you edit the vmstart file and change the lines using "vmware-cmd start/stop..." to
Code:
#!/bin/bash 
case "$1" in 
start) 
/usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> start nogui "<path-to-vmxfile>" 2>/dev/null 
# EXAMPLE:  /usr/bin/vmrun -T server -h https://192.168.1.13/sdk -u root -p password start nogui "/var/vm/myvirtualmachine/myvm.vmx"
;;
stop) 
/usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> stop "<path-to-vmxfile>" 2>/dev/null 
;;
status) 
/usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> list
;;
*) 
echo "Usage: `basename $0` 'virtual machine file' {start|stop|status}" 
echo "This commands stops/starts/displays all configured VM's. Update this script !!
;;
esac 
exit 0
Beware, I do not run VMWare Server 2.0 so I do not guarantee the validity of this script. Please check the VMWare Server manual, or revert to version 1.0x for compatability reasons.

Grtz,
Thanis
Reply With Quote
Sponsored Links