Image of the glider from the Game of Life by John Conway
Skip to content

VirtualBox OSE on Debian/Ubuntu Linux

Lately, I've been getting quite interested in virtual machines. Namely, Linux/UNIX on Linux. When I got my new T61 laptop, even before, I have been looking forward to virtualizing Linux operating systems. Gentoo, Fedora, OpenSUSE, etc. So, first thing first, find a good virtual machine to run these guests.

I had already known about VirtualBox, so I thought I'd give that a try. To my surprise, VirtualBox OSE was already in the Debian Sid repositories, and it's in Ubuntu Gutsy, so I did an aptitude install, and had it down the pipe and installed on my system in no time flat.

I fired it up. Unfortunately, to my surprise, VirtualBox was complaining that the modules for the kernel were not installed, and that I would not be able to start a virtual guest until they were installed. Bummed, I began searching Google for how to get these modules installed. Again, to my surprise, it was easier than expected. If you're running VirtualBox OSE, and have run into the same issue, which you probably will, here's what you can do on a Debian/Ubuntu system to get VirtualBox and the modules in place:

sudo aptitude install virtualbox-ose virtualbox-ose-source module-assistant
sudo m-a prepare
sudo m-a a-i virtualbox-ose
sudo adduser [user] vboxusers

Now, you should be able to install and run virtual guests with ease. Currently, I hawe Fedora Core 6 installed (for RHEL 5 instruction and learning) and Gentoo (although I'm currently faced with a kernel panic). Future guests will most likely include Open|FreeBSD, OpenSUSE, Ubuntu and OpenSolaris. I can run them simultaneously, although that might be a bit of a resource hog, or one at a time.

The only hiccups that I currently face with this setup, is getting bridged networking functional. I should be able to ping the guest from the host, and ping the host from the guest. Currently, I can only do the latter and not the former. Also, I have installed the guest additions, but I seem to not be able to run a guest at higher than 1024x768. Seeing as though I have 1680x1050, it would be nice to utilize full screen, but it's not working for me, even with Host+G. I'm sure I'll figure it out.

{ 12 } Comments

  1. cpradio | October 6, 2007 at 8:34 am | Permalink

    I am in the same situation and settled on VMWare as I could then run it as a server on a spare machine and use VMWare Server Console on my other machines to connect to the Server from anywhere.

    If Virtual Box has that solution, I missed it and need to give it another try, but without being able to remotely connect to my Virtual Machine, it just doesn't fit my needs.

    Have you had any such luck with Virtual Box to get it to act like a Virtual Server?

  2. Paul Cartwright | October 6, 2007 at 10:20 am | Permalink

    didn't work for me, running Debian Etch:
    # sudo aptitude install virtualbox-ose virtualbox-ose-source module-assistant
    Reading package lists... Done
    Building dependency tree... Done
    Reading extended state information
    Initializing package states... Done
    Reading task descriptions... Done
    Building tag database... Done
    Couldn't find any package whose name or description matched "virtualbox-ose"
    Couldn't find any package whose name or description matched "virtualbox-ose-source"
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0B of archives. After unpacking 0B will be used.
    Writing extended state information... Done

  3. Shane Par-Due | October 6, 2007 at 10:54 am | Permalink

    I have really enjoyed using Virtualbox as well, but like you..I ran into the bridged network issue. If I could get that resolved, I would have no need for VMware Server anymore!

  4. Derek Buranen | October 6, 2007 at 10:56 am | Permalink

    Did you get USB support to work? I don't think it's in the -ose version, but in the puel version. I had it working in Feisty days with 1.4, but 1.5 and gutsy don't seem to like the USB. Just curious if you've had experience. (My windows mobile phone is dying for USB support)

  5. Shane Par-Due | October 6, 2007 at 11:03 am | Permalink

    Derek, even on the puel version, my windows mobile phone wouldn't authenticate with vista's mobile device utility. It would show it as a connected usb device and even installed the drivers just fine, but it couldn't sync.

    Good luck! hehe

  6. Aaron | October 6, 2007 at 12:17 pm | Permalink

    @Paul- Currently, it's only in Debian Sid. It hasn't reached testing or stable yet.

    @Shane- I'll keep my readers posted if I make any progress on that.

    @Derek- USB, apparently, is only supported in the PUEL version, which is rather unfortunate. I can't mount block devices via USB, but plugging in USB input devices, such as keyboards and mice seem to work fine. Hopefully, they will remove this cripple-ware from the OSE.

  7. estama | October 6, 2007 at 5:26 pm | Permalink

    -About the not being able to up the resolution in the guest. Do the math res_x*res_y*bytes_per_pixel and change the virtual Graphic Card's memory to something larger than that.
    -About the bridging. I don't like bridging. What i do is to redirect the ports i want from the host to the guest (while in NAT mode). Download the manual and see how it is done.

  8. Karl Bowden | October 8, 2007 at 1:16 am | Permalink

    Hey Aaron,
    parprouted is what you need for easy network bridging.
    It is very usefull on laptops where you want to bridge a virtual machine that you want to answer pings on a wireless interface.
    I'll have to start working on a parprouted guide. Dont know where to put the guide once i finish it though.

  9. Elmar Zeeb | October 23, 2007 at 8:45 am | Permalink

    I'm running virtual box with bridged networking partially working.

    this is the corresponding part of my /etc/network/interfaces:

    iface eth0 inet dhcp
            pre-up /sbin/ifconfig eth0br down
            pre-up /usr/sbin/brctl addbr eth0
            pre-up /usr/sbin/brctl setfd eth0 1
            pre-up /usr/sbin/brctl addif eth0 eth0br
            pre-up /sbin/ifconfig eth0 up
            pre-up /usr/sbin/tunctl -t tap0 -u elmex
            pre-up /usr/sbin/brctl addif eth0 tap0
            pre-up /sbin/ifconfig tap0 up
            pre-up /sbin/ifconfig eth0br up
            post-down /sbin/ifconfig tap0 down
            post-down /sbin/ifconfig eth0 down
            post-down /sbin/ifconfig eth0br down
            post-down /usr/sbin/brctl delif eth0 eth0br
            post-down /usr/sbin/brctl delif eth0 tap0
            post-down /usr/sbin/brctl delbr eth0
            post-down /usr/sbin/tunctl -d tap0

    i also renamed the eth0 device to eth0br so the bridge can be named eth0.

    In feisty this can be done in /etc/iftab in gutsy in /etc/udev/rules.d/70-persistent-net.rules

    this worked without problems in feisty but was broken after a update about 3 weeks ago or so. the same problem with gutsy. It only works one time (after reboot). There must be some problems with access rights of the tap or tun device.


  10. Elmar Zeeb | October 24, 2007 at 4:18 am | Permalink

    if you remove the

           pre-up /sbin/ifconfig tap0 up

    and the

            post-down /sbin/ifconfig tap0 down

    lines and do a
    sudo /sbin/ifconfig tap0 up
    before and a
    sudo /sbin/ifconfig tap0 down
    after starting the virtual machine, its working. This could also be done in a more automated way but its working!


  11. Anith | February 7, 2008 at 4:27 am | Permalink


    Here the trick to make Vbox fullscreen and to get all features working...

    Install VirtualBox Guest Additions

    The Guest Additions package installs some add-ons into the Guest OS. The most noticeable of these is Mouse Integration which allows the mouse to function without the need to ‘lock’ it into the VM. I also believe that the Guest Additions install special display drivers. This is important if you want your VirtualBox to run in higher resolutions. I pulled these instructions from the official VirtualBox documentation. It’s a PDF. I don’t know why. They also want you to run the script with sh but why bother?

    In the Guest window, that is, the window that is displaying your Guest OS, do Devices -> Install Guest Additions. VirtualBox will prompt you to download the .iso if you haven’t already. After the download finishes you will be prompted to mount the ISO in your VM. Say yes. Run this on the command line of the Guest OS.

    sudo /media/cdrom0/

    The VirtualBox documentation says you can choose which drivers you want to install. If you’re interested in this take a look at sudo /media/cdrom0/ help

    I shut down the Guest OS and took a snapshot at this point. I planned on fiddling with Xorg configurations next and it is much easier to load up a VM snapshot than it is to restore a backup xorg.conf.
    Change the VirtualBox Resolution

    After my Ubuntu install, Xorg was configured to only support 800×600. This was way too small for me. My main machine is a widescreen laptop running at 1680×1050. I want two options.

    * 1024×768 for running VirtualBox windowed
    * 1680×1050 for running VirtualBox fullscreen

    The VirtualBox documentation has the following to say about running higher resolutions in your VM (page 50 if you’re curious)

    VirtualBox can use any default X graphics mode which fits into the virtual video memory allocated to the virtual machine, as described in chapter 3.7.1, General settings, page 37. You can also add your own modes to the X server configuration file. You simply need to add them to the “Modes” list in the “Display” subsection of the “Screen” section.

    In your Guest OS, edit your xorg.conf file by running sudo gedit /etc/X11/xorg.conf. Here is what I ended up with.

    Section "Screen"
    Identifier "Default Screen"
    Device "Generic Video Card"
    Monitor "Generic Monitor"
    DefaultDepth 24
    SubSection "Display"
    Modes "1680x1050" "1024x768" "800x600"

    I rebooted to make sure things worked. I then shut down the Guest OS and took another snapshot.

    I am not an Xorg expert. I found if I listed 1680×1050 first Ubuntu’s login screen would be 1680×1050. After logging into my user account I was able to do System -> Preferences -> Screen Resolution and change to 1024×768 without problems. If instead I listed 1024×768 first Ubuntu’s login screen would be 1024×768. After logging in if I attempted to change the Screen Resolution to 1680×1050 (I believe) the horizontal sync would be set incorrectly. By this I mean I couldn’t see jack. I tried figuring out a way to have the default be 1024×768 with the option of switching to 1680×1050, but after an hour of tweaking I gave up. If you are more familiar with Xorg and know what I’m doing wrong, please leave a comment.

    * The Ubuntu install DVD decided that the VM’s max resolution should be 800×600. This, hilariously, is too small to click on the Forward and Ok buttons in the install wizard. I had to figure out that Alt-F went forward in the dialogs. The final dialog needed an Enter to start the install.
    * As of this writing, the version of VirtualBox that is installed by virtualbox-ose is 1.5.0.

    $ dpkg-query --show virtualbox-ose
    virtualbox-ose 1.5.0-dfsg2-1ubuntu3

    It looks like the Ubuntu guys are currently working on getting a VirtualBox 1.5.4 package up. I suppose if you really wanted to, you could install VirtualBox 1.5.4 from source. I found this guide to install from source, but didn’t bother with it.
    * I still need to figure out how VirtualBox network bridging works. My VM does have net access because it is able to download packages from online repositories with apt-get. At the same time I couldn’t do something simple like ping my web server. Apparently this is expected. Page 58 of the VirtualBox documentation says: Please note that the ping utility does not work over NAT. There is another option, host interface networking, that might give me more control over the VM’s networking.



  12. ghost | July 30, 2008 at 9:40 pm | Permalink

    If I remember right the OSE version does not have usb devices. You need to install the regular version.

{ 1 } Trackback

  1. [...] di Ubuntu Gutsy possono usare la stessa procedura descritta qui come evidenzia in questo post Aaron Toponce. Tags:Debian, Linux, Macchine, OpenSource, OS, Virtualbox, [...]

Post a Comment

Your email is never published nor shared.