OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction to OpenBSD
      • Installing OpenBSD
      • The X Window System
      • Networking on OpenBSD
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • OpenBSD Desktop 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
          • OpenSMTPD Mail Server
          • Dovecot IMAP and POP3 Server
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound DNS Resolver
          • NSD Authoritative DNS Server
          • BIND DNS Server
        • Networking
          • OpenBGPD
          • rad
          • DHCP on OpenBSD
          • slaacd
        • Web
          • Apache HTTP Server
          • nginx Web Server
          • OpenBSD httpd Web Server
          • relayd Reverse Proxy
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • OpenSSH Server
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ Message Broker
        • Time
          • NTP Time Synchronization
        • Load Balancing
          • Build Redundant Load-Balanced Gateways
          • Load Balance Services with NAT or DSR
          • Build an HA HTTPS Load Balancer
      • 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
        • Installation and First Boot
          • Complete the First 30 Minutes After Installation
          • Check Hardware Compatibility Before Installing
          • Bootstrap Wi-Fi Firmware Without Ethernet
          • Run OpenBSD as a Virtual Machine Guest
          • Install OpenBSD on a VPS or Cloud Server
          • Install OpenBSD with Full-Disk Encryption
          • Dual-Boot OpenBSD on a UEFI System
          • Automate OpenBSD Installation with Autoinstall and PXE
        • Desktops and Laptops
          • Set Up OpenBSD as a Laptop or Workstation
          • Configure Laptop Power Management
          • Troubleshoot Web Browsers on OpenBSD
          • Use Plan 9 Tools on OpenBSD
          • Build a Minimal Desktop with suckless Tools
          • Install Z shell (zsh)
        • Networking and Remote Access
          • Create an Administrator Account with doas and SSH Keys
          • Configure Secure Remote Access with OpenSSH
          • Use FIDO Security Keys with OpenSSH
          • Configure Wi-Fi Roaming and Wired Failover
          • Troubleshoot PF, NAT, and Routing
          • Route Multiple VLANs with PF
          • Configure a Road-Warrior WireGuard VPN
          • Route IPv6 Networks without NAT
          • Test OpenBGPD with Two Providers
          • Unlock an Internal Service with an SSH Key
          • Build a Simple Router and Firewall
        • Servers and Services
          • Set Up WordPress on OpenBSD
          • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Security, Maintenance and Recovery
          • Establish a Conservative Security Baseline
          • Recover Access and Reset the Root Password
          • Collect OpenBSD Diagnostic Evidence
          • Troubleshoot Package Installation and Update Failures
          • Schedule Recurring Maintenance
          • Monitor an OpenBSD System
          • Back Up and Restore an OpenBSD System
          • Configure softraid RAID1
          • Recover an OpenBSD System That Does Not Boot
        • Building, Automation and Virtual Machines
          • Manage OpenBSD with Ansible
          • Build Third-Party Software from Ports
          • Build OpenBSD from Source
          • Plan a Docker Workload Migration to OpenBSD
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Architectures
      • OpenBSD Package Search
        • Synopsis
        • Wine and OpenBSD
          • Installing Wine
          • Running an Application
          • Example: Notepad++
          • Troubleshooting
        • Alternatives
          • Virtualization
          • Remote Access
          • Native Alternatives
          • Alternate Operating Systems

        Windows Compatibility

        Synopsis #

        The experimental Wine port runs some 64-bit Windows applications on OpenBSD/amd64 using -current. Wine is not included in the OpenBSD 8.0 release collection. For unsupported applications or other architectures, use remote access or native alternatives .

        Wine and OpenBSD #

        Wine translates Windows application interfaces into native system calls. Application compatibility varies; the OpenBSD port supports amd64 and 64-bit Windows applications only. A program that needs a 32-bit installer, executable, or DLL cannot run with this port.

        Installing Wine #

        Use an amd64 snapshot system . Update its installed packages before checking the repository for Wine:

        doas pkg_add -Dsnap -u
        pkg_info -Dsnap -Q wine
        

        The -Dsnap option explicitly selects snapshot packages, including when a snapshot has a release-style version. It does not upgrade the base system; see snapshot package selection .

        If a wine-... package is listed, install it:

        doas pkg_add -Dsnap wine
        

        The package page describes the port; a binary package may not yet be available on the mirror. If none is listed, wait for a binary package or prepare a matching current ports tree and build environment as described in building from ports , then run:

        cd /usr/ports/emulators/wine
        doas make FETCH_PACKAGES=-Dsnap install
        

        FETCH_PACKAGES=-Dsnap uses available snapshot packages for dependencies; missing dependencies are built from ports. Building Wine and missing dependencies can take hours and requires several gigabytes of disk space. Do not point an 8.0 release system at snapshot packages.

        Read /usr/local/share/doc/pkg-readmes/wine after installation. Its OpenBSD-specific instructions are also included on the package page.

        Running an Application #

        Use a 64-bit x86 (x64) Windows installer or executable. Inspect its architecture with objdump(1) before running it:

        objdump -f program.exe
        

        Look for i386:x86-64 on the architecture: line for an x64 executable.

        Graphical applications need an X session . For a serial-console VM, connect from an X11 workstation using remote X11 access .

        Run Wine as the regular user, without doas. Start the application from its own directory:

        cd /path/to/application
        wine program.exe
        

        Replace /path/to/application and program.exe with the application’s location and executable name. Run winecfg to open Wine’s configuration window.

        Example: Notepad++ #

        The example uses Wine 11.20 on OpenBSD 8.0-current/amd64.

        The official Notepad++ 8.9.8.1 release includes a portable x64 archive. Install the default unzip package, then download and extract it as the regular user:

        doas pkg_add -Dsnap unzip--
        mkdir -p ~/windows/notepad++
        cd ~/windows/notepad++
        ftp https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.9.8.1/npp.8.9.8.1.portable.x64.zip
        unzip npp.8.9.8.1.portable.x64.zip
        

        Create a text file and open it in Notepad++:

        printf 'Hello from OpenBSD.\n' > example.txt
        wine notepad++.exe example.txt
        

        Wine creates ~/.wine on first use. Notepad++ does not require Wine Mono; choose Cancel if its installation prompt appears.

        Add Saved from Notepad++ on OpenBSD. on the second line and choose File → Save. Check the saved file from another terminal:

        cat ~/windows/notepad++/example.txt
        

        The saved file contains:

        Hello from OpenBSD.
        Saved from Notepad++ on OpenBSD.
        
        Notepad++ displaying the two lines saved in example.txt on OpenBSD
        Notepad++ running through Wine on OpenBSD-current.

        Troubleshooting #

        • 32-bit errors: a failure mentioning syswow64 or a required 32-bit DLL indicates unsupported code. Changing Wine settings does not add 32-bit support.
        • Memory limits: for an out-of-memory failure, check the account’s login class and resource limits .
        • Sound: this port uses PulseAudio . Consult the installed pulseaudio(1) manual for its OpenBSD setup.
        • Graphics: the default Direct3D translation uses OpenGL. DXVK and VKD3D-Proton are optional alternatives requiring working Vulkan support. The Wine package README covers their setup.

        The Wine application database can help identify application requirements, but a report from another operating system does not establish OpenBSD compatibility.

        Alternatives #

        Virtualization #

        OpenBSD’s vmm/vmd supports OpenBSD and Linux guests with serial consoles; see the virtualization chapter . For a Windows desktop VM, use a hypervisor with documented Windows guest support.

        Remote Access #

        Use an RDP client to reach a Windows host whose RDP service is enabled and restricted to authorized users and networks. For example, install rdesktop and connect:

        doas pkg_add rdesktop
        rdesktop winhost.example.org
        

        Native Alternatives #

        Native packages are another option when the required application or file format is supported.

        Examples include:

        Windows SoftwareOpenBSD Alternative
        Notepad++mg(1) , mousepad , vim
        PuTTYssh(1) (in base system)
        WinSCPsftp(1) , rsync , scp(1)
        MS Paintgimp , xpaint
        MS Wordlibreoffice

        Search for available packages using:

        pkg_info -Q libreoffice
        pkg_info -Q gimp
        

        For DOS-era software, DOSBox provides an emulated PC environment. Running Windows 3.1 applications requires a separate Windows 3.1 installation inside DOSBox.

        Alternate Operating Systems #

        For software that does not work with the OpenBSD Wine port, use a Windows host or another operating system with Wine support. A dual-boot setup is another option when the application needs direct access to the machine’s hardware.

        Report a bug
        • Synopsis
        • Wine and OpenBSD
          • Installing Wine
          • Running an Application
          • Example: Notepad++
          • Troubleshooting
        • Alternatives
          • Virtualization
          • Remote Access
          • Native Alternatives
          • Alternate Operating Systems