The wiki page for setting up emulators/wine{-devel} for running 32-bit Microsoft Windows applications, capable of installing and running under FreeBSD/amd64.

Installing

Wine packages

First you would install Wine package normally. Packages for wine{-devel} are provided for all supported FreeBSD releases and FreeBSD-current via the normal FreeBSD Ports repository.

Installing lib32 system libraries

You do need a system installed with lib32 libraries. If unsure, test if /usr/lib32/libc.so.* is present on your system. If not you can fetch the set "lib32.txz" from the FreeBSD FTP Archives and install it the following way (for example, on an amd64 installation of 10.3-RELEASE):

# fetch -arRo /tmp/ https://download.freebsd.org/ftp/releases/amd64/10.3-RELEASE/lib32.txz
# tar -xpf /tmp/lib32.txz -C /

Installing 32-bit Wine

The 32-bit version of Wine environment needs to be installed in your user home directory. Run this from your user account (not root):

$ /usr/local/share/wine/pkg32.sh install wine mesa-dri

This will download required packages and install them in ~/.i386-wine-pkg hierarchy.

Building

Manual

To build the i386-Wine port an i386 environment is required. If such an environment is not available then it can be created from FreeBSD/amd64:

# cd /usr/src
# make buildworld TARGET=i386
# make installworld TARGET=i386 DESTDIR=/compat/i386
# make distribution TARGET=i386 DESTDIR=/compat/i386
# ln /etc/resolv.conf /compat/i386/etc
# mkdir /compat/i386/usr/ports
# mount -t devfs devfs /compat/i386/dev
# mount -t nullfs /usr/ports /compat/i386/usr/ports

When chrooting to /compat/i386 do these additional setups:

# chroot /compat/i386
# setenv MACHINE i386
# setenv UNAME_m i386
# setenv UNAME_p i386
# service ldconfig start

Lastly, the package can be created:

# cd /usr/ports/emulators/i386-wine-devel
# make package -DWINE_CROSS_BUILD

The package created had an architecture label of, for example freebsd:11:x86:32, and will not install in a 64-bit environment unless you use pkg add -f. The package is available at:

# echo /compat/i386/$(make -V PKGFILE)

Poudriere

Poudriere can be used to compile i386-wine by doing the following (using FreeBSD 10.1 as an example):

# pkg install poudriere
# poudriere ports -c 
# poudriere jail -c -j wine-build -a i386 -v 10.3-RELEASE
# echo "WINE_CROSS_BUILD=yes" >> /usr/local/etc/poudriere.d/make.conf
# poudriere bulk -j wine-build emulators/i386-wine

The package is available at

# echo /usr/local/poudriere/data/packages/wine-build-default/All/$(make -C /usr/ports/emulators/i386-wine -V PKGNAME ARCH=i386).txz

and can be installed using

# pkg install -f /usr/local/poudriere/data/packages/wine-build-default/All/$(make -C /usr/ports/emulators/i386-wine -V KGNAME ARCH=i386).txz

TODO

i386-Wine (last edited 2025-08-10T15:56:13+0000 by RobertM)