dd if=/dev/random of=/dev/blog

2. June 2009

VirtualBox and the X Windowing System

Filed under: BSD, Red Hat, Solaris, Ubuntu, Linux, UNIX — admin @ 07:49

Before I continue with my entry, I just wish to note that VirtualBox 2.2.4 has been released. You can review the Changelog here.

Anyways, whenever virtualizing a non-Windows operating system which utilizes the X Windowing system over VirtualBox, it may be beneficial to have some flexibility on supported resolutions for the GUI. For example, I was using OpenSolaris 2008.11 and VirtualBox seems to create a “virtual” monitor where the operating system (specifically X) is unable to read the monitor’s EDID information to obtain supported resolution information (among other things). As a result of this, by default X assigns 800×600@60 and 640×480@60 as supported display formats. When you are working on a wider screen that supports something larger, this makes for an uncomfortable computing experience; especially with limited graphical space on the virtual client.

In my case, my laptop’s wide screen has a native resolution of WXGA (1280×800). So I had plenty of extra room to work with. WhileVirtualBox allows you to fullscreen a virtual client, I like to multitask and this would limit my multitasking. I wanted to create a display configuration that would utilize most of the 1280×800 while allowing me to manage multiple other applications/windows on my host operating system. So I figured to write those entries manually in my xorg.conf file. This is located at /etc/X11/. So I began to play around with some standard display formats.

By default, OpenSolaris had the following under the “Screen” section:


Identifier     "Screen0"
Device         "Card0"
Monitor        "Monitor0"

Below that I added:


DefaultDepth     24
SubSection "Display"
    Viewport    0 0
    Depth      24
    Modes    "1024x768"  "1024x720"  "1024x600"  "800x600"  "640x480"
EndSubSection

I then reloaded X by rebooting the virtual client and once the operating system came back up, all those options were available. No more default 800×600 and 640×480. In the image below you will notice that the OpenSolaris Virtual Client is displaying at a 1024×600.

vbox with opensolaris

Added Note 3Jun09: Please refer to Comments 1-3 for information on Guest Additions.

7 Comments »

  1. Did you install the VirtualBox Guest Additions in the boxed OS? I’ve installed a few Linux distros in VirtualBox and found, like you did, that it gives you something like an 800×600 resolution by default. However, if you install the guest additions and reboot, when you log in to X you can resize the window to whatever you’d like and it will scale appropriately.

    Comment by Andrew Matta — 2. June 2009 @ 19:03

  2. Currently I have OpenSolaris and Red Hat AS 5 virtual clients configured with Guest Additions installed on both; as I wanted to take advantage of the vboxfs modules for the shared folders between the host OS and the virtual guests. You are correct that installing these additions adds some additional video support (among other things) but in my situation I wanted some more custom resolutions. That is where editing the xorg.conf file came in handy. Also, not all guest operating systems have supported additions: http://www.virtualbox.org/wiki/Guest_OSes

    Comment by admin — 2. June 2009 @ 19:47

  3. The first 2 comments say it all. Install the guest additions, Restart and all is well. I did this on my laptop which runs up 1400 x 1050 resolutions. I happily get 1152 x 864, which is excellent.

    Installing the additions is as simple as running a script once the additions CD ISO image is mounted. It takes a few minutes, but it’s worth it.

    Comment by Paul Hands — 3. June 2009 @ 11:55

  4. Actually, this could come handy for VM software that doesnt support guest additions for unix - such as MS Virtual PC.

    Comment by Raj — 3. June 2009 @ 22:42

  5. I’m running OpenSuse 11.1 on Virtualbox 2.2.2 I’ve installed GuestAdditions but get the same crappy 800×600 resolution. I’ve tried reinstalling GuestAddtions but to no avail. The odd thing is I have shared folders which is part of GuestAddtions … go figure.
    Anyway modifying xorg.conf works for me.

    –rg

    Comment by Random Guy — 4. June 2009 @ 20:12

  6. thank for this info.
    :-)

    Comment by webSpots.co.cc — 5. June 2009 @ 06:14

  7. thanks for sharing … very useful indeed

    Comment by shahryar ghazi — 16. June 2009 @ 05:57

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress