Posts Tagged VirtualBox

How to load VirtualBox driver

If for any reason (for instance Genymotion complaining about not finding VirtualBox) and you need to reload the VirtualBox driver keep in mind that the script that do this has been moved in newest Debian/Ubuntu versions, so if you used to run this:

/etc/init.d/ setup

Now you must reload the module this way:

/usr/lib/virtualbox/ setup


No Comments

Repositories for VirtualBox 4.2.x

VirtualBox 4.2.x

 After the release of VirtualBox 4.2.x versions, I decided to update the repositories on one of the computers at work, which runs Ubuntu 12.04. To do so just put the following into the file /etc/apt/sources.list:

deb precise contrib

After this change you must refresh the package list and update VirtualBox:

aptitude update
aptitude install virtualbox-4.2

Repositories on Debian

For Debian testing (wheezy) and stable  (Squeeze) you must put the following lines:

deb wheezy contrib
deb squeeze contrib non-free

Setting apt-cacher

If you followed the apt-cacher and VirtualBox recipe from this blog, I inform you only the /etc/apt/sources.list file must be edited as explained above, I mean, the apt-cacher server remains unchanged.

Reference: Download VirtualBox for Linux Hosts



Installing VirtualBox Guest Additions on CentOS

VirtualBox CentOS

If for any reason you need to install CentOS on a virtual machine using VirtualBox and you want to take advantage of the extras features provided by the Guest Additions (network and graphic drivers, for enabling full screen and mouse integration options) you can follow these steps::

  • In the virtual machine with CentOS install the needed files for compiling the Guest Additions:
yum install kernel-headers kernel-devel
yum groupinstall "Development Tools"

This will take long because it downloads a lot of packages.

  • Select Guest Additions on VirtualBox menu.

VirtualBox Guest Additions CentOS

On the virtual machine a link will be created to mount the CDROM. Right click on it and choose Mount. Once mounted go to:

cd /media/VBOXADDITIONS_4.1.20_80170/

There run the binary file for Linux installation:


Once it had finished the Guest Additions will be installed on Fedora!

Installing on Red Hat

The above steps are valid for Red Hat, you only need to set a repository from where packages and group of packages will be downloaded.



VirtualBox Guest Addtions on OpenSuse 10.1

OpenSuse logo

A coworker came to me with a virtual machine running OpenSuse 10.1, where she wanted to use one of the VirtuaBox’s Guest Additions features: shared folders. The first thing I detected was it didn’t have the Guest Additions installed, so I proceeded to install them but the VirtualBox’s installing script didn’t compile because all the stuff needed to compile a Linux module was missing. On this article I describe all I had to do to compile the Guest Additions on OpenSUse 10.1.

OpenSuse 10.1 repositories

First I supposed I had to install the kernel sources and the needed compilers, but checking the repositories I realized that it only had as source the installation CD that was used to create the virtual machine.  OpenSuse 10.1 is an old distribution and its repositories are no longer supported officially, so I had to find somebody who had the mirrors published, so I came across to this mirror list. I used the first option and from Software Sources I put the url shown on the picture:

OpenSuse 10.1 - repo

Requisites to compile the Guest Additions

Once the repository was added I proceeded to install the requisites to compile the Guest Additions, begging with the C/C++ tools and compilers. To do so, I went to the OpenSuse’s Control Center, and from Software Management I choose C/C++ compilers and tools option from the selections, as shown in the following image:

C and C++ Compilers and tools

In order to compile the Guest Additions it still left another requisite: the kernel sources. Here I found another problem, because the virtual machine had kernel but the repository didn’t have the sources for that version but the version instead. The solution was to remove the kernel image and use the one provided in the repository, to do so yo can use the Software Management or from a terminal type this:

 zypper remove kernel-default
 zypper install kernel-default

Then you can install the kernel sources:

 zypper install kernel-source kernel-sysm

Once installed all requisites, just run the Guest Additions script from the directory it was mounted:


To changes take effect you must reboot the guest.

Shared folders

You can active the shared folders from VirtualBox’s by going to Device > Shared Folders, and select the one you want to map in the host’s file system. If you check Auto-mount next boot, and for the shown example, a shared folders will appear in /media/Sf_videos

Shared folders



No Comments

Installing Oracle VM VirtualBox Extension Pack

VirtualBox Extensions

