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:
I confirm. When the VM ran FreeBSD panic and reboot.
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.
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.
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
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.
*** Bug 233515 has been marked as a duplicate of this bug. ***
*** Bug 233540 has been marked as a duplicate of this bug. ***
This ticket is old and there have been new versions of VBox and FreeBSD. Can it be closed?
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.
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 ?)