31

Currently I'm running Ubuntu 11.10 64 Bit on my laptop and I want to install some Windows programs with Wine (Dreamweaver CS5/Starcraft II etc) but these programs require the 32Bit version of Wine to work even being in a 64Bit environment... I'm a Fedora user most of the time and in that distro installing 32Bit versions of apps inside of a 64Bit system is never a problem, but didn't find a way to do that on Ubuntu.

30

Things have changed a few times since my original answer. 64bit prefixes versions of Wine are pretty capable these days. I haven't had a pure 32bit version in at least a few years.

Your "Wine prefix" (traditionally at ~/.wine/, but settable via env WINEPREFIX) controls how things will be run for the lifetime of that prefix. If you set up a 32bit prefix, everything will run in 32bit mode in that prefix. Conversely, if you don't do anything and run anything special, you'll create a Wine64 environment.

If you're starting a new prefix (ie on a new install of Ubuntu), you'll need to do a few special things:

# Move the old prefix (if one exists)
# You could rm -rf it if you don't want it.
mv ~/.wine/ ~/oldwine/

# Create prefix with right arch, per
# http://wiki.winehq.org/FAQ#32_bit_wineprefix
WINEARCH=win32 winecfg

And that's it. Unless you're specifying another prefix that doesn't exist yet, you shouldn't need to set WINEARCH again.

The revision history to this answer holds additional information that I don't think is relevant in 2018. This is mostly point and shoot these days.

  • Fixed the problem: Installed Wine 1.2 via PlayOnLinux and then ran the apps that won't run via the terminal, looked at the output. In the case of dreamweaver, it was matter of installing "vcrun2008" using winetricks. It runs fine now, thanks! – Manuel Escudero Nov 4 '11 at 21:32
  • This seems to be incomplete. I get wine: invalid directory prefix32 in WINEPREFIX: not an absolute path. – Sören Sep 17 '18 at 18:34
22

Step 1: Install wine 1.4. This version of wine supports win32 and win64.

Step 2: Open a terminal.

Step 3: export WINEPREFIX=prefix32

Step 4: export WINEARCH=win32

Step 5: winecfg

Step 6: Enjoy, the new prefix is set for 32-bit execution.

This is the proper way to do this. Installing cross-arch packages is a dirty fix that's likely to cause you trouble.

  • Steps 3 and 4 solve many wine problems and performance issues with several games. This is a must when installing Wine on a 64 bit OS. – Luis Alvarado May 31 '13 at 0:50
  • 4
    @Relish I tried to execute these commands. I'm getting error: wine: invalid directory prefix32 in WINEPREFIX: not an absolute path – shravan Oct 1 '15 at 23:42
  • 1
    winecfg returns: it looks like wine32 is missing, you should install it. – shantanu Jan 4 '17 at 8:46
  • @shravan Did you read the error message? The problem is that your WINEPREFIX path isn't an absolute path. – Relish Jan 6 '17 at 22:33
  • 1
    This does not work wine: invalid directory prefix32 in WINEPREFIX: not an absolute path – Sören Sep 17 '18 at 18:25
4

The best ways to do this:

  1. (Permanently) Edit /etc/environment:

    • sudo nano /etc/environment

    • Add the following line:

      WINEARCH=win32

    Note: by the above solution, wine & wibom use always the 32 bit version of wine.

  2. (Temporary) Open a terminal(Ctrl-Alt-t) and type:

    • `env WINEARCH=win32 wine or
    • `env WINEARCH=win32 winecfg for 1st .wine 32 bit bottle
2

On Ubuntu Oneiric, the 32-bit binaries and libraries of Wine are installed by default. No special action is necessary other than installing wine.

Confirmed with:

$ file `which wine`
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
  • 1
    Not valid anymore with recent ubuntu versions – mablae Mar 28 '15 at 23:39
  • Indeed, it seems to not a valid confirmation. When I use winetricks -q dotnet30 I get You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug. – Sören Sep 17 '18 at 18:31
2

. Was having the same problem. I just upgraded to Ubuntu 14.04 64-bit and was trying to get Office 2007 to work. It won't run in a 64-bit wine configuration. After a lot of searching, this is what I came across:

  • The folder in which all your wine software are installed is known as your WINEPREFIX. By default this folder resides in your home (~) directory by the name '.wine'. There can be more than one WINEPREFIX.
  • There also exists an environment variable known as WINEARCH which represents the mode of your current wine settings, i.e. 64-bit or 32-bit.
  • THIS IS IMPORTANT. At the time of the creation of a WINEPREFIX the value of WINEARCH decides the mode in which wine will function when running applications from that WINEPREFIX.

By default the WINEARCH variable is set to the value 'win64' (stands for 64-bit) on a 64-bit Ubuntu installation therefore the automatically created WINEPREFIX has a 64-bit operation mode. In order to change this mode we need to 1) delete the current WINEPREFIX. 2) set WINEARCH to 'win32' 3)Create a new WINEPREFIX. The Steps: NOTE: These steps are to be done after installing wine. You can easily do that using the Ubuntu Software Center. search for Wine 1.6 and click install.

  1) Open up the terminal by pressing Ctrl + Alt + T. And type the following commands:
   cd ~
   rm -rf .wine
   rm -f .config/menus/applications-merged/wine*
   rm -rf .local/share/applications/wine
   rm -f .local/share/desktop-directories/wine*
   rm -f .local/share/icons/????_*.xpm 

   2) Now to set your enviroment variable and also to create your new 32-bit WINEPREFIX go ahead and type:
   WINEARCH=win32 WINEPREFIX=~/.wine winecfg

That's about it I guess! This worked for me! now all you need to do is to install your 32-bit applications.

  • I found this solution above working for Ubuntu 16.10, the other solutions give a winecfg fail of wine: invalid directory prefix32 in WINEPREFIX: not an absolute path Aborted . – Svetlana Belkin Feb 19 '17 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.