Skip to content

Instantly share code, notes, and snippets.

@kasramp
Last active September 1, 2022 12:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kasramp/297bd16e575384ca2ff9cc4046b85251 to your computer and use it in GitHub Desktop.
Save kasramp/297bd16e575384ca2ff9cc4046b85251 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