# VirtualBox Issue after upgrade



## t4z3v4r3d (Mar 25, 2020)

After Upgrading process from 12.0 to 12.1 :  build world and kernel, Vbox is crashing every time started.
No vboxnet0, No debug info, No logs.

```
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ id
uid=1001(t4z3v4r3d) gid=1001 groups=1001,0(wheel),5(operator),68(dialer),69(network),920(vboxusers)
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ /usr/local/lib/virtualbox/VirtualBox --debug-command-line --comment ceph-admin-20-25-gui --startvm 44241989-0f2c-4c9d-b3ad-53b378106204 --no-startvm-errormsgbox
Segmentation fault
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ ifconfig | grep -i vbox
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ pkg info | grep virtualbox
virtualbox-ose-5.2.34_1        General-purpose full virtualizer for x86 hardware
virtualbox-ose-additions-5.2.34_2 VirtualBox additions for FreeBSD guests
virtualbox-ose-kmod-5.2.34 VirtualBox kernel module for FreeBSD
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ freebsd-version -uk
12.1-STABLE
12.1-STABLE
```
Any suggestion ?


----------



## Paul Floyd (Mar 25, 2020)

Same problem here. The wiki does suggest checking that vbox is in your xorg config, which I haven't tried yet.


----------



## SirDice (Mar 25, 2020)

Do the virtualbox kernel modules load? I suspect they're still for 12.0 and will likely fail to load, try rebuilding/reinstalling those.


----------



## t4z3v4r3d (Mar 25, 2020)

It will be ok with `sudo virtualbox`


But why ? I Have even no any simple change in my machine just i did mke buildworld and kernel as the regular upgrade.


```
t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ kldstat -v | grep -i vb
4    3 0xffffffff82499000    88520 vboxdrv.ko (/boot/modules/vboxdrv.ko)
                  3 vboxdrv
14    1 0xffffffff84021000    2e903 vboxguest.ko (/boot/modules/vboxguest.ko)
                526 pci/vboxguest
19    2 0xffffffff8408e000     2ce0 vboxnetflt.ko (/boot/modules/vboxnetflt.ko)
                532 ng_vboxnetflt
22    1 0xffffffff8409d000     3f30 vboxnetadp.ko (/boot/modules/vboxnetadp.ko)
                534 vboxnetadp
```


----------



## t4z3v4r3d (Mar 25, 2020)

Nothing ?


----------



## SirDice (Mar 25, 2020)

t4z3v4r3d said:


> I Have even no any simple change in my machine just i did mke buildworld and kernel as the regular upgrade.


No simple change? You upgraded to a new minor version. Granted this shouldn't be much of an issue but kernel modules can be quite finicky about the exact kernel version they were built for.


----------



## t4z3v4r3d (Mar 25, 2020)

SirDice said:


> No simple change? You upgraded to a new minor version. Granted this shouldn't be much of an issue but kernel modules can be quite finicky about the exact kernel version they were built for.



The kernel was upgraded 12.1 and all packages too before. Just upgrading world and after that i did it for all packages again. 
So i expected to have a working machine.


----------



## T-Daemon (Mar 25, 2020)

Check the permissions of the /tmp folder, vbox creates temporary files there. That might explain working with sudo. I had an issue with xorg because some process changed permissions on /tmp.


----------



## t4z3v4r3d (Mar 25, 2020)

`t4z3v4r3d@virtual /usr/home/t4z3v4r3d $ ls -la / | grep tmp
drwxrwxrwt   8 root       wheel          896 Mar 25 22:49 tm`


----------



## sgunn (Mar 26, 2020)

FWIW I am having the same issue.  Did a forced pkg upgrade to reinstall everything, which didn't help.

I am on 12.1-p3.


----------



## t4z3v4r3d (Mar 26, 2020)

So, Any idea ?


----------



## T-Daemon (Mar 26, 2020)

You said no logs, look in ~/.config/VirtualBox, there must be some logs.


----------



## t4z3v4r3d (Mar 26, 2020)

T-Daemon said:


> You said no logs, look in ~/.config/VirtualBox, there must be some logs.



Hi, These Logs are not something like the others.
I mean you can not debug by reading that. I can attach all logs you mentioned here.


----------



## Paul Floyd (Mar 26, 2020)

T-Daemon said:


> You said no logs, look in ~/.config/VirtualBox, there must be some logs.



The log does mention that the Guest Additions ISO can't be found. I get the same message on Linux, so it's probably not the cause. Then there is an ACCESSDENIED error, at about the same point that Linux warns that USB is not accessible.

I tried deleting the logs, they don't get regenerated. I also tried enabling USB. No joy. The last things that truss -f outputs are 


```
69868: openat(AT_FDCWD,"/usr/home/paulf/.config/kdeglobals",O_RDONLY|O_CLOEXEC,00) = 8 (0x8)
69868: fstat(8,{ mode=-rw------- ,inode=805307,size=3701,blksize=4096 }) = 0 (0x0)
69868: fstat(8,{ mode=-rw------- ,inode=805307,size=3701,blksize=4096 }) = 0 (0x0)
69868: fstat(8,{ mode=-rw------- ,inode=805307,size=3701,blksize=4096 }) = 0 (0x0)
69868: read(8,"[$Version]\nupdate_info=filepick"...,16384) = 3701 (0xe75)
69868: read(8,0x80b0dcb8d,12683)                 = 0 (0x0)
69868: mmap(0x0,45056,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34577829888 (0x80cffd000)
69868: close(8)                                  = 0 (0x0)
69868: fstatat(AT_FDCWD,"/home/paulf/.config/breezerc",0x7fffffff9b80,0x0) ERR#2 'No such file or directory'
69868: fstatat(AT_FDCWD,"/usr/local/etc/xdg/breezerc",0x7fffffff9b80,0x0) ERR#2 'No such file or directory'
69868: fstatat(AT_FDCWD,"/etc/xdg/breezerc",0x7fffffff9b80,0x0) ERR#2 'No such file or directory'
69868: fstatat(AT_FDCWD,"/usr/local/etc/xdg/breezerc",0x7fffffff9b80,0x0) ERR#2 'No such file or directory'
69868: SIGNAL 11 (SIGSEGV) code=SEGV_ACCERR trapno=12 addr=0x803dd2a18
69868: poll({ 3/POLLIN },1,-1)                   ERR#4 'Interrupted system call'
69868: <thread 101211 exited>
69868: process killed, signal = 11 (core dumped)
```


----------



## T-Daemon (Mar 27, 2020)

I was hoping there would be a hint in the log. I suppose there is no core dump file in the users home directory, isn't it? I can't reproduce the crash, it runs fine on my system. Here my system info:

amd64
12.1-RELEASE-p3, binary upgrade (12.0-R-p10 -> 12.1-R)
latest package repository
virtualbox-ose-5.2.34_1
virtualbox-ose-kmod-5.2.34
(both packages installed after the system upgrade)
vboxusers group

What I would try is perform a fresh system installation on a spare USB stick, SD card, empty partition, etc., install x11/xorg-minimal, graphics driver, a lightweight wm (x11-wm/twm will do), emulation/virtualbox-ose (-kdm). If the problem persists, open a bug report, if not then a fresh system installation should be considered.


----------



## t4z3v4r3d (Mar 27, 2020)

In my case it's running by sudo, I did't change perms and/or configs. 
It seems problem is some part of new configurations that i don't where it is.


----------



## Paul Floyd (Mar 27, 2020)

In my case, this was a clean install of FreeBSD 12.1. I don't particularly want to have to reinstall the OS - the reason that I want to use VBox is to not have to install more OSes on bare metal.


----------



## T-Daemon (Mar 27, 2020)

T-Daemon said:


> If the problem persists, open a bug report


Someone has already filed a bug report PR 245054 , which has been marked as a duplicate of bug PR 244847, possible fix this weekend (comment #6).

There is a reference in the Makefile of virtualbox-ose to the gcc9 situation (line 35), mentioned in comment #2.

Remains the question why not all systems are affected (mine is not).


----------



## sgunn (Mar 27, 2020)

If this helps, I removed virtualbox, then pulled down a slightly older version from the pkg repository and installed it and it started right up.


----------



## T-Daemon (Mar 30, 2020)

The fix for emulators/virtualbox-ose will take a little while longer.  A patch is pending to be added to devel/llvm10 (build compiler), after fixing it virtualbox-ose can be switched over to it (Comment # 12).


----------



## t4z3v4r3d (Apr 1, 2020)

I have tried to reinstall it by ports but my machine was crashed after reboot, crashed and crashed ....
So i decided to remove it and install it by pkg again.
Again is running by sudo.
Problem is still remaining.


----------



## T-Daemon (Apr 1, 2020)

t4z3v4r3d said:


> I have tried to reinstall it by ports but my machine was crashed after reboot


You could try sgunn's method:


sgunn said:


> I removed virtualbox, then pulled down a slightly older version from the pkg repository and installed it and it started right up.


In the quarterly pkg repository virtualbox-ose is at version 5.2.34 ( 5.2.34_1 in latest repo), ex.:

`fetch http://pkg0.isc.freebsd.org/FreeBSD:12:amd64/quarterly/All/virtualbox-ose-5.2.34.txz`
from the same directory:
`pkg add virtualbox-ose*`

I still haven't figured out why my machine is unaffected.


----------



## T-Daemon (Apr 1, 2020)

t4z3v4r3d said:


> I have tried to reinstall it by ports


*4z3v4r3d*, check the port version of vitualbox-ose in your ports tree, emulators/virtualbox-ose  port has been updated to 5.2.34_2.


----------



## t4z3v4r3d (Apr 1, 2020)

It was .... 
I've tried it before ( ~ 10 h )-  failed - 


```
cat /usr/ports/emulators/virtualbox-ose/distinfo
TIMESTAMP = 1571257463
SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1
SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064
SHA256 (VBoxGuestAdditions_5.2.34.iso) = d1b63891abca37fd78f5c8af1764e10e5754b1eecabd1fcfe7599c29a93ba007
SIZE (VBoxGuestAdditions_5.2.34.iso) = 49661952
```


----------



## von_Gaden (Apr 5, 2020)

I'm sorry to report I am hit by this issue too. I've updated two machines with FreeBSD 12.1-P3 and emulators/virtualbox-ose-nox11 built from source, version 5.2.34_2 and the system started to reboot with kernel panic - "sleeping thread". It *sometimes* works if I start Virtualbox manually.


----------



## 7LP (Apr 6, 2020)

Had the same problem after the last upgrade as mentioned by other users in this thread and in the Bugzilla :


```
# date ; uname -a
Mon  6 Apr 2020 09:45:46 -05
FreeBSD host-freebsd 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64

# pkg info | grep -i virtualbox-ose
virtualbox-ose-5.2.34_2
virtualbox-ose-kmod-5.2.34_2
```

VirtualBox GUI will segfault when starting :

```
$ VirtualBox
Segmentation Fault
```
(but will work when started as "root")

As suggested by T-Daemon and sgunn , I have downgraded (using my last locally cached version) and it works again :

```
# pkg remove virtualbox-ose-5.2.34_2 virtualbox-ose-kmod-5.2.34_2
# pkg add  /var/cache/pkg/virtualbox-ose-*5.2.32_1.txz
# reboot
```

Hope this could help someone !


----------



## SirDice (Apr 6, 2020)

Upgrade your system, you're still on 12.0. Packages in the repositories are specifically built for 12.1 now. FreeBSD 12.0 is end-of-life.


----------



## Paul Floyd (Apr 6, 2020)

The latest package on FreeBSD 12.1 p3 still crashes.

```
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000803fbba18 in vtable for __cxxabiv1::__si_class_type_info ()
from /lib/libcxxrt.so.1
(gdb) bt
#0 0x0000000803fbba18 in vtable for __cxxabiv1::__si_class_type_info ()
from /lib/libcxxrt.so.1
#1 0x000000080071f3e6 in __dynamic_cast ()
from /usr/local/lib/gcc9/libstdc++.so.6
#2 0x000000080cc8d2f9 in ?? () from /usr/local/lib/libKF5ConfigCore.so.5
#3 0x000000080cc86c4e in KConfigGroup::KConfigGroup(KConfigBase*, QString const
&) () from /usr/local/lib/libKF5ConfigCore.so.5
#4 0x000000080b369c20 in ?? ()
from /usr/local/lib/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#5 0x000000080b367c66 in ?? ()
from /usr/local/lib/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#6 0x000000080b363af1 in ?? ()
from /usr/local/lib/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#7 0x000000080b37b48b in ?? ()
from /usr/local/lib/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#8 0x000000080510ddd8 in QPlatformThemeFactory::create(QString const&, QString
const&) () from /usr/local/lib/qt5/libQt5Gui.so.5
#9 0x0000000805118d7b in QGuiApplicationPrivate::createPlatformIntegration()
() from /usr/local/lib/qt5/libQt5Gui.so.5
#10 0x0000000805119780 in QGuiApplicationPrivate::createEventDispatcher() ()
from /usr/local/lib/qt5/libQt5Gui.so.5
#11 0x0000000804e379fb in QCoreApplicationPrivate::init() ()
from /usr/local/lib/qt5/libQt5Core.so.5
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x000000080511492a in QGuiApplicationPrivate::init() ()
from /usr/local/lib/qt5/libQt5Gui.so.5
#13 0x00000008058921ce in QApplicationPrivate::init() ()
from /usr/local/lib/qt5/libQt5Widgets.so.5
#14 0x0000000802714ead in TrustedMain (argc=<optimized out>,
argv=<optimized out>)
at /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/VB
ox/Frontends/VirtualBox/src/main.cpp:404
```
The Qt5 and KDE5 libs are all linked with libc++, but VirtualBox is linked with libstdc++.

For this to work it would require a Qt5 linked with libstdc++, at least.


----------



## von_Gaden (Apr 6, 2020)

I'm not sure is this somehow related to update to FreeBSD 12.1. No matter if I use the last version (built from Ports) or older version of emulators/virtualbox-ose-nox11 (5.2.32_1, found in packages) the system sporadically crashes with kernel panic - sleeping thread. The panic mostly occurs during system startup if VirtualBox starts at boot, up to 10 seconds after manual start or at shutdown.


----------



## Paul Floyd (Apr 7, 2020)

That's probably a separate problem.


----------



## DusTech (Apr 14, 2020)

Thx for the advice...
I've installed an older version from the repository:


```
# pkg info | grep -i virtualbox-ose
virtualbox-ose-5.2.32_1        General-purpose full virtualizer for x86 hardware
virtualbox-ose-kmod-5.2.34     VirtualBox kernel module for FreeBSD
```

and the segmentation error went away...


----------



## T-Daemon (Apr 14, 2020)

DusTech said:


> I've installed an older version from the repository:
> ...
> and the Segmentation error went away...


The seg fault bug with emulators/virtualbox-ose seems to be fixed, bug report PR 244847 marked as _Closed FIXED_. A package can be expected soon (quarterly and latest).


----------



## LJackson (Apr 16, 2020)

Not sure if this belongs here, since this isn't a seg fault, but may be related.

For me, the latest version (5.2.34_4) either as a package or port crashes the system when run as a non-root user. (Older 5.2.34 versions I tried did this too.) Installing a yet older package version (5.2.32_1) works but with no sound. By chance, I mixed emulators/virtualbox-ose-5.2.34_4 from ports with package emulators/virtualbox-ose-kmod-5.2.32_1 and it ran with working sound.



```
% uname -a
FreeBSD Dad.local 12.1-RELEASE-p3 FreeBSD 12.1-RELEASE-p3 GENERIC  amd64
% pkg info -x virtualbox
virtualbox-ose-5.2.34_4
virtualbox-ose-kmod-5.2.32_1
%
```

The sequence I used to do this was


```
# cd /usr/ports/emulators/virtualbox-ose
# make install clean
# cd ../virtualbox-ose-kmod
# make deinstall
# cd /var/cache/pkg
# fetch "http://pkg.freebsd.org:12:amd64/release_1/All/virtualbox-ose-kmod-5.2.32_1.txz"
# pkg add /var/cache/pkg/virtualbox-ose-kmod-5.2.32_1.txz
# shutdown -r now
```

Note: Attempting to use `pkg` to remove  emulators/virtualbox-ose-kmod removes both.


----------



## von_Gaden (Apr 17, 2020)

One of my systems behaves absolutely strange. It is Supermicro X11DPL-I, runs FreeBSD 12.1-RELEASE-p3 and has one Intel(R) Xeon(R) Silver 4108 CPU with latest BIOS and sysutils/devcpu-data invoked from `/boot/loader.conf`
With earlier emulators/virtualbox-ose-nox11 5.2.34 the system crashed with `sleeping thread` kernel panic.
I built emulators/virtualbox-ose-nox11 5.2.34_4 from ports and it started without kernel panic - both running at startup or starting manually.
But when I built net/samba410 the nightmare of kernel panics returned. When both VirtualBox and Samba run at startup the system panics with  `sleeping thread` during startup of VirtualBox. If I start one of these manually after boot the system works just fine.
It's really odd. I'm not sure when exactly this all started. I've updated the system BIOS, FreeBSD 12.0 to 12.1, rebuilt all ports and ran into this trouble.


----------



## Paul Floyd (Apr 17, 2020)

fwiw VirtualBox managed to start after the pkg upgrade I ran yesterday. Haven't yet tried to run anything on it yet.


----------



## von_Gaden (Apr 17, 2020)

All guests on my machine work just fine if the host doesn't crash at startup. net/samba410 runs on the host too.


----------



## 7LP (Apr 22, 2020)

SirDice said:


> Upgrade your system, you're still on 12.0. Packages in the repositories are specifically built for 12.1 now. FreeBSD 12.0 is end-of-life.



Thank you SirDice for your suggestion, I have upgraded from FreeBSD 12.0 to FreeBSD 12.1-p3.
VirtualBox is now working with the last version available by pkg (virtualbox-ose-kmod-5.2.34, virtualbox-ose-5.2.34_4).


----------

