Mới sưu tầm được cái script để tự động start vmware trên Linux.
#!/bin/bash
# check if Windows VM is running
VMWIN=$(ps -ef | grep 'wts4.vmx' | grep -v 'grep')
# if string is empty then the VM is not running; start it
if [ -z "$VMWIN" ]; then
echo "Starting Windows VM..."
# vmrun start /virtual2/ts2000/wts4.vmx
else
echo "The Windows VM is already running"
fi
# check if Linux VM is running
VMLINUX=$(ps -ef | grep 'rhel4.vmx' | grep -v 'grep')
# if string is empty then the VM is not running; start it
if [ -z "$VMLINUX" ]; then
echo "Starting Linux VM..."
# vmrun start /virtual2/rhel/rhel4.vmx
else
echo "The Linux VM is already running"
fi