Skip to content

Instantly share code, notes, and snippets.

@pkutzner
Created February 10, 2018 04:30
Show Gist options
  • Save pkutzner/bb81550da8f83862d28f6e2d4a758de1 to your computer and use it in GitHub Desktop.
Save pkutzner/bb81550da8f83862d28f6e2d4a758de1 to your computer and use it in GitHub Desktop.
Attach ISO image to VirtualBox headless guest
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage $0 'VM_NAME' /path/to/image.iso"
exit 1
fi
VMNAME="$1"
ISOIMAGE="$2"
sudo -u vbox vboxmanage storageattach "$VMNAME" --storagectl "IDE" --port 1 --device 0 --type dvddrive --medium "$ISOIMAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment