I use Virtualbox. Instead of clicking on the button of the name of the virtual machine to run it, I want a shell script that can run a Windows XP virtual machine hosted on Ubuntu machine. Can someone help me please ?
Asked
Active
Viewed 2,898 times
1 Answers
0
VBox_StopRestoreStart.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 VMNAME_or_UUID"
exit 1
fi
set -x
VBoxManage controlvm "$1" poweroff #enforce turnoff
VBoxManage snapshot "$1" restorecurrent #retore state
VBoxManage showvminfo "$1" | grep State #display state to ensure
VBoxHeadless -s "$1" #run in headless mode in background
Nymeria
- 1,435