Bug 247474 - `shutdown -p now` fails to power off with VirtualBox UEFI boot
Summary: `shutdown -p now` fails to power off with VirtualBox UEFI boot
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2020-06-22 10:11 UTC by Yasuhiro KIMURA
Modified: 2020-06-25 19:17 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro KIMURA 2020-06-22 10:11:04 UTC
I have VirtualBox VM running 13-CURRENT. Environments are

Host: 64bit Windows 10 ver. 1909
VirtualBox: 6.1.10
VM: 4CPU, 8GB Memory, 100GB Disk, Audio disabled. Bridged NIC

In order to switch from legacy BIOS to UEFI I enabled UEFI on VM settings and reinstalled OS by using FreeBSD-13.0-CURRENT-amd64-20200611-r362037-disc1.iso. After that `shutdown -p now` (or select 'ACPI shutdown' in VM menu) fails to power off. Shutdown itself completes successfully. But power off never happens and CPU usage keeps high until either closing or resetting VM. If I switch back to legacy BIOS and reinstall OS then the problem disappears. And it doesn't happen with either 11.4-RELEASE or 12.1-RELEASE.

I tried bisect and found this problem happens with base r342108 and
after. Commit message of base r342108 says as following.

yasu@rolling-vm-freebsd5[1012]% LANG=C svn log -c 342108
r342108 | cem | 2018-12-15 14:46:04 +0900 (Sat, 15 Dec 2018) | 7 lines

efirt: When present, attempt to use EFI runtime services to shutdown

PR:             maybe related to 233998 (inconclusive at this time)
Submitted by:   byuu <byuu AT tutanota.com> (previous version)
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D18506

Comment 1 Yasuhiro KIMURA 2020-06-25 19:17:42 UTC
By adding "tunable hw.efi.poweroff=0" to /boot/loader.conf `shutdown -p now` successfully powers off system.