Installing VirtualBox on Slackware 14.2 64-bit multilib

July 28, 2016

This is a quick tutorial on installing the latest VirtualBox on Slackware 14.2 64-bit multilib. In Slackware parlance, multilib is a mixed environment with 64-bit and 32-bit libraries, allowing you to run 32-bit programs (e.g. Skype) on 64-bit Slackware.

In the past, VirtualBox was one of the reasons why you had to have multilib version, but these days this is not necessary as Oracle already ships 64-bit VirtualBox binaries.

I sit down to write this tutorial for two reasons:

  1. I lost almost two days figuring out why my Slackware upgrade to 14.2 broke VirtualBox installation beyond repair.
  2. Online help is pretty much useless - many guides are based purely on luck or steps I find a bit odd.

This tutorial also can be applied on pure Slackware 64-bit system, although I haven't tested it.

Assuming you have a working Slackware system, head to VirtualBox for Linux Hosts and choose All distributions (built on EL5 and therefore do not require recent system libraries), AMD64 version.

After you downloaded the installer, first take some preparation steps:

  1. Make sure you have installed kernel source (located in /usr/src/linux-X.X.X, where X.X.X is your running kernel version).
  2. Copy /boot/config-type-X.X.X to /usr/src/linux-X.X.X/.config. type is your running kernel type and Slackware comes with either generic or huge kernels. Do not skip this step, since Slackware ships kernel source with 32-bit configuration.
  3. Inside kernel source folder (/usr/src/linux-X.X.X/) type:
$ make prepare && make modules_prepare

This should create proper kernel configuration for 64-bit system and setup tools for building modules.

Now you can run VirtualBox installer. If installer fails, it will write detail report in /var/log/vbox-install.log and if you happen to have errors like this:

...
/tmp/vbox.0/include/iprt/types.h:231:9: error: unknown type name ‘__uint128_t’
 typedef __uint128_t uint128_t;
         ^
In file included from /tmp/vbox.0/include/VBox/types.h:30:0,
                 from /tmp/vbox.0/SUPDrvInternal.h:35,
                 from /tmp/vbox.0/SUPDrv.c:33:
/tmp/vbox.0/include/iprt/types.h:231:9: error: unknown type name ‘__uint128_t’
 typedef __uint128_t uint128_t;
         ^
...

it means you haven't done step 2 properly. __uint128_t type is not recognized by gcc on 32-bit platforms and your kernel configuration somehow assumes you are on that platform.

That should be it, short and sweet.