Error on installation of Virtualbox 5.0.12 on Debian 8

Discussions related to using VirtualBox on Linux hosts.
Post Reply
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

Hello,

I want to install Oracle Virtualbox 5.0.12 on Debian 8 "jessie", mainly to get a feel of Oracle Solaris 11.
So I followed the instructions in the Virtualbox Linux_Downloads webpage to add the repository in /etc/apt/sources.list and the public key.
The first time I installed it, I encountered the following two errors:
(1) /usr/lib/virtualbox/vboxdrv.sh: line 85: /etc/init.d/functions: No such file or directory
(2) ln: target ‘setup’ is not a directory

To fix error (1), I renamed /etc/redhat-release to /etc/redhat-release.fake
Then I purged the package "virtualbox-5.0" and installed it again. This time, I still see error (2).
The installation run is as follows:

Code: Select all

root# apt-get install virtualbox-5.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  linux-headers
The following NEW packages will be installed:
  virtualbox-5.0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/63.8 MB of archives.
After this operation, 155 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package virtualbox-5.0.
(Reading database ... 217108 files and directories currently installed.)
Preparing to unpack .../virtualbox-5.0_5.0.12-104815~Debian~jessie_amd64.deb ...
Unpacking virtualbox-5.0 (5.0.12-104815~Debian~jessie) ...
Processing triggers for systemd (215-17+deb8u2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for shared-mime-info (1.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.58) ...
Setting up virtualbox-5.0 (5.0.12-104815~Debian~jessie) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.
ln: target ‘setup’ is not a directory
root# 
The message "addgroup: ... Exiting" is because (I think) it created an entry for vboxusers in /etc/group the first time and "apt-get purge" doesn't remove that entry.

My questions:
(1) Has anyone encountered the error in the last line? Any idea what causes it or how to fix it?
(2) I can see the "Oracle VM Virtualbox" menu item and the empty initial screen. Can I ignore the error message and go ahead an install Oracle Solaris 11?

I have some experience with Fedora Linux and have only started dabbling with Debian 8 since the past few weeks.
I have no prior experience with Oracle Virtualbox.

Thank you for any assistance.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by loukingjr »

virtualbox_neophyte wrote:Hello,

I want to install Oracle Virtualbox 5.0.12 on Debian 8 "jessie", mainly to get a feel of Oracle Solaris 11.

To fix error (1), I renamed /etc/redhat-release to /etc/redhat-release.fake
Why would you have /etc/redhat-release in a Debian Jessie release at all????
With the VM fully shut down, right click its icon in the VirtualBox Manager, select "Show Log" and save "VBox.log" to a zip file. Attach the zip here.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

vbox_screenshot.png.zip
Screenshot of the Virtualbox
(72.5 KiB) Downloaded 16 times
I had /etc/redhat-release in my Debian OS because I had created it myself a few weeks ago while installing Oracle 12c database.
Creating that file is one of the many "hacks" (mentioned in many blogs online) that tricks the Oracle installer into thinking that the base OS is a RedHat variant.
Otherwise, the Oracle installer exits quickly with an error message.
I should've renamed it right after I had finished installing Oracle 12c.

About your 2nd question, I don't see any icon of a VM in the VirtualBox Manager.
I don't see any "Show Log" by clicking anywhere in there.
I've attached a screenshot of the VirtualBox Manager.
Last edited by virtualbox_neophyte on 30. Dec 2015, 03:44, edited 1 time in total.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by loukingjr »

You actually wouldn't until you install a guest. That was my fault. But if you can run VirtualBox and see the VirtualBox Manager as apparently you do based on the screenshot, what is the problem you are having? Can you not create a guest?
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by loukingjr »

(2) I can see the "Oracle VM Virtualbox" menu item and the empty initial screen. Can I ignore the error message and go ahead an install Oracle Solaris 11?
Sorry missed this question. The answer is yes.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

Thanks, loukingjr.
Any idea what that error message in the last line:

Code: Select all

ln: target ‘setup’ is not a directory
is about?
Looks like it was trying to create a link or symbolic link and couldn't find a directory called "setup"(?)
I guess I was hoping for a clean install.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by loukingjr »

I have no Debian hosts, just guests. So I don't know. One of the Linux gurus might.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by Perryg »

I would download the package direct from virtualbox.org and not use the repo to install it. Just use gdebi or dpkg. Probably have a better experience.
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

I executed "apt-get purge virtualbox-5.0", downloaded the deb package, confirmed the sha256 value and then tried installing with dpkg, but the link error still shows up.
Although it's not at the end now.

Code: Select all

root# 
root# sha256sum virtualbox*.deb
f99e9e38902ee8a0e28e96d098d7d89680ae8cfa5009252b4717322101b6cb79  virtualbox-5.0_5.0.12-104815-Debian-jessie_amd64.deb
root# 
root# dpkg -i virtualbox-5.0_5.0.12-104815-Debian-jessie_amd64.deb
Selecting previously unselected package virtualbox-5.0.
(Reading database ... 217108 files and directories currently installed.)
Preparing to unpack virtualbox-5.0_5.0.12-104815-Debian-jessie_amd64.deb ...
Unpacking virtualbox-5.0 (5.0.12-104815~Debian~jessie) ...
Setting up virtualbox-5.0 (5.0.12-104815~Debian~jessie) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.
ln: target ‘setup’ is not a directory
Processing triggers for systemd (215-17+deb8u2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for shared-mime-info (1.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.58) ...
root# 
The install log file at /var/log looks good.

Code: Select all

root# 
root# cat /var/log/vbox-install.log
Uninstalling modules from DKMS
Attempting to install using DKMS

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

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.16.0-4-amd64 -C /lib/modules/3.16.0-4-amd64/build M=/var/lib/dkms/vboxhost/5.0.12/build................
cleaning build area....

DKMS: build completed.

vboxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16.0-4-amd64/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16.0-4-amd64/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16.0-4-amd64/updates/dkms/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16.0-4-amd64/updates/dkms/

depmod....

DKMS: install completed.
root# 
root# 
root# dmesg | tail
[   22.222067] Bluetooth: BNEP filters: protocol multicast
[   22.222082] Bluetooth: BNEP socket layer initialized
[ 8792.407635] VBoxPciLinuxLinuxUnload
[ 9768.763315] vboxdrv: Found 4 processor cores
[ 9768.781092] vboxdrv: TSC mode is Invariant, tentative frequency 2494275212 Hz
[ 9768.781095] vboxdrv: Successfully loaded version 5.0.12 (interface 0x00240000)
[ 9768.985640] VBoxNetFlt: Successfully started.
[ 9768.986764] VBoxNetAdp: Successfully started.
[ 9768.988369] VBoxPciLinuxInit
[ 9768.989066] vboxpci: IOMMU not found (not registered)
root# 
root# 
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by Perryg »

Have you tried to do all of this as an elevated user instead of root?
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

Hi Perryg,

I do not have an elevated user in my system. There's one regular user and a root. All installation via root, everything else via the regular.
But, I'll try out your suggestion once I figure out how to make the regular user a sudoer.
In the meantime, I was looking around for the source of this error and I think I have found it. There's only one shell script in my system that has "ln" and "setup" on the same line, and it seems very likely that the error originates from line # 59 of the "postinst-common.sh" script in /usr/lib/virtualbox directory:

Code: Select all

root# 
root# cat -n /usr/lib/virtualbox/postinst-common.sh
     1	# Oracle VM VirtualBox
     2	# VirtualBox Linux post-installer common portions
     3	#
     4	
     5	# Copyright (C) 2015 Oracle Corporation
     6	#
...
...
    21	# We assume that all required files are in the same folder as this script
    22	# (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
    23	
    24	# This is GNU-specific, sorry Solaris.  It fails on directories ending in '\n'.
    25	MY_PATH="$(dirname $(readlink -f -- "${0}"))"
    26	cd "${MY_PATH}"
    27	. "./routines.sh"
    28	
    29	START=true
...
...
    56	delrunlevel vboxweb-service
    57	addrunlevel vboxweb-service
    58	
    59	ln -sf "${MY_PATH}/postinst-common.sh" /sbin/rcvboxdrv setup
    60	
...
...
    66	    start_init_script vboxweb-service
    67	}
root# 
root# 
The value of "MYPATH" is /usr/lib/virtualbox because line 27 invokes "routines.sh" in the pwd and "routines.sh" is in /usr/lib/virtualbox in my system.
If I understand the man page of "ln" correctly, the command at line 59 should create two symbolic links in the setup directory:
(1) postinst-common.sh -> /usr/lib/virtualbox/postinst-common.sh
(2) rcvboxdrv -> /sbin/rcvboxdrv

However, the setup directory does *not* exist in "MYPATH" or /usr/lib/virtualbox, hence the error.

Code: Select all

root# 
root# ls -l /usr/lib/virtualbox | grep ^d
drwxr-xr-x 2 root root     4096 Dec 29 13:55 components
drwxr-xr-x 4 root root     4096 Dec 29 13:55 dtrace
drwxr-xr-x 2 root root     4096 Dec 18 12:25 ExtensionPacks
drwxr-xr-x 3 root root     4096 Dec 29 13:55 sdk
root# 
root# 
I believe the command

Code: Select all

/sbin/rcvboxdrv setup
is used during manual installation from source as per the Virtualbox documentation,
and also from the fact that /sbin/rcvboxdrv accepts "setup" as a parameter:

Code: Select all

root# 
root# cat -n /sbin/rcvboxdrv | grep setup
   295	# setup_script
   296	setup()
   414	setup)
   415	    setup
   421	    echo "Usage: $0 {start|stop|stop_vms|restart|force-reload|status|setup}"
