OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction
      • Installing OpenBSD
      • The X Window System
      • Networking
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • Graphical Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • smtpd
          • Dovecot
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound
          • NSD
          • BIND
        • Networking
          • OpenBGPD
          • rad
          • DHCP
          • slaacd
        • Web
          • Apache
          • nginx
          • httpd
          • relayd
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • sshd
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ
        • Time
          • NTP
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • How-to Guides
        • Complete the First 30 Minutes After Installation
        • Check Hardware Compatibility Before Installing
        • Bootstrap Wi-Fi Firmware Without Ethernet
        • Set Up OpenBSD as a Laptop or Workstation
        • Configure Laptop Power Management
        • Run OpenBSD as a Virtual Machine Guest
        • Install OpenBSD on a VPS or Cloud Server
        • Install OpenBSD with Full-Disk Encryption
        • Troubleshoot Web Browsers on OpenBSD
        • Create an Administrator Account with doas and SSH Keys
        • Establish a Conservative Security Baseline
        • Manage OpenBSD with Ansible
        • Recover Access and Reset the Root Password
        • Collect OpenBSD Diagnostic Evidence
        • Configure Secure Remote Access with OpenSSH
        • Set Up WordPress
        • Build Third-Party Software from Ports
        • Use FIDO Security Keys with OpenSSH
        • Build OpenBSD from Source
        • Configure Wi-Fi Roaming and Wired Failover
        • Dual-Boot OpenBSD on a UEFI System
        • Troubleshoot PF, NAT, and Routing
        • Automate OpenBSD Installation with Autoinstall and PXE
        • Route Multiple VLANs with PF
        • Configure a Road-Warrior WireGuard VPN
        • Troubleshoot Package Installation and Update Failures
        • Route IPv6 Networks without NAT
        • Schedule Recurring Maintenance
        • Plan a Docker Workload Migration to OpenBSD
        • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Build a Simple Router and Firewall
        • Monitor an OpenBSD System
        • Back Up and Restore an OpenBSD System
        • Configure softraid RAID1
        • Recover an OpenBSD System That Does Not Boot
        • Install Z shell (zsh)
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Package Search
      • Synopsis
      • Historical Note
      • Rationale for Removal
      • Alternatives and Workarounds
        • Native Packages and Ports
        • Virtualization
        • Podman on OpenBSD
        • Remote Execution

      Linux Compatibility

      Synopsis #

      This chapter documents the current status of Linux binary compatibility on OpenBSD. It describes the historical linux(4) subsystem that once enabled Linux ELF binary execution, the reasons for its removal, and modern alternatives for accessing Linux-only software, including virtualization, remote execution, and native packaging.

      Historical Note #

      OpenBSD previously supported partial Linux compatibility through the linux(4) kernel subsystem. This layer enabled execution of select Linux ELF binaries, primarily for compatibility with older commercial or binary-only software. It required the presence of Linux-shared libraries and emulated system calls within a controlled environment.

      The feature was rarely used and became increasingly difficult to maintain. It was formally removed from the kernel in OpenBSD 6.3.

      Rationale for Removal #

      The linux(4) implementation was removed for the following reasons:

      • Maintaining binary compatibility with a foreign ABI conflicted with OpenBSD’s focus on correctness, simplicity, and security.
      • Most software that once required Linux compatibility has become open source and is available natively.
      • The compatibility layer required ongoing effort to track changes in Linux behavior and libc interfaces, with little user demand.

      The subsystem was considered obsolete and unmaintainable in light of modern application and system design.

      Alternatives and Workarounds #

      Native Packages and Ports #

      A large number of software packages initially developed for Linux are now available as native OpenBSD ports. These include:

      • Desktop software: Firefox, Chromium, LibreOffice
      • Development tools: GCC, Rust, Go
      • Networking tools: WireGuard, Docker clients, Kubernetes utilities

      To search for available software:

      $ pkg_info -Q firefox
      $ pkg_info -Q libreoffice
      

      If a package is not available, it may be possible to build it from source, assuming it does not rely on Linux kernel-specific interfaces.

      Virtualization #

      Linux applications requiring a full Linux environment can be executed inside a virtual machine using OpenBSD’s built-in hypervisor framework (vmm(4) and vmd(8)).

      Instructions for setting up virtual machines with Linux guests are provided in the Virtualization chapter.

      Podman on OpenBSD #

      Podman is not available as a native OpenBSD package, and upstream Podman does not support OpenBSD as a container host. Linux containers depend on Linux kernel interfaces that an OpenBSD host does not provide. Commands such as pkg_add podman therefore do not install a native container engine.

      Podman can run inside a Linux guest under vmm(4) and vmd(8) , or on a separate Linux host. The OpenBSD system can control that environment over SSH without requiring a local Podman client:

      $ ssh container-host podman ps
      $ ssh -t container-host podman run --rm -it docker.io/library/alpine
      

      Network services published by the container remain services of the Linux guest or remote host. Access from OpenBSD depends on the virtual-machine or remote-host network configuration, not on a native OpenBSD container layer.

      Remote Execution #

      For workflows involving Linux-only software, remote execution on a Linux host may be a practical solution. This can be done over SSH with optional X11 forwarding:

      $ ssh -X user@linuxhost gimp
      

      To run console-only applications:

      $ ssh user@linuxhost ffmpeg -i input.avi -vf scale=640:360 output.mp4
      

      Files may be transferred using scp or rsync as needed.

      The same method applies when the remote Linux environment is a virtual machine or a container host.

      Report a bug
      • Synopsis
      • Historical Note
      • Rationale for Removal
      • Alternatives and Workarounds
        • Native Packages and Ports
        • Virtualization
        • Podman on OpenBSD
        • Remote Execution