ArchLinux: VirtualBox Issues

Recently, ArchLinux development community have confirmed (again) that they stick hard to the announced KISS (keep it simple stupid) strategy except for, the “simple” part…

Introduction

Many times throughout the history, ArchLinux user’s have been “suprised” by undocumented changes within the system which sometimes ended up with broken software or the whole system. Therefore, one can sometimes feel that being an ArchLinux user requires some kind of a sixth sense (an oracle?) in what the hack is running through the developers’ heads.

VirtualBox and DKMS

The recent undocument issue is with VirtualBox which suddenly requires to replace precompiled binary drivers virtualbox-host-modules with community/virtualbox-host-dkms.

:: Replace virtualbox-host-modules with community/virtualbox-host-dkms? [Y/n]

As per the long-time experience described above, no reason for this action has been provided whatsover (no official pages, no wiki, nil). The developers “defend” themselves that The lesson here is that it is always important to look at pacman’s output.. Obviously, most of the users wish there were some relevant and meaningful output though, since it weren’t (from their perspective of course). (Great comment: oconnor663)

Anyways, to cut the story short. The missing link is linux-headers package which is an optional dependency and which is necessary in order to automatically compile the VirtualBox modules against the distro’s default linux kernel. Obviously, this cannot be a “hard” VirtualBox’s dependency since different user’s do use different kernels. Hence they require different (custom) headers for their custom kernels.

Solution

Considering that the binary module packages are installed, i.e. virtualbox-host-modules or virtualbox-guest-modules, these need to be removed by:

pacman -R virtualbox-host-modules virtualbox-guest-modules

Verification that the complementary DKMS package(s) is(are) installed:

pacman -S virtualbox-host-dkms virtualbox-guest-dkms

And finally, the headers (for the default kernel):

pacman -S linux-headers
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-headers-4.4.3-1

Total Installed Size:  33.61 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                           [########################################] 100%
(1/1) checking package integrity                                         [########################################] 100%
(1/1) loading package files                                              [########################################] 100%
(1/1) checking for file conflicts                                        [########################################] 100%
(1/1) checking available disk space                                      [########################################] 100%
:: Processing package changes...
(1/1) installing linux-headers                                           [########################################] 100%
:: Running post-transaction hooks...
(1/1) Install DKMS modules

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make KERNELRELEASE=4.4.3-1-ARCH -C /usr/lib/modules/4.4.3-1-ARCH/build M=/var/lib/dkms/vboxguest/5.0.14_OSE/build................
cleaning build area...
Kernel cleanup unnecessary for this kernel.  Skipping...

DKMS: build completed.

vboxguest.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/4.4.3-1-ARCH/kernel/misc/

vboxsf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/4.4.3-1-ARCH/kernel/misc/

vboxvideo.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/4.4.3-1-ARCH/kernel/misc/

depmod...

DKMS: install completed.

Creating symlink /var/lib/dkms/vboxhost/5.0.14_OSE/source ->
                 /usr/src/vboxhost-5.0.14_OSE

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make KERNELRELEASE=4.4.3-1-ARCH -C /usr/lib/modules/4.4.3-1-ARCH/build M=/var/lib/dkms/vboxhost/5.0.14_OSE/build......

Now, it is necessary to load (or reload) the kernel modules either by restarting the computer or using modprobe command (depending on which modules are required), e.g.:

rmmod vboxpci
rmmod vboxnetflt
rmmod vboxnetadp
rmmod vboxdrv
modprobe vboxdrv
modprobe vboxnetadp
modprobe vboxnetflt
modprobe vboxpci

That’s it…

Drawbacks

Some users may have built their ArchLinux-based servers in the real KISS minimalistic way. Due to this “free-cool-in” feature, they are forced to install kernel-headers and other development tools (GCC compiler and all that stuff) though. As a result, the total consumed disk space even doubles (depending on the installation of course).

Considering kernel updates come approximately once in a week, removing gcc and make tools everytime after the modules are compiled is not a KISS solution. Actually, it’s a KIS solution where the “S” for “simple” is absent…

Arch Linux is a tough playground. Beware, behold and KISS!

Advertisements
This entry was posted in Linux, Server and tagged , , , . Bookmark the permalink.