1

I am trying to install VirtualBox 5.0 on a minimal (terminal only) CentOS 7 server, but I keep getting the following error when I type service vboxdrv setup:

The service command supports only basic LSB actions (start, stop,  
restart, try-restart, reload, force-reload, status). For other  
actions, please try to use systemctl.

STEPS LEADING UP TO THE ERROR:


The complete set of steps leading up to the error is as follows:

vi /etc/yum.repos.d/virtualbox.repo

Add the following text, then save and exit:

[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch – VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc

Then at command prompt type:

# rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# yum install gcc make patch  dkms qt libgomp 
# yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
...
Complete!  
# cd /usr/src/kernels
# ls –al
total 12
drwxr-xr-x.  3 root root 4096 Sep 25 16:14 .
drwxr-xr-x.  4 root root 4096 Sep 25 14:17 ..
drwxr-xr-x. 22 root root 4096 Sep 25 16:14 3.10.0-229.14.1.el7.x86_64
# export KERN_DIR=/usr/src/kernels/3.10.0-229.14.1.el7.x86_64
# yum install VirtualBox-5.0
...
Complete!  
#  yum install "kernel-devel-uname-r == $(uname -r)"
#  setenforce Permissive
# service vboxdrv setup
The service command supports only basic LSB actions (start, stop,  
restart, try-restart, reload, force-reload, status). For other  
actions, please try to use systemctl.

Note that I get the same error when running the command as a non-root user that has been added to the vboxusers group.

How can I resolve this error?

As per @MarkPlotnick's suggestion, I tried the following, but got a different error:

[root@localhost kernels]# /etc/init.d/vboxdrv setup
-bash: /etc/init.d/vboxdrv: No such file or directory
[root@localhost kernels]# -I /etc/init.d/vboxdrv setup
-bash: -I: command not found
[root@localhost kernels]# cd /etc/init.d
[root@localhost init.d]# ls -al
total 40
drwxr-xr-x.  2 root root  4096 Oct  2 12:32 .
drwxr-xr-x. 10 root root  4096 Oct  2 12:32 ..
-rw-r--r--.  1 root root 13430 Jan 15  2015 functions
-rwxr-xr-x.  1 root root  2989 Jan 15  2015 netconsole
-rwxr-xr-x.  1 root root  6470 Jan 15  2015 network
-rw-r--r--.  1 root root  1160 Sep 15 06:21 README
[root@localhost init.d]# 
  • Does sudo -i /etc/init.d/vboxdrv setup work? That's about all the old service command would have done. – Mark Plotnick Oct 2 '15 at 20:57
  • @MarkPlotnick No it does not. Please see the terminal output from your suggestions, which I just added to the end of my OP. – CodeMed Oct 2 '15 at 21:03
  • What are you trying to do? What do you think service vboxdrv setup should do and what made you think that? Complaining about setup not being a valid parameter is the behavior that I expect. – Gilles 'SO- stop being evil' Oct 2 '15 at 22:54
  • @Gilles I am trying to install virtualbox in a terminal-only installation of CentOS 7. These steps worked in my previous attempt a couple days ago. The steps are my documentation of the result of trial an error using several tutorials which each threw errors, and then my research of each error. I am trying to document reproduceable steps for installing virtualbox on a minimal, terminal-only, installation of CentOS 7. – CodeMed Oct 2 '15 at 22:59
  • Why aren't you using yum install virtualbox (or whatever the package is called on CentOS)? I suspect that you made a mistake when recording your previous attempt, you probably ran some other script with the setup argument. – Gilles 'SO- stop being evil' Oct 3 '15 at 11:27
2

Possible solution: /usr/lib/virtualbox/vboxdrv.sh setup

This issue seems to come with the most recent VirtualBox-5.0-5.0.6_103037_el7 install/update (this is part of the yum update from 5.0.4 -> 5.0.6:

Cleanup    : VirtualBox-5.0-5.0.4_102546_el7-1.x86_64                                                                                       18/18 
warning: file /etc/rc.d/init.d/vboxweb-service: remove failed: No such file or directory

warning: file /etc/rc.d/init.d/vboxdrv: remove failed: No such file or directory

warning: file /etc/rc.d/init.d/vboxballoonctrl-service: remove failed: No such file or directory

warning: file /etc/rc.d/init.d/vboxautostart-service: remove failed: No such file or directory
  • CentOS 7.6 (/usr/src/kernels/3.10.0-957.1.3.el7.x86_64) VirtualBox-5.2-5.2.24_128163_el7-1.x86_64 sudo /usr/lib/virtualbox/vboxdrv.sh setup Seems to handle it just fine. – DeanM Jan 25 '19 at 17:45

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.