[Solved] Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Discussions related to using VirtualBox on Linux hosts.
Post Reply
rpyne
Posts: 16
Joined: 5. Jul 2013, 00:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: linux

[Solved] Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by rpyne »

I am trying to do a new install with Centos7.4 headless and VirtualBox 5.2.4. I did the install from yum and added the extension pack without any error messages. but vboxweb-service fails on startup. The only error message I get is:

Code: Select all

# /usr/lib/virtualbox/vboxweb-service.sh start
vboxweb-service.sh: Starting VirtualBox web service.
vboxweb-service.sh: failed: VirtualBox web service failed to start.
Checking /var/log/messages gives only the same messages.

Code: Select all

var/log/vbox-install.log starts with this and then continues to compile modules:

make V=1 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-693.11.1.el7.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0
I see a similar stanza six more times and then the log ends with:

Code: Select all

test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /lib/modules/3.10.0-693.11.1.el7.x86_64/misc
make -f ./scripts/Makefile.modinst
  mkdir -p /lib/modules/3.10.0-693.11.1.el7.x86_64/misc; cp /tmp/vbox.0/vboxpci.ko /lib/modules/3.10.0-693.11.1.el7.x86_64/misc ; true /lib/modules/3.10
.0-693.11.1.el7.x86_64/misc/vboxpci.ko ; perl ./scripts/sign-file "sha256" ./signing_key.priv ./signing_key.x509 /lib/modules/3.10.0-693.11.1.el7.x86_64
/misc/vboxpci.ko || true
Can't read private key
  /bin/sh ./scripts/depmod.sh /sbin/depmod 3.10.0-693.11.1.el7.x86_64 ""
My install process from a clean Centos7 minimal install was:

Code: Select all

yum -y update  
yum -y install epel-release
yum -y install wget net-tools joe atop mlocate tree man man-pages screen unzip
yum -y install ntp
systemctl enable ntpdate.service
systemctl enable ntpd.service
/bin/systemctl start  ntpdate.service
/bin/systemctl start  ntpd.service
reboot
yum -y install httpd mod_ssl
systemctl enable httpd.service
systemctl start httpd.service
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo -P /etc/yum.repos.d/
yum update -y
yum -y groupinstall 'Development Tools' SDL kernel-devel kernel-headers dkms
yum -y install VirtualBox-5.2
/usr/lib/virtualbox/vboxdrv.sh setup
useradd -c"Virtual Box" -m vbox
usermod -a -G vboxusers vbox
passwd vbox
wget http://download.virtualbox.org/virtualbox/5.2.4/Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.vbox-extpack
Any help will be greatly appreciated.
Last edited by rpyne on 2. Jan 2018, 03:48, edited 2 times in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by socratis »

The third part seems to be the relevant one, the other first is the end result message, and the second are "echo" statements. The third part talks about "signing". Are you using secure boot? If so, you got to sign the modules yourself, VirtualBox doesn't sign them.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
rpyne
Posts: 16
Joined: 5. Jul 2013, 00:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: linux

Re: Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by rpyne »

As far as I know, I'm not using secure boot. It looks like the modules are loading, but the vboxweb-service won't start.

Code: Select all

# lsmod | grep vbox
vboxpci                23149  0
vboxnetadp             25813  0
vboxnetflt             27959  0
vboxdrv               480897  3 vboxnetadp,vboxnetflt,vboxpci
Last edited by socratis on 2. Jan 2018, 00:16, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
rpyne
Posts: 16
Joined: 5. Jul 2013, 00:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: linux

Re: [Solved] Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by rpyne »

After many hours of digging, experimenting, and banging my head on the desk, I found what works.

You MUST create the vbox user and create the /etc/defaults/virtualbox file BEFORE installing VirtualBox. Creating them after installing VirtualBox won't work, even if you restart the vbox services or even remove and re-install VirtualBox after creating them.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Solved] Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by socratis »

That sounds like something that should have been done by the installer, no? I'll take a look later today...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
soltaran
Posts: 13
Joined: 28. Nov 2011, 18:33
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Pretty much whatever I fancy!

Re: [Solved] Centos 7.4 headless VB 5.2.4 vboxweb-service fails

Post by soltaran »

I've had a similar problem with VirtualBox 6.0 - on a Clearos 7 box (underlying OS is Centos 7) - but I've found the issue .. at least in my case.
This is also a case where VirtualBox was installed first so I was not willing to rebuild everything(!)

I've been using WinSCP to attach to the machine to create the various files (/etc/default/virtualbox, autostart.cfg) with an external editor (TextPad).
The problem I found was that I could only have a single line in ../../virtualbox - anything more and the service failed to start. I've now discovered that the problem is down to the newline; by default, creating a new file (at least with the external editor/new file function of WinSCP), created a file in DOS format, not UNIX - and it was this that was causing the problem .. the difference in format of newline.

This would work ...

Code: Select all

VBOXWEB_USER=vbox
This wouldn't ...

Code: Select all

VBOXWEB_USER=vbox

My virtualbox file now reads ..

Code: Select all

VBOXWEB_USER=vbox
VBOXWEBAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=autostart.cfg
I changed the format of the file(s) to UNIX, and the service now starts/restarts correctly, although I've yet to check if the autostart now works (the VM I want to autostart is a mail server); at the moment I've been starting it manually.
Post Reply