VirtualBox Cheatsheet

Table of contents

To Change Screen Resolution

This applies to Oracle VirtualBox, a VM called “Gentoo”.

Change to your Vms folder, and execute:

$ VBoxManage setextradata Gentoo \
CustomVideoMode1 1400x900x32

Then you can check it got added with:

$ VBoxManage getextradata Gentoo

It should respond:

Key: CustomVideoMode1, Value: 1400x900x32
Key: GUI/Fullscreen, Value: true
Key: GUI/LastCloseAction, Value: PowerOff
Key: GUI/LastNormalWindowPosition, Value: 0,64,640,522

Then you need to create a file on the Virtual machine at /etc/X11/xorg.conf.d/00-virtual-monitor.conf and put into it:

# X11 configuration for VirtualBox
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  "1400x900"
  EndSubSection
EndSection

Then reboot, it should have changed!