1

I'm trying to install VirtualBox (the host, not the client) on a clean install of Alpine 3.8.0 Standard. I'm using VirtualBox-5.2.12-122591-Linux_amd64.run, downloaded from http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html under Linux Platforms > All distributions > 64-bit.

The installer has reported various errors, which so far I've resolved by installing the following packages.

  • coreutils (to get readlink with the -e flag available)
  • make
  • gcc
  • perl
  • linux-headers (this was probably not needed)
  • linux-vanilla-dev

The installer also reported:

/opt/VirtualBox/vboxdrv.sh line 501: can't create /etc/udev/rules.d/60-vboxdrv.rules: \
nonexistent directory.

Which I resolved by simply running:

mkdir -p /etc/udev/rules.d

Each time the installer fails, it says to run /sbin/vboxconfig to restart the setup process. Currently, when I do so, it outputs:

* service vboxdrv added to runlevel default
* service vboxballoonctrl-service added to runlevel default
* service vboxautostart-service added to runlevel default
* service vboxweb-service added to runlevel default
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
There were problems setting up VirtualBox.  To re-start the set-up process, run \
/sbin/vboxconfig as root.

/var/log/vbox-install.log contains:

make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.14.52-0-vanilla/build SUBDIRS=/tmp/vbox.0 \
SRCROOT=/tmp/vbox.0 -j1 modules
getconf: LFS_CFLAGS: unknown variable
getconf: LFS_LDFLAGS: unknown variable
getconf: LFS_LIBS: unknown variable
Makefile:948: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install \
libelf-dev, libelf-devel or elfutils-libelf-devel."  Stop.
make: *** [/tmp/vbox.0/Makefile.include.footer:101: vboxdrv] Error 2

I am not able to resolve the problem even by installing libelf-dev. Per https://pkgs.alpinelinux.org/packages, there is no libelf-devel or elfutils-libelf-devel package.

Separately, I can't seem to have elfutils-dev and libelf-dev installed at the same time. If I install one and then the other, apk outputs:

ERROR: elfutils-dev-0.168-r1: trying to overwrite usr/lib/libelf.so owned by \
libelf-dev-0.8.13-r3.
ERROR: elfutils-dev-0.168-r1: trying to overwrite usr/lib/libelf.a owned by \
libelf-dev-0.8.13-r3.
ERROR: elfutils-dev-0.168-r1: trying to overwrite usr/include/libelf.h owned by \
libelf-dev-0.8.13-r3.
ERROR: elfutils-dev-0.168-r1: trying to overwrite usr/include/gelf.h owned by \
libelf-dev-0.8.13-r3.
ERROR: elfutils-dev-0.168-r1: trying to overwrite usr/include/nlist.h owned by \
libelf-dev-0.8.13-r3.

That's an issue because elfutils-dev is required by linux-vanilla-dev, which in turn seems to be required by /sbin/vboxconfig. If I run /sbin/vboxconfig without linux-vanilla-dev installed, it outputs:

...
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel for adding new \
hardware support to the system.

To try to resolve this, I:

  1. Uninstalled linux-vanilla-dev.
  2. Installed libelf-dev.
  3. Reinstalled linux-vanilla-dev.

linux-vanilla-dev and all its dependencies installed successfully, except for elfutils-dev, as expected. I'm not aware of any issues caused by not having elfutils-dev installed, and I assume having libelf-dev installed is more important, since that's the package referred to in the error message in /var/log/vbox-install.log.

Nonetheless, when I run /sbin/vboxconfig, vboxdrv.sh still fails with "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel." This despite that I have libelf-dev installed (or so I believe).

Running:

apk info | grep 'libelf-dev'

Outputs:

libelf-dev

Running apk fix causes apk to try to reinstall elfutils-dev, which fails (for reasons described previously), but reports no other problems.

I downloaded VirtualBox-5.2.12-122591-Linux_amd64.run to a Windows box and opened it up with 7-Zip and extracted postinst-common.sh (which I believe is the same file as /sbin/vboxconfig) and vboxdrv.sh. I don't see a way to attach them, but I can append their contents (about 600 lines total) if anyone feels it would be helpful.

Please let me know if I can provide any additional information. I'm still working on this so if I learn more I'll add it. My current next steps are:

  1. Investigate vboxdrv.sh to see if I can find what it does to trigger that error.
  2. Try using strace.

Thank you!

Edit:

  • "If you want to run glibc programs in Alpine Linux, there are a few ways of doing so. You could install glibc as additional to uclibc (you would have to do this manually), or you could do it the easy way and use a chroot." – Rui F Ribeiro Jul 12 '18 at 7:27
  • @RuiFRibeiro Thank you for your reply. If I understand correctly, you're saying I need glibc instead of the built-in musl libc. I installed a glibc package by following the instructions at: github.com/sgerrand/alpine-pkg-glibc. However I'm still getting the same result when I try to install VirtualBox. It could be that I need to tell Alpine to use glibc, or it could be something else. I'll keep investigating. – FSharpN00b Jul 13 '18 at 5:51
  • At the end of the day, when installing all the dependencies, you might ended with something similar ton size to Ubuntu or Debian with much more work. Why Alpine? – Rui F Ribeiro Jul 13 '18 at 11:16
  • 1
    Thank you, I've been playing with antix and void. Having good luck with void so far. Tried a couple of different glibc packages for Alpine but no change in behavior with either. – FSharpN00b Jul 18 '18 at 7:19
  • 1
    Have you tried apk add musl-dev? – ngreen Sep 27 '18 at 19:54
1

try to install : apk add g++

its install next pakages:

(1/3) Installing musl-dev (1.1.20-r0) (2/3) Installing libc-dev (0.7.1-r0) (3/3) Installing g++ (6.4.0-r8)

after install pakages,try run VirtualBox installation script again

  • This actually worked for me when compiling a module, whereas before I was getting Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y when compiling a kernel module. I think apk add libc-dev is sufficient. – ngreen Sep 13 '18 at 15:55
1

TLDR; you need to install musl-dev.

I was building a kernel module and got the same error message (Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y). All I needed to do was run apk add musl-dev to get it to compile. The suggested fix (whether by make or gcc I do not know) is wrong and wasted your time and mine. The proper elf dependencies are already specified by the kernel -dev packages (e.g. linux-virt-dev or linux-vanilla-dev).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.