How to fix Virtual Box under Open Suse

After an upgrade to Open Suse 13.1, I noticed Virtual Box started throwing multiple errors, mainly with not being able to initialize some virtual interface or other, all the way to stuff such as the following:

Failed to open a session for the virtual machine Windows_7.

Unable to load R3 module /usr/lib/virtualbox/ (VBoxDD): /usr/lib/virtualbox/ undefined symbol: VDAsyncDiscardRanges (VERR_FILE_NOT_FOUND).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

Ooops! What could be wrong? And this is fairly important, since I use Virtual Box to run MS Windows (yuk) to connect to the corporate Exchange server (yuk again).

Turns out, the solution is fairly simple: upgrading Open Suse to 13.1 completely breaks the installed Virtual Box packages. The solution is simply to remove them, and install the latest and greatest Virtual Box program from the Oracle web site.

Here is how to do this:

1. Display and remove your Virtual Box packages:

Easy as:

# rpm -qa | grep virtualbox

On a fairly standard Open Suse installation, this yields a lit of about 6 to 8 packages. For instance:

# rpm -qa | grep virtualbox

Remove all these packages, for instance:

# rpm -vv -e --nodeps virtualbox-host-kmp-desktop-4.2.18_k3.11.6_4-2.5.1.x86_64 \
virtualbox-guest-kmp-desktop-4.2.18_k3.11.6_4-2.5.1.x86_64 \
python-virtualbox-4.2.18-2.5.1.x86_64 \

Re-check the list of packages to make sure everything is uninstalled and proceed to the next step...

2. Configure the Oracle Virtual Box repository:

The instructions for this are on the Oracle Virtual Box web site referenced below.

It basically boils down to this:

As simple as:

# wget -q
# rpm --import oracle_vbox.asc

Add the following file to the /etc/zypp/repos.d directory:

name=VirtualBox for openSUSE 12.3

Now check the configuration with:

# zypper lr
#  | Alias                     | Name                               | Enabled | Refresh
 1 | Packman Repository        | Packman Repository                 | Yes     | Yes    
 2 | libdvdcss repository      | libdvdcss repository               | Yes     | Yes    
 3 | openSUSE-13.1-1.10        | openSUSE-13.1-1.10                 | No      | No     
 4 | repo-debug                | openSUSE-13.1-Debug                | No      | Yes    
 5 | repo-debug-update         | openSUSE-13.1-Update-Debug         | No      | Yes    
 6 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No      | Yes    
 7 | repo-non-oss              | openSUSE-13.1-Non-Oss              | Yes     | Yes    
 8 | repo-oss                  | openSUSE-13.1-Oss                  | Yes     | Yes    
 9 | repo-source               | openSUSE-13.1-Source               | No      | Yes    
10 | repo-update               | openSUSE-13.1-Update               | Yes     | Yes    
11 | repo-update-non-oss       | openSUSE-13.1-Update-Non-Oss       | Yes     | Yes    
12 | virtualbox                | VirtualBox for openSUSE 12.3       | Yes     | Yes    <--- yup, it's added!

3. Install Virtual Box from the Oracle repository:

Again, that's easy enough with the help of the zypper command:

# zypper search VirtualBox

PLEASE NOTE: the Oracle Virtual Box is named VirtualBox!! - the upper-case letters help differentiate it from the Open Suse virtualbox packages!! Make sure you include the upper-case letters!

The search command should return a list of exactly one package - the one you want to install, with the following command:

# zypper install VirtualBox-4.3

Just to make sure everything works as advertised, enter:

# ldconfig

(The above step is optional, but cannot hurt)

If you have followed the steps shown above, you should now have a functional Virtual Box running on Open Suse! Congratulations!

PLEASE NOTE: If you run zypper ve, in order to solve dependencies problems, please be aware that zypper will offer to re-install all the Open Suse Virtual Box packages! Don't do that unless you want to break the Oracle version!!

For instance:

# zypper ve
Loading repository data...
Reading installed packages...

The following NEW packages are going to be installed:
  python-virtualbox virtualbox virtualbox-guest-kmp-desktop virtualbox-host-kmp-desktop 

4 new packages to install.
Overall download size: 13.5 MiB. After the operation, additional 31.6 MiB will be used.
Some of the dependencies of installed packages are broken. In order to fix these dependencies, the following actions need to be taken:
Continue? [y/n/? shows all options] (y): n

Again, this is a tricky situation, but one that is probably not necessary on a stable machine. Just be aware of the risk.

See Also: