Start a VMware workstation when Linux boots

Start a VMware workstation when Linux boots:

Enter the command:

$ crontab -e

This will open the crontab in your favorite editor, vim on my machine. When open, add the following line:

@reboot sleep 20; /usr/bin/vmrun start "/path/to/vm.vmx" nogui

Safely shut down a VMware workstation when Linux shuts down or reboots: Create a script in /etc/init.d named vmware-stop or something with the contents:

#!/bin/bash
/usr/bin/vmrun stop "/path/to/vm.vmx" nogui

And finally, create some symlinks for the appropriate run levels:

$ sudo chmod +x /etc/init.d/vmware-stop
$ sudo ln -s /etc/init.d/vmware-stop /etc/rc0.d/K00vmware-stop
$ sudo ln -s /etc/init.d/vmware-stop /etc/rc6.d/K06vmware-stop

Related Posts

Leave a Reply