Since Fusion doesn’t have the team functionality that Workstation has I knocked up the following to suspend the current running Fusion VMs and write a new startup script for the same VMs.

Suspend current running VMs with:

# sh suspendvms.sh

This creates the file lastlabstart.sh, run this to start the same VMs:

# sh lastlabstart.sh

Suspendvms.sh

#!/bin/bash
strOrigIFS=$IFS
IFS=$(echo "\n\b");
echo "#!/bin/bash" > lastlabstart.sh
echo "# VMs shut down `date`" >> lastlabstart.sh
for strVM in `vmrun list | sed 's/\ /\\ /' | grep vmx`;
do
	echo "Shutting down $strVM";
	vmrun suspend $strVM;
	echo "vmrun start \"$strVM\" nogui" >> lastlabstart.sh
done
IFS=$strOrigIFS

 

Posted by Dag

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s