How do I run a 32 bit windows game on a 64 bit ubuntu machin

Questions about Wine on Linux
Locked
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

How do I run a 32 bit windows game on a 64 bit ubuntu machin

Post by jobsworth6912 »

How do I run a 32 bit windows game on a 64 bit ubuntu machine?

My favorite operating system is Ubuntu Linux.
My favorite game is Soldier of Fortune 2 which runs on Microsoft Windows.

I tried wine about 5 years ago and it totally corrupted my system.
I partitioned my hard drive into 2, C: and D:
I installed Windows XP on C: and Ubuntu 9 on D:.
I installed wine on Ubuntu and tried to install my game which destroyed C:.

So I have been somewhat reluctant to try wine again but this time I was impressed.

I run Ubuntu 10.10 32 bit on a 32 bit laptop
and with wine my game works but rather slowly. The laptop is old and slow.

I run Ubuntu 11.04 64 bit on a 64 bit amd pc
and with wine my game does not work.
Something about a page fault on a 32 bit instruction.

There are some complicated instructions about how to compile a 64 bit version of wine which accepts 32 bit applications.

Do I really need to do this or is this something that the kind developer is working on?

Any comment at all would be gratefully received.
User avatar
dimesio
Moderator
Moderator
Posts: 13201
Joined: Tue Mar 25, 2008 10:30 pm

Re: How do I run a 32 bit windows game on a 64 bit ubuntu ma

Post by dimesio »

jobsworth6912 wrote: I tried wine about 5 years ago and it totally corrupted my system.
I partitioned my hard drive into 2, C: and D:
I installed Windows XP on C: and Ubuntu 9 on D:.
I installed wine on Ubuntu and tried to install my game which destroyed C:.
I gather you tried to install it to your Windows partition. Don't make the same mistake again. http://wiki.winehq.org/FAQ#head-497f1a2 ... 2c7767afa2
I run Ubuntu 11.04 64 bit on a 64 bit amd pc
and with wine my game does not work.
Something about a page fault on a 32 bit instruction.
People run 32 bit Wine in 64 bit systems all the time, and unless you built Wine yourself, that's what you are doing. Ubuntu only provides 32 bit packages. You may be missing a 32 bit library, though. Post terminal output.

You didn't say what Wine version. If it's not the latest development release, upgrade.
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

Post by jobsworth6912 »

Thank you for your prompt reply.
Yes that must be it. I am missing a library.
Here is the terminal output. It is rather large.
john@johnhuge:~$ cd "/home/john/.wine/drive_c/Program Files/Soldier of Fortune II - Double Helix"
john@johnhuge:~/.wine/drive_c/Program Files/Soldier of Fortune II - Double Helix$ wine Sof2.exe
wine: Unhandled page fault on read access to 0x6d756363 at address 0x6d756363 (thread 0009), starting debugger...
Unhandled exception: page fault on read access to 0x6d756363 in 32-bit code (0x6d756363).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:6d756363 ESP:00a2eab0 EBP:00a2fcf0 EFLAGS:00010206( R- -- I - -P- )
EAX:103fa454 EBX:00000000 ECX:00000000 EDX:00000001
ESI:107996c0 EDI:102b704c
Stack dump:
0x00a2eab0: 00000a0a 00a2eac0 100f11dc 00a2fac8
0x00a2eac0: 455f4c47 4e455458 4e4f4953 20203a53
0x00a2ead0: 415f4c47 635f4252 726f6c6f 6675625f
0x00a2eae0: 5f726566 616f6c66 4c472074 4252415f
0x00a2eaf0: 706f635f 75625f79 72656666 5f4c4720
0x00a2eb00: 5f425241 74706564 6c635f68 20706d61
Backtrace:
=>0 0x6d756363 (0x00a2fcf0)
1 0x100205cf in sof2 (+0x205ce) (0x00a2fe90)
2 0x7b8598cc call_process_entry+0xb() in kernel32 (0x00a2fea8)
3 0x7b85a96f in kernel32 (+0x4a96e) (0x00a2fee8)
4 0x7bc72f18 call_thread_func+0xb() in ntdll (0x00a2fef8)
5 0x7bc766ae in ntdll (+0x666ad) (0x00a2ffc8)
6 0x7bc4a91e call_dll_entry_point+0x61d() in ntdll (0x00a2ffe8)
0x6d756363: -- no code accessible --
Modules:
Module Address Debug info Name (63 modules)
PE 10000000-10848000 Export sof2
ELF 7a0de000-7b800000 Deferred libnvidia-glcore.so.270.41.06
ELF 7b800000-7b9aa000 Dwarf kernel32<elf>
\-PE 7b810000-7b9aa000 \ kernel32
ELF 7bc00000-7bcc4000 Dwarf ntdll<elf>
\-PE 7bc10000-7bcc4000 \ ntdll
ELF 7bf00000-7bf04000 Deferred <wine-loader>
ELF 7e2c8000-7e396000 Deferred libgl.so.1
ELF 7e3bc000-7e471000 Deferred opengl32<elf>
\-PE 7e3d0000-7e471000 \ opengl32
ELF 7e4d1000-7e4d7000 Deferred libxfixes.so.3
ELF 7e4d7000-7e4e1000 Deferred libxcursor.so.1
ELF 7e4e1000-7e4f0000 Deferred libxi.so.6
ELF 7e4f0000-7e4f4000 Deferred libxcomposite.so.1
ELF 7e4f4000-7e4fc000 Deferred libxrandr.so.2
ELF 7e4fc000-7e506000 Deferred libxrender.so.1
ELF 7e506000-7e50c000 Deferred libxxf86vm.so.1
ELF 7e50c000-7e510000 Deferred libxinerama.so.1
ELF 7e510000-7e532000 Deferred imm32<elf>
\-PE 7e520000-7e532000 \ imm32
ELF 7e532000-7e538000 Deferred libxdmcp.so.6
ELF 7e538000-7e53c000 Deferred libxau.so.6
ELF 7e53c000-7e555000 Deferred libxcb.so.1
ELF 7e555000-7e55a000 Deferred libuuid.so.1
ELF 7e55a000-7e675000 Deferred libx11.so.6
ELF 7e675000-7e684000 Deferred libxext.so.6
ELF 7e684000-7e69c000 Deferred libice.so.6
ELF 7e69c000-7e6a4000 Deferred libsm.so.6
ELF 7e6ad000-7e6af000 Deferred libnvidia-tls.so.270.41.06
ELF 7e6ca000-7e770000 Deferred winex11<elf>
\-PE 7e6d0000-7e770000 \ winex11
ELF 7e7ad000-7e7d7000 Deferred libexpat.so.1
ELF 7e7d7000-7e806000 Deferred libfontconfig.so.1
ELF 7e806000-7e81b000 Deferred libz.so.1
ELF 7e81b000-7e8a1000 Deferred libfreetype.so.6
ELF 7e8a1000-7e8d8000 Deferred libncurses.so.5
ELF 7e8fe000-7e927000 Deferred msacm32<elf>
\-PE 7e900000-7e927000 \ msacm32
ELF 7e927000-7e99c000 Deferred rpcrt4<elf>
\-PE 7e930000-7e99c000 \ rpcrt4
ELF 7e99c000-7eaa2000 Deferred ole32<elf>
\-PE 7e9b0000-7eaa2000 \ ole32
ELF 7eaa2000-7eb48000 Deferred gdi32<elf>
\-PE 7eab0000-7eb48000 \ gdi32
ELF 7eb48000-7ec86000 Deferred user32<elf>
\-PE 7eb60000-7ec86000 \ user32
ELF 7ec86000-7ed26000 Deferred winmm<elf>
\-PE 7ec90000-7ed26000 \ winmm
ELF 7ed26000-7ed86000 Deferred advapi32<elf>
\-PE 7ed30000-7ed86000 \ advapi32
ELF 7ef86000-7ef92000 Deferred libnss_files.so.2
ELF 7ef92000-7ef9d000 Deferred libnss_nis.so.2
ELF 7ef9d000-7efb4000 Deferred libnsl.so.1
ELF 7efb4000-7efda000 Deferred libm.so.6
ELF 7efe7000-7f000000 Deferred version<elf>
\-PE 7eff0000-7f000000 \ version
ELF f7497000-f749f000 Deferred libnss_compat.so.2
ELF f74a1000-f74a5000 Deferred libdl.so.2
ELF f74a5000-f7602000 Deferred libc.so.6
ELF f7602000-f761b000 Deferred libpthread.so.0
ELF f7641000-f7782000 Dwarf libwine.so.1
ELF f7784000-f77a2000 Deferred ld-linux.so.2
ELF f77a2000-f77a3000 Deferred [vdso].so
Threads:
process tid prio (all id:s are in hex)
00000008 (D) C:\Program Files\Soldier of Fortune II - Double Helix\Sof2.exe
00000009 0 <==
0000000e services.exe
0000001f 0
0000001e 0
00000018 0
00000017 0
00000015 0
00000010 0
0000000f 0
00000012 winedevice.exe
0000001a 0
00000019 0
00000014 0
00000013 0
0000001b plugplay.exe
00000020 0
0000001d 0
0000001c 0
00000021 explorer.exe
00000022 0
Backtrace:
=>0 0x6d756363 (0x00a2fcf0)
1 0x100205cf in sof2 (+0x205ce) (0x00a2fe90)
2 0x7b8598cc call_process_entry+0xb() in kernel32 (0x00a2fea8)
3 0x7b85a96f in kernel32 (+0x4a96e) (0x00a2fee8)
4 0x7bc72f18 call_thread_func+0xb() in ntdll (0x00a2fef8)
5 0x7bc766ae in ntdll (+0x666ad) (0x00a2ffc8)
6 0x7bc4a91e call_dll_entry_point+0x61d() in ntdll (0x00a2ffe8)
john@johnhuge:~/.wine/drive_c/Program Files/Soldier of Fortune II - Double Helix$
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