Now in VirtualBox 4.x the USB support and other stuff are installed using and extra package called Oracle VM VirtualBox Extension Pack. This move by Oracle lets distribute VirtualBox as software libre, so if commercial software is needed it can be installed as an extension, without GPL license infringements.


Let’s see how to install Oracle VM VirtualBox Extension Pack:

  1. DownloadOracle VM VirtualBox 4.3.28 Extension Pack
  2. Open VirtualBox, then go to  File > Preferences > Extensions  and choose the downloaded file  (see above image).
  3. Add the user to VirtualBox group. On Linux you must add the user who will use VirtualBox to the vboxusers group:
    adduser lgallard vboxusers

    Note: In this example lgallard is the user wichi will use VirtualBox, and for adding users to groups in Linux you must be the system’s administrator (root).

  4. Close the graphical session and log into again to apply changes..

Once it’s done you can use any USB device or the serial port with your virtual machine!!

Old versions

If you need the Extension Packs for older VirtualBox versions, here I leave some:



Enabling USB support for VirtualBox on Linux

VirtualBox Usb List

Even in recent VirtualBox versions the USB support is not enabled by default. Some time ago you needed to edit the /etc/fstab, but all that is in the past. Now just add the user which will be using the USB ports to the vboxuser group:

adduser lgallard vboxusers

To apply changes you must log out and log in to run VirtualBox again.



Repository for VirtualBox 4.x.x

VirtualBox 4.04 update

I had set VirtualBox to download it from Oracle’s repository as a Debian package when upgrading the system. But I opened VirtualBox and got the above message, thing I found odd since it should have automatically updated. Therefore I did a research and found that VirtualBox’s repository changed, before you put into the /etc/apt/sources.list this:

deb squeeze non-free

Now you must put this:

deb squeeze contrib non-free

After this change you must refresh the package list and update VirtualBox:

aptitude update
aptitude install virtualbox-4.1

Setting apt-cacher

If you followed the apt-cacher and VirtualBox recipe from this blog, I inform you only the /etc/apt/sources.list file must be edited as explained above, I mean, the apt-cacher server remains unchanged.

Reference: Download VirtualBox for Linux Hosts


No Comments

Using pipes with VirtualBox’s serial port

OpenWRT VirtualBox terminal

It might happen you need to access virtual machine’ s serial port from VirtualBox, but maybe you don’t want to use the physical device but try to redirect it to a Linux terminal. This can be done from the VirtualBox’s settings and using an application called socat.


  • Install socat:
aptitude install socat
  • Set the serial in the virtual machine by selecting Host Pipe. If the pipe file doesn’t exist, choose Create Pipe:

OpenWRT VirtualBox SERIAL

  • Start the virtual machine.
  • Once started, from a terminal type this:
socat /tmp/openwrt -

In this case, the /tmp/openwrt file is the pipe created by VirtualBox. On the other hand, the character “- ” stands for standard input, and it’s part of socat’s syntax. Then you would be ready to see the serial port from the current terminal. The above example is a virtual machine running OpenWrt, which establishes communication thorough the serial port to manage the system.

, ,


OpenWrt on VirtualBox

OpenWRT VirtualBox

If you are considering to use OpenWrt on your wireless router and you don’t want to flash it over and over or you just want to check out this Linux version for embedded devices, you can download the test image for VirtualBox from the project’s homepage and play around there.

To make it work just follow these steps:

, ,


Virtualbox’s repo publick key


It seems VirtualBox changed its repo publick key (you know, something about Sun becoming Oracle or something like that):

W: GPG error: http://moody lenny Release:
 The following signatures couldn't be verified because
 the public key is not available: NO_PUBKEY 54422A4B98AB5139

I leave here the steps needed to “update” the public key just in case it happens again, or if it happens with another key:

  • List all available keys and copy the one belonging to VirtualBox:
moody:~# apt-key list
pub   1024D/6DFBCBAE 2008-07-14
uid                  Sun Microsystems, Inc. (xVM VirtualBox archive signing key)
sub   2048g/78A86EAF 2008-07-14
  • Delete that key:
moody:~# apt-key del 78A86EAF 6DFBCBAE OK
  • Download the new key:
  • Install the donwloaded key:
moody:~# apt-key add oracle_vbox.asc
  • Finally, update and upgrade the system:
aptitude update
aptitude safe-upgrade

, ,