root# 
root# 
But I don't quite understand the rationale of the "ln -sf" command.
Or maybe the "setup" directory should've been created and it is a bug in the installation package.
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

Ok, I created the "setup" directory and executed the "postinst-common.sh" script.
It ran smoothly and I believe the problem has been fixed (unless something goes wrong while installing a VM).

Code: Select all

root# 
root# mkdir -p /usr/lib/virtualbox/setup
root# 
root# /usr/lib/virtualbox/postinst-common.sh
root# 
root# echo $?
0
root# 
root# file /usr/lib/virtualbox/setup/*
/usr/lib/virtualbox/setup/postinst-common.sh: symbolic link to /usr/lib/virtualbox/postinst-common.sh
/usr/lib/virtualbox/setup/rcvboxdrv:          symbolic link to /sbin/rcvboxdrv
root# 
root# rcvboxdrv setup
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.
root# 
root# 
I hope this helps someone who is trying to install Virtualbox 5.0.12 on Debian 8.

Thanks a lot - loukingjr and Perryg for your responses. Much appreciated.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by Perryg »

Actually I just tested this on a debian 8.2 host and it appears to be a left over in the install script due to the switch from initv to systemd. From what I can tell it does not really cause an issue as VirtualBox still runs and installed guests still work. You can test this by running rcvboxdrv setup and it should run with no warnings.

Oh and to answer your previous question, use visudo to add your user to the sudoers list. Much better and a lot safer than running as root.

Note: the reason I did not catch this myself is I don't use the VirtualBox installer. I create my own binary package and installer. So it may be advisable to report this to bugtracker. I would but they prefer to get this from normal users.
virtualbox_neophyte
Posts: 7
Joined: 29. Dec 2015, 07:46

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by virtualbox_neophyte »

Thank you, Perryg.
I have now submitted a ticket (14989) to the Bugtracker.
Also trying out visudo.

Cheers...
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Error on installation of Virtualbox 5.0.12 on Debian 8

Post by loukingjr »

Just to make it easier… Ticket #14989
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Post Reply