Post by jobsworth6912 »

john@johnhuge:~/.wine/drive_c/Program Files/Soldier of Fortune II - Double Helix$ wine --version
wine-1.3.29
User avatar
blaiseg07
Level 2
Level 2
Posts: 31
Joined: Mon Sep 26, 2011 4:08 pm

Post by blaiseg07 »

Unfortunately there's not much to go on with the debug output you posted. Maybe you can find some tricks/tips on it's AppDb page - http://appdb.winehq.org/objectManager.p ... =&iId=1116
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

Post by jobsworth6912 »

And now finally it works.
The problems with this game under wine are the same as under windows xp.
The error messages are meaningless probable deliberately so to avoid hacking.
The installation cds were corrupt and one of the .pak files was faulty.
replace the .pak files with good ones and it works.
But there is still a lot of tweaking to do.
It would be nice to have an icon on the desktop to start the game or a menu entry.
Wine does sometimes generate menu entries but for this game I have to browse with nautilus to .wine and then to SoF2.exe, right click on it and then select wine.
winecfg-->drives must include /media/sofii_1 or it cannot find the cd.
Some of the patches available online to avoid the need for a cd contain viruses and so are not to be trusted (password stealers).
There is no easy way to implement the path variable under wine except using wine regedit and even then wine cannot find SoF2.exe.
But I love wine more and more. It should be possible to have a launcher on the desktop containing "wine SoF2.exe".
Many other windows applications can be used like my favorite text editor ultra edit, and games like sol and bgammon.
I just wish now that I know how to implement set path so that program starting is easier.
There must also be a way to join dosbox with wine so that starting old dos games would be easier.
Once again thank you to the developers of wine for the many unpaid hours that have gone into this project.
Hopefully I will never need to use Microsoft windows again.
It was only useful for games.
You cannot expect developers to donate the man years that it takes to write a game for free.
Martin Gregorie

How do I run a 32 bit windows game on a 64 bit ubuntu machin

Post by Martin Gregorie »

On Sun, 2011-11-13 at 19:37 -0600, jobsworth6912 wrote:
It would be nice to have an icon on the desktop to start the game or
a menu entry.
Ubuntu almost certainly has a method for creating an application
launcher for your game though I don't know where it is or what its
called because I don't use Ubuntu. On Fedora it is part of the "Main
Menu" system tool.
Wine does sometimes generate menu entries but for this game I have to
browse with nautilus to .wine and then to SoF2.exe, right click on it and then select wine.
winecfg-->drives must include /media/sofii_1 or it cannot find the cd.
IMO the best way to do all this is to write a wrapper script for the
game and point the launcher at that rather than the EXE. See
http://www.libelle-systems.com/free/win ... cript.html
and/or search the Wine forum archives for "wrapper script".
There is no easy way to implement the path variable under wine except
using wine regedit and even then wine cannot find SoF2.exe.
The link above also tells you how to change the search path.


Martin
sgsdxzy
Level 2
Level 2
Posts: 18
Joined: Wed Nov 02, 2011 7:03 am

Post by sgsdxzy »

You can write a shell script, which will do all the command line work for you. Just list your commands in an empty file line by line, then chmod +x it. You can run it and it does the same things you have to do every time.
If you are more experienced, you can write a .desktop file, which behaves just like a desktop shortcut, and place it in the right place.
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

short cuts

Post by jobsworth6912 »

Thank you Martin Gregorie and sgsdxzy for your helpful posts.
I tried it and it works. I now have a script on my desktop called sof2:-

#!/bin/bash
export WINEPREFIX=$HOME/.wine/drive_c
cd $WINEPREFIX/"Program Files/Soldier of Fortune II - Double Helix"
wine SoF2.exe

Before I had a similar script:-

#!/bin/bash
cd "/home/john/.wine/Program Files/Soldier of Fortune II - Double Helix"
wine SoF2.exe

which did not work and I don't know why (both were CHMOD 755).

I also created a .bash_profile file in /home/john:-

PATH=$HOME/bin:$PATH
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

Also I created a folder /home/john/bin
and copied in the file sof2 so that now I can type sof2 in a terminal and that works also.
I get asked for my CD which is there but which it cannot find.

BUT I still have to browse to .wine and then to SoF2.exe right click on it and then select wine from the menu to start the game.
Otherwise it cannot find my sofii_1 CD despite adding D: /media/sofii_1 as a CD ROM in my winecfg-->drives.

I still have much more to learn but I thank you for your help.
User avatar
SpawnHappyJake
Level 5
Level 5
Posts: 272
Joined: Sun Feb 06, 2011 5:57 am

Post by SpawnHappyJake »

I smell a prefix problem. ./wine should be the prefix. Not ./wine/drive_c . Is there a drive_c folder in your drive_c folder?

Make sure you "add the CD" to the winecfg of the prefix you are running the game from.

Cheers,
Jake
jobsworth6912
Level 1
Level 1
Posts: 6
Joined: Mon Oct 17, 2011 11:41 am

Post by jobsworth6912 »

Yes you are right I meant to post:-

#! /bin/bash
cd "/home/john/.wine/drive_c/Program Files/Soldier of Fortune II - Double Helix"
wine SoF2

which does work from my /bin folder but not the desktop.
I guess that is another story.

Yes I do specify CD ROM in winecfg - drives.
D:\media\sofii_1
Even the \sofii_1 should be unnecessary.

I still have to browse to the folder and right click on SoF2.exe
in order to find the CD and so start the game.
I think it is to do with the game and not wine.
Martin Gregorie

How do I run a 32 bit windows game on a 64 bit ubuntu machin

Post by Martin Gregorie »

On Tue, 2011-11-15 at 19:25 -0600, jobsworth6912 wrote:
Thank you Martin Gregorie and sgsdxzy for your helpful posts.
I tried it and it works. I now have a script on my desktop called sof2:-

#!/bin/bash
export WINEPREFIX=$HOME/.wine/drive_c
cd $WINEPREFIX/"Program Files/Soldier of Fortune II - Double Helix"
wine SoF2.exe
This would be better written as:

#!/bin/bash
export WINEPREFIX=$HOME/.wine
cd "$WINEPREFIX/drive_c/Program Files/Soldier of Fortune II - Double
Helix"
wine SoF2.exe

because $WINEPREFIX has other uses besides being part of the directory
name you're changing directory into. As it is defined as pointing to the
wine prefix (the directory whose name defaults to .wine) I'm slightly
surprised that your setup works at all. That may have something to do
with you sticking to the default wine prefix name. Where the wrapper
really shines is when you put each Wine app in a separate wine prefix:
then you don't need to remember which app is where because that's
recorded in the wrapper script.

Martin

Before I had a similar script:-

#!/bin/bash
cd "/home/john/.wine/Program Files/Soldier of Fortune II - Double Helix"
wine SoF2.exe

which did not work and I don't know why (both were CHMOD 755).

I also created a .bash_profile file in /home/john:-

PATH=$HOME/bin:$PATH
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

Also I created a folder /home/john/bin
and copied in the file sof2 so that now I can type sof2 in a terminal and that works also.
I get asked for my CD which is there but which it cannot find.

BUT I still have to browse to .wine and then to SoF2.exe right click on it and then select wine from the menu to start the game.
Otherwise it cannot find my sofii_1 CD despite adding D: /media/sofii_1 as a CD ROM in my winecfg-->drives.

I still have much more to learn but I thank you for your help.


Locked