How to Install 32-bit Wine 1.8 on CentOS 7

Since version 7, RHEL has only x86-64 version. The same for CentOS 7. In CentOS 7/EPEL, there is only package for Wine x86-64. However, many Windows .exe files are 32-bit. Even there are 64-bit versions for some software, their installation file is 32-bit. And for some certain software such as Office 2007, 32-bit wine is preferred.

In this post, we will check how to install 32-bit Wine 1.8 on CentOS 7. We will use Wine 1.8.5 as the example.

One single script to build and install Wine

The whole process in this post has already been written as a shell script install-wine-i686-centos7.sh. You may download the script and run it directly as root to install wine.

wine-1-8-32-bit-centos-7

Build and install Wine manually step by step

The following part of this post introduces what each step does.

Erase old wine versions installed

If you ever installed wine packages, erase them first as we will build wine from the source.

yum erase wine wine-*

Install packages needed to build wine

We are going to install the packages needed to build wine. These may not be sufficient depending on your base installation packages. If later steps complain that some packages are missing, you can install them.

yum install samba-winbind-clients -y
yum groupinstall 'Development Tools' -y
yum install libjpeg-turbo-devel libtiff-devel freetype-devel -y
yum install libgcc.i686 libX11-devel.i686 freetype-devel.i686 gnutls-devel.i686 libxml2-devel.i686 libjpeg-turbo-devel.i686 libpng-devel.i686 libXrender-devel.i686 -y

Download and unpack the source package

Here, we use a variable $ver to specify the version we want to install. It will be used in later steps too.

ver=1.8.5
cd /usr/src
wget http://dl.winehq.org/wine/source/1.8/wine-${ver}.tar.bz2 -O wine-${ver}.tar.bz2
tar xjf wine-${ver}.tar.bz2

Build wine 32-bit and 64-bit versions

Make directories for building wine 32-bit and 64-bit versions.

cd wine-${ver}/
mkdir -p wine32 wine64

Build the 64-bit version first as 32-bit version building depends on it.

cd wine64
../configure --enable-win64
make -j 4

Build the 32-bit version now.

cd ../wine32
../configure --with-wine64=../wine64
make -j 4

Install wine 32-bit and 64-bit versions

Now, we can install Wine. The trick is to install 32-bit version first and then the 64-bit version.

As we are still in the win32 directory, run

make install

Install the 64-bit version:

cd ../wine64
make install

By now, if everything goes well, you have successfully installed the Wine 32-bit and 64-bit versions. You may double-check it with the file command:

$ file `which wine`
/usr/local/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=a83b9f0916e6c0d5427e2c38a172c93bd8023d98, not stripped
$ file `which wine64`
/usr/local/bin/wine64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=4d8e8468402bc63bd2a72c59c57fcad332235d41, not stripped

Note the “ELF 32-bit” and “ELF 64-bit” in the file type strings.

Now you can run your 32-bit Windows application on CentOS 7. Enjoy :-)

Eric Zhiqiang Ma

Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

2 comments:

  1. i just try the script and got this error:
    ../../../dlls/vbscript/parser.y: conflicts: 7 shift/reduce
    ../../../dlls/winex11.drv/x11drv_main.c: In function ‘process_attach’:
    ../../../dlls/winex11.drv/x11drv_main.c:536:33: error: ‘SONAME_LIBX11’ undeclared (first use in this function)
    void *libx11 = wine_dlopen( SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL, error, sizeof(error) );
    ^
    ../../../dlls/winex11.drv/x11drv_main.c:536:33: note: each undeclared identifier is reported only once for each function it appears in
    make[1]: *** [x11drv_main.o] Error 1
    make: *** [dlls/winex11.drv] Error 2
    make: *** Waiting for unfinished jobs....
    [root@svr1 ~]# wine
    -bash: /usr/bin/wine: No such file or directory

    what was i am missing?

    1. `SONAME_LIBX11` seems a macro defined by `wine` src. Might be something wrong during the `./configure` step.

      Did you use the script or do the steps manually? If you run the script, you might paste the log (the log file is shown at the very beginning of the STDOUT) to let us take a look.

Leave a Reply

Your email address will not be published. Required fields are marked *