Tackling native screen resolution problems on virtual ubuntu guest installs


I remember a time when virtual box users got stuck when trying to run full screen ubuntu guests on ultrabooks with the (as of that time) unusual screen resolution of 1366×768 pixels. Of course, 1366×768 pixels was quite an esoteric resolution at the times of virtual box 4.0.x or so and the emulated graphics driver was simply not (yet) aware of such a circumstance. However, trying to set up an current ubuntu 12.10 guest on the latest vmware player 5.0.2 environment, targeting another 1600×900 ultrabook full screen resolution, showed up to produce the same issue again and I’m not the very first to learn alike, see the vmware threads for example.

The basic problem, as depicted above, is that the guest os just does’nt see the actual native resolution of the hardware because the emulated graphics driver does not provide or list it on request. It will, on the other hand, be able to run that resolution though. Ever tried to find the missing resolution in your display settings with no luck? Then switched the guest os to full screen and, plop, it is there? Then bounced the guest os and the game starts from scratch (and you get this oversized X error window of unsuccessful attempts to apply the latest resolution setting in ~/.config/monitor.xml)? Welcome at Denny’s!

There is a couple of ways to resolve the problem, but, the interesting question seems to read: what is the most appropriate way in terms of compatibilty to the running guest os, ubuntu 12.10 here. That is, you may:

  1. Attempt to force vmplayer to include the other resolution into the emulated hardware specs by manually writing to the my-virtual.machine.vmx file, like here, which, by the way, does’nt work (any longer).
  2. Write a script employing xrandr to create, register and activate the modeline in question like here and here, here and then integrate the script with the display manager startup code for gdm or lightdm respectively.
  3. Return to the good old xorg.conf file, which is deprecated, like here.
  4. Play around with grub_gfxmode, like here again.

Option 1 does not work, I trialed and errored a lot, really. Option 2 will work, I only checked the xrandr steps with success but the setting may only affect the login screen, the desktop screen, after login, may be influenced by other configurations. Option 3 is not a good idea at all. Option 4, finally, is not an option because the emulated grahics driver, vmwgfx here, has not been loaded at the time of grub activity. You can only resort to any resolutions given by vbeinfo.

So what? The winner is Sam Martin, proposing to create a “modern” /usr/share/X11/xorg.conf.d/10-monitor.conf Xorg configuration file that will both affect the login and the desktop screen and will not require to enter any script / test / fail cycle on xrandr with lightdm. Note that the Device identifier in a vmware player environment reads Virtual1.

have fun! P

Advertisements

One comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s