OS X + VirtualBox + Ubuntu 10.10 = Flaky Resolution

I’ve been using a VirtualBox VM running Ubuntu 10.10 quite a bit recently. After getting the base system up and running I installed version 4.0.4 of the guest additions. The guest additions handle VirtualBox shared folders, the clipboard, and screen resolution.

I want to use the VM in full screen; i.e. it looks like I’m running Ubuntu on my MacBook Pro. I’ve been having the hardest time with the screen resolution. One minute it appears to be working, and then all of a sudden the screen resolution gets “off” and it no longer fills the screen. Since having a dynamically resizable screen isn’t a priority at the moment, I figure out how to “hard code” the full resolution I want.

Ubuntu 10.10 no longer has /etc/X11/xorg.conf. Instead if Xorg doesn’t have this configuration file, it automatically figures things out while it’s running. That’s great, but at least in VirtualBox it apparently doesn’t get the screen resolution right (I’m guessing the blame falls on VirtualBox for not properly relaying the screen resolution to the guest OS). In any case, the first thing to do is actually get an xorg.conf file. This can be done by:

  • logging out of the GUI
  • dropping into a console (e.g. ctrl+alt+F1)
  • logging in as root
  • Stopping GDM (service gdm stop)
  • Run X -configure
  • cp /root/xorg.conf.new /etc/X11/xorg.conf
  • Now that the configuration file is in place, find the Display section and add the resolution mode you’re interested in; in my case, my screen res is 1680×1050:

    SubSection "Display"
    Viewport 0 0
    Depth 24
    modes "1680x1050_60.00"

    Finally, service gdm start

    The screen resolution should be full again. Remember the screen resolution will not be dynamic anymore, but that was already jacked.