-
-
Save alxbnct/7bae8c122452fdd961a9648e00ccaee8 to your computer and use it in GitHub Desktop.
Set OpenBSD screen resolution on Virtualbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# inspired by https://www.tumfatig.net/20190131/customized-resolution-for-openbsd-in-virtualbox/ | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
mkdir -p /etc/X11/xorg.conf.d | |
cat << EOF > /etc/X11/xorg.conf.d/00-virtualbox-monitor.conf | |
Section "Device" | |
Identifier "VirtualBox-Card" | |
Driver "vesa" | |
VendorName "InnoTek" | |
BoardName "VirtualBox Graphics Adapter" | |
EndSection | |
Section "Monitor" | |
Identifier "VirtualBox-Monitor" | |
VendorName "InnoTek" | |
ModelName "VirtualBox Screen" | |
HorizSync 1.0 - 1000.0 | |
VertRefresh 1.0 - 1000.0 | |
EndSection | |
Section "Screen" | |
Identifier "VirtualBox-Screen" | |
Device "VirtualBox-Card" | |
Monitor "VirtualBox-Monitor" | |
DefaultDepth 24 | |
SubSection "Display" | |
Viewport 0 0 | |
Depth 24 | |
#Modes "1368x768" "1360x768" "1280x800" "1024x768" | |
Modes "$1" | |
EndSubSection | |
EndSection | |
EOF | |
echo "Success - reboot your system" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment