Bug 220003

Summary: emulators/virtualbox-ose: crashes on recent 12.0-CURRENT
Product: Ports & Packages Reporter: Johannes Jost Meixner <xmj>
Component: Individual Port(s)Assignee: Virtualbox Team (Nobody) <vbox>
Status: New ---    
Severity: Affects Only Me CC: aurel, grahamperrin, karabojkov, lbartoletti, meyer.sydney, philippe.michel7, rkoberman, vermaden
Priority: --- Flags: bugzilla: maintainer-feedback? (vbox)
Version: Latest   
Hardware: Any   
OS: Any   

Description Johannes Jost Meixner freebsd_committer 2017-06-15 08:06:02 UTC
I can start VMs through GUI or command line, but the moment I add port forwarding from guest to host (e.g. to expose the guest's SSH port on my local computer) I see a kernel panic like this (camera-taken) screenshot:

Comment 1 Loïc Bartoletti freebsd_committer 2018-09-12 13:42:37 UTC
I confirm. When the VM ran FreeBSD panic and reboot.
Comment 2 Philippe Michel 2018-11-23 21:13:40 UTC
I see a very similar issue, most probably the same, with virtualbox-ose-5.2.22 on FreeBSD 12.0-PRERELEASE r340556 :
- VM runs as expected with its network interface set up as simple NAT (no port forwarding)
- host crashes as soon as the same VM is started with the interface set up as bridge

The same VM was working fine in bridge configuration on 11-STABLE before I upgraded the base system to 12 (and rebuilt the ports) a few days ago.
Comment 3 Ivo Karabojkov 2018-12-18 07:04:27 UTC
I can confirm the crash:
The crash occurs when I try to start VM on:
FreeBSD 12.0-RELEASE r341666 GENERIC amd64
CPU: Intel E5-2623 v4
CPU microcode: updated from 0xb00002a to 0xb00002e
virtualbox-ose-nox11-5.2.22_2 (installed from PORTS)

The same system worked fine with FreeBSD 11.2-RELEASE and virtualbox-ose-nox11-5.2.12_1

The VM starts with NAT adapter and immediately crashes the host with bridged adapter.
Comment 4 Ivo Karabojkov 2018-12-23 13:03:25 UTC
I found a solution - compiling emulators/virtualbox-ose-kmod with VIMAGE support on solved the problem. The rebuild of all ports inherited the old value - VIMAGE off. I see it was turned on by default on 24 Oct 2017. I guess if this option is mandatory (at least for the bridged networking) there should be some scary warning during ports build
Comment 5 rkoberman 2018-12-23 20:48:19 UTC
I confirm that this fixes the immediate problem, but there is still a bug that needs to be fixed. No having VIMAGE=on should not panic the system.

VIMAGE is now "on" by default, but that does not help for anyone building from ports who already had set the build options prior to the change.

Is there any reason to have VIMAGE disabled on 11.2 or 12.0? It may not work on 11.2 if VIMAGE is not enabled in the kernel and I don't recall whether 11.2 had it enabled, but I don't think do. I'd check, but something is foobar in the web interface to the repo and I get a "Backend" error when trying to access either base/stable/11 or base/stable/12/sys.

Thanks so much for the report. I have been backtracking through head and had just started rolling back to July 15 after crashing trying August 15.

There are two other bug reports that should be merged to this one.
Comment 6 Slawomir Wojciech Wojtczak 2019-07-16 11:32:22 UTC
*** Bug 233515 has been marked as a duplicate of this bug. ***
Comment 7 Walter Schwarzenfeld freebsd_triage 2019-09-04 23:27:24 UTC
*** Bug 233540 has been marked as a duplicate of this bug. ***
Comment 8 Loïc Bartoletti freebsd_committer 2021-02-12 16:41:11 UTC
This ticket is old and there have been new versions of VBox and FreeBSD. Can it be closed?
Comment 9 Slawomir Wojciech Wojtczak 2021-02-12 16:55:28 UTC
IMHO it can be closed.

I regularly use port forwarding with Virtualbox on FreeBSD 12.1 and now 12.2 and I haven't seen any restarts or kernel panics.

At least on my machines.

Comment 10 Philippe Michel 2021-02-13 15:24:28 UTC
The problem still exists (with 12.2-STABLE stable/12-c199-gf56d7f838, virtualbox-ose-5.2.44_4 and VIMAGE off).

Since it happens only with an option that has not been the default any more for more than three years (as pointed in comment #4), keeping the PR open until an hypothetical fix of the root cause doesn't seem that important.

Maybe you could simply add a warning comment in the kmod port Makefile, near the OPTIONS_DEFAULT=VIMAGE line, referring to this PR.

Another possibility could be to make VIMAGE no longer optional when built for release 12 (or later ?)