VirtualBox 3.0 with 3D capabilities on Ubuntu Intrepid

July 11, 2009 by Resa
Filed under: Linux, Ubuntu 

Ever since I heard that VirtualBox 3.0 had 3D capabilities I wanted to try this out. However … time to “play” has not been very much available. This evening I had some time on my hands, so I decided to give it a try.

On my Ubuntu Intrepid host I first modified the /etc/apt/sources.list file to add the VirtualBox repositories. To do so, I added the following lines:
## VIRTUALBOX REPOSITORIES
deb http://download.virtualbox.org/virtualbox/debian intrepid non-free
Before doing the update I made sure I had the GPG key added. This can be done with the following command
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
Next I updated the repositories and after this installed VirtualBox by using the command

sudo aptitude install virtualbox-3.0

Once this was completed I added myself to the “vboxusers” group and I had to logout and login once to have VirtualBox appear in my menu (Applications –> System Tools –> Sun VirtualBox). During this all in the meantime I had downloaded the Alpha 2 release of Ubuntu Karmic Koala, since I wanted to have a look at that anyway.

First I created a new VM with the following settings (during the initial run the .iso was “inserted” into the CD-Rom):

VirtualBox settings for Karmic Koala

VirtualBox settings for Karmic Koala

Once the VM was started I chose to install Karmic Koala and basically accepted all default settings (except for the timezone). This completed without issues and after a restart a renewed login screen appeared

Karmic Koala login screen

Karmic Koala login screen

Once logged in, the first thing I did was add the so-called “Guest Additions”. This is done by selecting from the VirtualBox window menu Devices –> Install Guest Additons. This resulted in the “Guest Additions CD-Rom” to be mounted. In a terminal I cd-ed into /media/cdrom0 and in that directory issued the command

./autorun.sh

This installation completed without any issues

VirtualBox Guest Additions installation

VirtualBox Guest Additions installation

After this I restarted Karmic Koala (just to be sure) and restarted it started up in a new (and better) size and resolution. Furthermore I noticed that the Visual Effects were present. So what I first did was install the Compiz Settings Manager by issuing the command

sudo aptitude install simple-ccsm

Next I opened the settings manager and changed the number of desktops to 4 (was initially set at 2) and enabled the cube and the rotating cube. Now it was time for the great moment … I pressed down <Ctrl>-<Alt> and moved my mouse and yes …. it worked!

Karmic Koala rotating cube in VirtualBox

Karmic Koala rotating cube in VirtualBox

I have to admit … I am impressed! I know this is something I wished would become available within a VM since it was always something that could not be tested within a VM (at least not within a VM in VMware Server). Now I have an environment in which I can test such capabilities.

UPDATE July 12, 2009: After performing all the updates, which included an upgrade of the kernel (to 2.6.31-2-generic) I lost the 3D capabilities. Additionally the screen size went back to 800×600 (instead of 1024×768). I initially thought this was caused by the fact that the Guess Additions needed to be installed again. However … this did not fix the issue.

So what I did was open the /etc/X11/xorg.conf file and edited this as follows. The original “Screen” section I changed from:
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

into:
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Modes "1024x768"
EndSubSection
EndSection

And at the bottom I added the following:
Section "Extensions"
Option "Composite" "Enable"
EndSection

I rebooted and I had all 3D capabilities back again!

Karmic Koala sphere instead of cube

Karmic Koala sphere instead of cube

The cube however changed into a sphere. Opening the simple Compiz configuration settings manager I noticed it had changed. You now can use the “simple” version or the “old fashioned” version. Furthermore, being member of Linux Hardcore that also supports the Conky Hardcore! blog, I just had to install and use conky ;-)

Simple CCSM in Karmic Koala

Simple CCSM in Karmic Koala

delicious | digg | reddit | facebook | technorati | stumbleupon | chatintamil

Comments

5 Comments on VirtualBox 3.0 with 3D capabilities on Ubuntu Intrepid

  1. Dustin on Fri, 18th Sep 2009 19:37
  2. Just wondering if you could try downloading the new Alpha 6 and seeing if you can get Compiz to work correctly. Currently I’m unable to seem to get anything besides 800×600 resolution to display and I can’t start from alpha 2 like you did, not offered any more. Any thoughts?

  3. Resa on Fri, 18th Sep 2009 22:11
  4. Hi Dustin,
    I also ran into this issue after performing the upgrades in Alpha 2 as I described just after the text UPDATE July 12, 2009:. I solved it by adding the following at the bottom of the xorg.conf file
    Section "Extensions"
    Option "Composite" "Enable"
    EndSection

    Have you tried this?

  5. Dustin on Fri, 18th Sep 2009 22:32
  6. Yes, when I added that to xorg.conf when booting all I would get was a blank screen. Had to boot in with a live cd and comment out the lines to be able to fix the issue.

    Right now all that is in my xorg.conf is
    Section “Device”
    Identifier “VirtualBox VIdeo Card”
    Driver “vboxvideo”
    EndSection

    But when I try in turn on even desktop affects or change screen resolution I am unable to. That’s why I was wondering if you had tried a fresh install of alpha 6 as you previously had everything functioning in 2 then upgraded. So just wondering if there were some other settings or config files that might have already been set and only the xorg.conf addition was then needed.

    I’ve only been using linux since 8.10 (first one that worked with my wireless card) but wanting to learn

  7. Dustin on Fri, 18th Sep 2009 23:12
  8. Well not sure what change. But I did the partial upgrade that was offered with the system updates. After that I reinstalled VBox guest addtions because it was capturing my mouse as if I didn’t have it installed. Once I did that everything seems to be working just fine.

    Thanks for the pretty quick response. Like the blog also. Read through a bunch of your posts.

  9. Resa on Sat, 19th Sep 2009 13:01
  10. Hi Dustin, upon request ;-)
    I have downloaded the Alpha6 release and tried to get a higher resolution and the 3D capabilities working in VirtualBox.
    Read about my experiences in my blog post Ubuntu 9.10 (Karmic) Alpha6 in VirtualBox 3.0 on Ubuntu Jaunty.

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!