Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alxbnct/9a725e76248b918f3db871964ee68f71 to your computer and use it in GitHub Desktop.
Save alxbnct/9a725e76248b918f3db871964ee68f71 to your computer and use it in GitHub Desktop.
Set screen resolution on Virtualbox (host machine)
#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Pass VBox machine name and screen resolution"
echo "Example: 'OpenBSD New' '1920x1080x32'"
exit 1
fi
VBoxManage setextradata "$1" CustomVideoMode1 "$2"
result=`VBoxManage getextradata "$1" CustomVideoMode1`
case "$result" in
*$2*) VBoxManage getextradata "$1" CustomVideoMode1 && echo success;;
* ) echo failure ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment