OPNsense does not boot without monitor

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

Some systems may fail to start FreeBSD / OPNsense / pfSense if no monitor is connected during the startup process. To solve this problem, the tunable hw.uart.console = default can be set. Alternatively, disabling all COM ports in the BIOS or a serial console as primary console will result in a correct boot process even if the monitor is disconnected.

Affected systems

Affected systems are e.g.

  • LES plus v3 with Default BIOS Settings & EFI Boot (tested with BIOS Version: CM2LA170 / Build Date: 13.06.2022)
  • LES v4 with Default BIOS Settings & EFI Boot (tested with BIOS Version: YELU3L12 / Build Date: 24.10.2022)

Cause

There was a bug in FreeBSD 13 that did not handle serial EFI consoles. This bug was fixed in OPNsense 22.1.2, but in general FreeBSD 13 requires the BIOS to disable legacy UART emulation.[1][2]

Possible solutions

To resolve this issue, perform one of the following resolution options:

  • Tunable hw.uart.console ergänzen
  • COM Port disablen im BIOS
  • Primary Console: Serial Console

Add Tunable hw.uart.console

To fix the problem, set the Tuneable hw.uart.console and then reboot the system:

  1. Under System ‣ Settings ‣ Tunable click the +' Icon (Add)
  2. Add the value default to the Tuneable hw.uart.console':
    OPNsense-22.7-System-Settings-Tuneables-1.png
  3. Click on Apply Changes:
    OPNsense-22.7-System-Settings-Tuneables-2.png
  4. The setting has been applied:
    OPNsense-22.7-System-Settings-Tuneables-3.png
  5. Perform a restart.

With this tunable, the dmesg output shows an additional line with uart0: console (115200,n,8,1) on a subsequent reboot - a boot process without a monitor connected works with this:

root@fw-test-opnsense-22-7:~ # dmesg | grep -i uart
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (115200,n,8,1)
root@fw-test-opnsense-22-7:~ # 

Disable COM Ports in BIOS

If all COM ports are disabled in the BIOS, the system will boot even without a monitor connected.[3]

Primary Console: Serial Console

By default, the VGA Console is configured as the Primary Console.

  • System ‣ Settings ‣ Administration shows in the area Console:
    OPNsense-22.7-System-Settings-Administration-Console-Default.png

To ensure that the system starts reliably even without a monitor connected, configure the Serial Console as Primary Console (see also OPNsense serial console). Then use the VGA console only as secondary console:[4]

  • In System ‣ Settings ‣ Administration choose the following settings in the area Console and save them:
    • Primary Console: Serial Console
    • Secondary Console: VGA Console
  • The settings look like this:
    OPNsense-22.7-System-Settings-Administration-Console-Serial.png

Further Information

References

  1. 21->22 upgrade - loss of serial port at 115200 (github.com/opnsense/core/issues, Franco Fichtner, Aug 23, 2022)
  2. Serial Console connectivity - Legacy UART vs. UEFI serial (docs.opnsense.org)
  3. 2.4.0 does not boot without Monitor (forum.netgate.com, 15.10.2017) [...] disabling the Serial ports the computer boots normally [...]
  4. 2.4.0 does not boot without Monitor (forum.netgate.com, 26.02.2019) [...] Make sure the Primary Console is set to "Serial Console". [...]


Foto Werner Fischer.jpg

Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.


Related articles

Activate SATA Link Power Management in OPNsense
OPNsense OpenVPN performance tests and results
Set OPNsense language