Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ -z $1 ]; then
- echo "Usage: $0 [vm name]"
- exit 1
- else
- VM_NAME=$1
- fi
- VM_FILE=/seng/scratch/group3/${VM_NAME}/${VM_NAME}.vbox
- # Check if VM is a already present
- if [ ! -f ${VM_FILE} ]; then
- echo "Could not find ${VM_NAME} on $HOSTNAME"
- exit 1
- fi
- # Check if we need to register image with VBox
- if ! VBoxManage list vms | grep ${VM_NAME} 1> /dev/null; then
- # Add if not found
- echo "Registering ${VM_FILE}"
- VBoxManage registervm ${VM_FILE}
- fi
- # Start up VM
- VBoxManage startvm ${VM_NAME} --type headless
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement