Linux Notes: WINE for CentOS-7 (and higher)

  1. The information presented here is intended for educational use by qualified computer technologists.
  2. The information presented here is provided free of charge, as-is, with no warranty of any kind.
Edit: 2022-10-22

WINE on CentOS-7

================================================================================================
title: wine32_64_notes.txt
creat: 2022-09-14 :: NSR
edit : 2022-10-08 :: NSR
linux: CentOS-7.9
notes:
1) I need to run comm-press-2000 (a 32-bit program targeted at windows-98 + windows-nt)
2) what follows are the results of a lot of experiments on CentOS-7
3) stanzas
        1) basic wine info (after a vanilla install from a repo)
        2) easist way to install wine-4 on CentOS-7
        3) build your own 32-bit version of wine-4.0.4
        4) testing your own 32-bit version of wine-4.0.4
        5) observations after a 32-bit only build + install
================================================================================================

        1) basic wine info (after a vanilla install from a repo)
        ==================

1)  ls -lad /usr/bin/win*       # view all 12 wine programs after a repo install
2) '/usr/bin/wine64' can only run 64-bit programs (x86-64) and is optional -+- need one or both
3) '/usr/bin/wine32' can only run 32-bit programs (i686)   and is optional -+
4) 'wine64' and 'wine32' do all the work for commands 'wine' and 'wineconsole' which are usually
   small startup scripts (under 2k bytes in size)
5) The wine script requires you to provide a windows-program in the linux directory (so you
   cannot use Windows shell commands like 'DIR'). It will inspect the windows-program header
   then will start either wine64 and wine32
6) The wineconsole script works the same way as wine with the exception that a windows-program
   is optional. If a windows-program is not specified then wineconsole will start the highest
   available wine binary resulting in a windows shell prompt. You could now type DIR
   CAVEAT: if wine64 was used then you will not be able to run 32-bit windows programs
7) using wine from linux:
    a) 'wine'        win-program.exe (best used with graphical windows programs via x-windows)
    b) 'wineconsole' win-program.exe (best used with non-graphical windows programs)
    c) 'wine' requires you to provide a windows-program in the linux directory (you cannot
       specify Windows shell commands like 'DIR')
    d) 'wineconsole' does not require you to provide a windows-program in the linux directory
       but you should do so anyway to ensure you start the correct binary
    e) running 'wineconsole' without specifying a program will show something like this:
       Microsoft Windows 6.1.7601 (4.0.4)
       Z:\home\neil\wine>
       --------------------------------------------------------------------------------------
       1) you should not have see any startup verbage (but if you did then you should only
          see it one time while the system creates directory ~/.wine in the current user's
           $HOME folder) 
       2) the prompt indicates that I typed wineconsole from Linux folder /home/neil/wine
       3) now windows commands like 'dir' are possible
    f) everytime you run either 'wine' or 'wineconsole', winecfg be run to first load
       configuration settings from the user's settings folder: ~./wine/
    g) If folder ~./wine/ is not found then a new one will be created for you that might
       look like this: 
                [neil@kawc4n ~]$ ls -la ~/.wine/
                total 1260
                drwxr-xr-x.  4 neil admgrp     117 Sep 14 11:51 .
                drwx------. 43 neil admgrp   16384 Sep 14 12:23 ..
                drwxr-xr-x.  2 neil admgrp     122 Sep 14 11:51 dosdevices
                drwxr-xr-x.  6 neil admgrp      74 Sep 13 16:47 drive_c
                -rw-r--r--.  1 neil admgrp 1222555 Sep 14 11:51 system.reg
                -rw-r--r--.  1 neil admgrp      11 Sep 13 16:47 .update-timestamp
                -rw-r--r--.  1 neil admgrp    3228 Sep 13 16:47 userdef.reg
                -rw-r--r--.  1 neil admgrp   34308 Sep 14 11:51 user.reg
                [neil@kawc4n ~]$
    h) If you change or update wine in anyway, the wine utilities will continue to use existing
        settings folders which may cause problems. The only way to correct this is to delete the
        settings folder like so:
                cd $HOME        # go to your home folder
                rm -fr ./wine   # delete hidden folder '.wine' and everything in it
    i) if you ever see this error message:
        wine: Bad EXE format for Z:\home\neil\wine-hacks\someprogram.exe
        then a 32-bit program was passed to wine64
        or a 64-bit was program to wine32
================================================================================================

        2) easist way to install wine-4 on CentOS-7
        ===========================================

0) if you DO NOT need to run 64-bit windows programs then DO NOT install wine64
1) to install wine64:   yum install wine.x86-64
                        or download the rpm file then install it like so:
                        yum install ./wine-4.0.4-1.el7.rpm
2) to install wine32:   yum install wine.i686
                        or if on CentOS-7 (where it is not available) then
3) to install wine32:   wget https://harbottle.gitlab.io/wine32/7/i386/wine32-release.rpm 
                        yum install ./wine32-release.rpm
                        yum install wine.i686

caveat: these steps worked perfectly on our development server. However, on our production
server 'wine.i686' trys to install dependency unixODBC.i686 (2.3.1-14) which yum sees as a
version conflict with installed package unixODBC.x86_64 (2.3.7-1) so the transaction test fails
================================================================================================

        3) build your own 32-bit version of wine-4.0.4
        ==============================================

sudo yum grouplist                                      # view choices
sudo yum -y groupinstall 'Development Tools'            # probably already installed
sudo yum -y groupinstall 'Compatibility Libraries'      # support for i686 apps
#
#  This next line adds i686 support to gcc (gnu compiler collection)
#
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
#
# surf to here: https://dl.winehq.org/wine/source/4.0/
# then fetch file: wine-4.0.4.tar.xz
#
tar -xvf wine-4.0.4.tar.xz                              # unpack files into: wine-4.0.4/
lscpu                                                   # can we run both 32-bit and 64-bit software?
cd wine-4.0.4                                           # drop down one level
./configure --help                                      # view available options
./configure             | tee nsr_step1.txt             # default to just a 32-bit build
#
# The last line should read: "configure: Finished.  Do 'make' to compile Wine."
# If you see ANY warnings then I advise you to install additional dependancies (see next section)
# note: even if you do not intend to use x11 or x-windows, wine still needs the associated libraries
#
make                    | tee nsr_step2.txt             # should not see "-m32 no gcc support for 32-bit apps"
                                                        # requires ~ 75 minutes (using one cpu)
sudo make install       | tee nsr_step3.txt             # wine is installed without rpm or yum
# question: what will happen to wine when I use yum to update a library in the future?
================================================================================================
#
#       4) testing your own 32-bit version of wine4
#
#       4a) if you ever typed 'make install'
#       then
#          type: wine
#          you should only see this response:
		Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
		       wine --help                   Display this help and exit
		       wine --version                Output version information and exit
		[neil@kawc0f wine]
#          type: wineconsole
#          ----------------------------------------------------------------
#          note: this will create a preferences directory ".wine" in your home directory
#          if you see any error messages then do this:
#          cd                   # navigate to your home directory
#          rm -fr .wine         # delete your wine preferences directory
#          cd wine-4.0.4        #
#          sudo make uninstall  # (only necessary if you ever typed 'make install')
#       end
# # 4b) install these WINE dependencies: # sudo yum install \ glibc-devel.i686 dbus-devel.i686 freetype-devel.i686 pulseaudio-libs-devel.i686 libX11-devel.i686 \ mesa-libGLU-devel.i686 libICE-devel.i686 libXext-devel.i686 libXcursor-devel.i686 libXi-devel.i686 \ libXxf86vm-devel.i686 libXrender-devel.i686 libXinerama-devel.i686 libXcomposite-devel.i686 \ libXrandr-devel.i686 mesa-libGL-devel.i686 mesa-libOSMesa-devel.i686 libxml2-devel.i686 \ libxslt-devel.i686 zlib-devel.i686 gnutls-devel.i686 ncurses-devel.i686 sane-backends-devel.i686 \ libv4l-devel.i686 libgphoto2-devel.i686 libexif-devel.i686 lcms2-devel.i686 gettext-devel.i686 \ isdn4k-utils-devel.i686 cups-devel.i686 fontconfig-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 \ pkgconfig.i686 libtiff-devel.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 \ freeglut-devel.i686 giflib-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 \ libXmu-devel.i686 libXxf86dga-devel.i686 libieee1284-devel.i686 libpng-devel.i686 librsvg2-devel.i686 \ libstdc++-devel.i686 libusb-devel.i686 qt-devel.i686 libpcap-devel.i686 # # BUT NOT unixODBC.i686 unixODBC-devel.i686 (for the reasons mentioned in stanza-2 above) # 4c) restart the build process: ./configure | tee nsr_step1.txt # ================================================================================================ # # 5) observations after a 32-bit only build + install # # [neil@kawc4n ~]$ ls -la /usr/local/bin/wine* # -rwxr-xr-x. 1 root root 17348 Sep 13 16:46 /usr/local/bin/wine # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/wineboot # -rwxr-xr-x. 1 root root 247180 Sep 13 16:46 /usr/local/bin/winebuild # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/winecfg # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/wineconsole # lrwxrwxrwx. 1 root root 7 Sep 13 16:46 /usr/local/bin/winecpp -> winegcc # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/winedbg # -rwxr-xr-x. 1 root root 451936 Sep 13 16:46 /usr/local/bin/winedump # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/winefile # lrwxrwxrwx. 1 root root 7 Sep 13 16:46 /usr/local/bin/wineg++ -> winegcc # -rwxr-xr-x. 1 root root 77352 Sep 13 16:46 /usr/local/bin/winegcc # -rwxr-xr-x. 1 root root 95099 Sep 13 16:46 /usr/local/bin/winemaker # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/winemine # -rwxr-xr-x. 1 root root 1973 Sep 13 16:46 /usr/local/bin/winepath # -rwxr-xr-x. 1 root root 31520 Sep 13 16:46 /usr/local/bin/wine-preloader # -rwxr-xr-x. 1 root root 2846424 Sep 13 16:46 /usr/local/bin/wineserver # [neil@kawc4n ~]$ # # # 5a) Testing some apps with 'file' # [neil@kawc4n ~]$ file /usr/local/bin/wineconsole /usr/local/bin/wineconsole: POSIX shell script, ASCII text executable [neil@kawc4n ~]$ file /usr/local/bin/wine /usr/local/bin/wine: ELF 32-bit LSB executable, Intel 80386, ... # # Notes: # 1) anything with a size of 1973 (including 'wineconsole') is a script # 2) notice that 'wine' is a program and there is no instance of wine32 # (when either wine32 or wine64 exists, 'wine' is replaced with a script # ================================================================================================

Links


Back to Home
Neil Rieck
Waterloo, Ontario, Canada.