Bug 192359 - emulators/virtualbox-ose-additions 11.0-CURRENT VBoxService doesn't start
Summary: emulators/virtualbox-ose-additions 11.0-CURRENT VBoxService doesn't start
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Graham Perrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-03 15:50 UTC by palik
Modified: 2022-10-13 19:55 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description palik 2014-08-03 15:50:48 UTC
Hi,
Virtualbox + additions installation and settings are done as describet by 
https://wiki.freebsd.org/VirtualBox

Indeed VBoxService doesn't start.

% uname -a
FreeBSD pa-hpbook 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r264145: Sat Apr  5 21:20:21 CEST 2014     palik@pa-hpbook:/usr/obj/usr/src/sys/MYIPSEC  amd64
% kldstat| grep vbox        
 4    1 0xffffffff81e17000 253cb    vboxguest.ko
 5    1 0xffffffff81e3d000 9b42     vboxvideo.ko
18    2 0xffffffff81ebd000 298f     vboxnetflt.ko
19    2 0xffffffff81ec0000 33c95    vboxdrv.ko
21    1 0xffffffff81ef9000 3f56     vboxnetadp.ko
% VBoxService                  
VBoxService: error: VbglR3Init failed with rc=VERR_FILE_NOT_FOUND
% VBoxClient-all 
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
VBoxClient: unrecognized option `--draganddrop'
Try `VBoxClient --help' for more information
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-03 18:12:48 UTC
over to maintainer team...
Comment 2 Michael Grünewald 2017-12-02 09:45:04 UTC
This is still an issue, I am not sure which precise set of functionalities
it impairs in VirtualBox.

I experience the same problem on a fresh 11.1-RELEASE install on amd64:

  $ uname -a
  FreeBSD llea 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64


The symptom is the same for me as reported by palik:

  $ sudo service vboxservice forcestart
  Starting vboxservice.
  VBoxService: error: VbglR3Init failed with rc=VERR_FILE_NOT_FOUND

It is possible to trace the error the condition to the VboxGuestR3Lib.cpp
file in the sources as a hint that the file VBOXGUEST_DEVICE_NAME cannot
be opened.  I believe this is the matching definition for FreeBSD

  include/VBox/VBoxGuest.h:# define VBOXGUEST_DEVICE_NAME          "/dev/vboxguest"

and I actually do not have a /dev/vboxguest file on my system, while the
kernel module with the same name is loaded.


The sources

  src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c

also led me to think that this device might be created by the graphic
stack of VirtualBox.  I therefore rebuilt virtualbox-ose-additions
from the branch 2017Q4 of the ports tree, enabling the support for
OpenGL, but this did not change the situation in any visible way.
Comment 3 Mikhail Teterin freebsd_committer freebsd_triage 2017-12-28 15:44:37 UTC
(In reply to Michael Grünewald from comment #2)
The /dev/vboxguest entry is created by the vboxguest.ko module upon /successful/ loading.

The module may file to initialize itself, but will still load -- and stay there, uselessly. If you are have the vboxguest service enabled to start at boot, please, post output of `grep -i vbox /var/run/dmesg.boot`.

I had this problem because my guest is FreeBSD/i386 using PAE -- but the port is usually built without -DPAE, which makes the port-built kernel-modules subtly incompatible with the actual kernel. You are using 64-bit guests, so that should not be the problem -- but something else is...
Comment 4 Michael Grünewald 2018-01-03 13:03:59 UTC
(In reply to Mikhail Teterin from comment #3)

Unfortunately neither dmesg.boot nor messages do display a useful
information about what could cause the failure.

I restarted my system with verbose boot mode to obtain additional
details, which caused no more insight:

  # grep -i box /var/run/dmesg.boot
  Preloaded elf obj module "/boot/modules/vboxdrv.ko" at 0xffffffff82559220.

  # grep -i vbox /var/log/messages
  Jan  3 13:58:41 llea kernel: Preloaded elf obj module "/boot/modules/vboxdrv.ko" at 0xffffffff82559220.
  Jan  3 13:58:42 llea root: /etc/rc: WARNING: failed to start vboxservice

It's rather hard to figure out a meaningful next troubleshooting test!
Comment 5 SF 2018-11-14 16:46:02 UTC
After freebsd-update upgrade 11.2-RELEASE-p4 from Release 11.1.
Comment 6 Alberto Mensi 2019-04-04 20:08:18 UTC
I still encounter the same problem today with virtualbox-5.2.26_4 on FreeBSD 11.2-RELEASE-p8, no matter if I compile the port or install the package.
I suggest to change importance to "affects many users"
Comment 7 Chris Cureau 2020-08-15 16:23:33 UTC
The error seems to be coming from /dev/vboxguest not present:

sigprocmask(SIG_SETMASK,{ SIGALRM },0x0)         = 0 (0x0)
openat(AT_FDCWD,"/dev/vboxguest",O_RDWR|O_CLOEXEC,00) ERR#2 'No such file or directory'
VBoxServicewrite(2,"VBoxService",11)                     = 11 (0xb)
: write(2,": ",2)                                        = 2 (0x2)
error: write(2,"error: ",7)                              = 7 (0x7)
VbglR3Init failed with rc=VERR_FILE_NOT_FOUNDwrite(2,"VbglR3Init failed with rc=VERR_F"...,45) = 45 (0x2d)

write(2,"\n",1)                                  = 1 (0x1)
exit(0x1)                                       
process exit, rval = 1

From what I have researched (and confirmed at https://www.freebsd.org/doc/handbook/virtualization-guest-virtualbox.html), the package virtualbox-ose-additions package is only necessary on FreeBSD guests (running in VirtualBox already). 

For VirtualBox running on a FreeBSD Host, I installed emulators/virtualbox-ose and loaded the vboxdrv module. Works fine.
Comment 8 Jung-uk Kim freebsd_committer freebsd_triage 2021-04-07 15:54:02 UTC
Does it work with 6.1.18?