## Pi 4, Raspbian Buster and Wine 4.0

RET80
Posts: 22
Joined: Mon Dec 19, 2016 10:52 pm

### Pi 4, Raspbian Buster and Wine 4.0

Hi everyone,

So, I have the latest Raspberry Pi board (the 2GB model) and it's a fantastic board, lots of performance!
I wanted to test out Wine on the Raspberry Pi now that it comes with the newly designed Buster Raspbian OS. I did a:

Code: Select all

sudo apt-get install wine  
and typed in 'winecfg', the configuration window came up; everything looks good!

But, I'm running into a problem. I was going to test Hover! (You know, that really old Windows 95 game?) and wine came back and prompted me:

Code: Select all

wine: Bad EXE format for F:\home\pi\Desktop\Hover\HOVER.EXE.
It looks like it's not liking any win32-based applications?
Has anyone ran into this problem as well?
How can I get a 32-bit application running with Raspbian's version of Wine? Any help would be great. I know what I'm doing is pretty fringe, but I'll be using this with other 32-bit applications soon.
"Just because you invested your valuable time in compensating for a software designer’s madness, does not mean the software is good. It means you don’t value your own time as much as you should. "

DougieLawson
Posts: 38510
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

### Re: Pi 4, Raspbian Buster and Wine 4.0

WINE == WINE IS NOT [an] EMULATOR

Wine is a Linux library that provides some Windows GUI functions for native Linux programs. It doesn't mean you can run an X86 or X86_64 based program on an ARM based processor.

You're out of luck unless you can find a viable X86/X86_64 emulator.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

RET80
Posts: 22
Joined: Mon Dec 19, 2016 10:52 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

DougieLawson wrote:
Wed Jul 03, 2019 12:40 am
WINE == WINE IS NOT [an] EMULATOR

Wine is a Linux library that provides some Windows GUI functions for native Linux programs. It doesn't mean you can run an X86 or X86_64 based program on an ARM based processor.

You're out of luck unless you can find a viable X86/X86_64 emulator.
Ah, you're right.
I just tested with a 64-bit program and received the same results.
I was hoping it was going to run x86 or x86_64 based applications because I heard wine was currently developing something called 'wine hangover' which is to run x86 applications on ARM, and I thought this was it (I could still be wrong?) (Here's the link: https://www.phoronix.com/scan.php?page= ... a-Released) so in this case WIAE = Wine ...is? an emulator?

I am able to run notepad.exe and explorer.exe from wine, but I'm assuming those are ARM compiled executables?
"Just because you invested your valuable time in compensating for a software designer’s madness, does not mean the software is good. It means you don’t value your own time as much as you should. "

RET80
Posts: 22
Joined: Mon Dec 19, 2016 10:52 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

I just tried the ARM64 compiled .exe binaries (which you can nab here: https://forum.xda-developers.com/devdb/ ... #downloads)
and Buster's version of WINE still complains:

Code: Select all

0009:err:process:replace_process L"F:\\home\\pi\\Downloads\\ARM64 PuTTY\\putty.exe" not supported on this installation (x86 binary)

So if it can't run x86, x86_64 or ARM64 for Windows 10 (also a .exe). ...what does it actually DO?
Maybe I'm misinterpreting its use case?
"Just because you invested your valuable time in compensating for a software designer’s madness, does not mean the software is good. It means you don’t value your own time as much as you should. "

RET80
Posts: 22
Joined: Mon Dec 19, 2016 10:52 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

Upon further investigation, it looks like Wine will only run this specific format:

Code: Select all

file iexplore.exe
iexplore.exe: PE32 executable (GUI) ARMv7 Thumb, for MS Windows

A PE32 executable for ARMv7.

The putty.exe file for Windows 10 is:

Code: Select all

file putty.exe
putty.exe: PE32+ executable (GUI), for MS Windows

So the use case for this wine is incredibly niche, to be fair, not worth the hassle at this point because this version of wine doesn't even target Windows 10, so then what could it possibly be used for? ReactOS? Regardless, too niche to be useful.

Maybe someone out there might need it some day.
"Just because you invested your valuable time in compensating for a software designer’s madness, does not mean the software is good. It means you don’t value your own time as much as you should. "

jdonald
Posts: 436
Joined: Fri Nov 03, 2017 4:36 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

RET80 wrote:
Wed Jul 03, 2019 1:30 am

So the use case for this wine is incredibly niche, ... what could it possibly be used for?
I was hoping it was going to run x86 or x86_64 based applications
Hangover is still in its infancy, and when it's ready it'll still require a 64-bit kernel.

In the meantime, what you were looking for is not Wine 4.0 on Raspbian, but Wine 4.0 Debian-i386 inside a chroot with qemu-user on Raspbian. novaspirit has a good tutorial with video, and this forum has multiple topics about setting this up from scratch with debootstrap.

Jorgisven
Posts: 1
Joined: Fri Sep 06, 2019 4:56 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

jdonald wrote:
Fri Aug 30, 2019 11:00 pm
RET80 wrote:
Wed Jul 03, 2019 1:30 am

So the use case for this wine is incredibly niche, ... what could it possibly be used for?
I was hoping it was going to run x86 or x86_64 based applications
Hangover is still in its infancy, and when it's ready it'll still require a 64-bit kernel.

In the meantime, what you were looking for is not Wine 4.0 on Raspbian, but Wine 4.0 Debian-i386 inside a chroot with qemu-user on Raspbian. novaspirit has a good tutorial with video, and this forum has multiple topics about setting this up from scratch with debootstrap.
Came here to say this. Here's the RasPi-specific walkthrough, which may accomplish the goal:
https://www.novaspirit.com/2019/04/15/run-x86-arm/

Note that x64 Win32 is not supported. But x86 Win32 is. Since many x64 apps have their x86 counterpart, it may be prudent to look for that in your target app, first.

scruss
Posts: 3072
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

### Re: Pi 4, Raspbian Buster and Wine 4.0

RET80 wrote:
Wed Jul 03, 2019 1:30 am
… not worth the hassle at this point because this version of wine doesn't even target Windows 10, so then what could it possibly be used for?
Wine lets me run the control software for a very expensive piece of machine shop hardware. This software was never developed past 32-bit Windows XP. For this - and this only - Wine on an ancient Mac is a lifesaver for me.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

jdonald
Posts: 436
Joined: Fri Nov 03, 2017 4:36 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

Welcome. Yeah, novaspirit's tutorial is solid. Note that it's a lot quicker to set up now that Raspbian Buster comes with a 3G/1G kernel. Also, I heard that starting with Buster you you can skip the odd step of copying qemu-*-static into the chroot's /usr/bin.
Jorgisven wrote:
Fri Sep 06, 2019 5:07 pm
Note that x64 Win32 is not supported.
User dqs105 reported getting qemu-x86_64-static+wine64 to work: https://www.raspberrypi.org/forums/view ... 6&start=74

rimrunner
Posts: 5
Joined: Sat Aug 24, 2019 11:44 am

### Re: Pi 4, Raspbian Buster and Wine 4.0

So how handy that solution (Novaspirit's for running win32 programs, using RPI4) actually is? Can I use it as a part of my otherwise normal operating system smoothly if I want to use just one or two Windows programs? Or would it rather need an SD card of its own?

mikerr
Posts: 2824
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

### Re: Pi 4, Raspbian Buster and Wine 4.0

The Qemu/wine method described by novaspirit isn't working in Buster last I checked (problem with wine x86)
It does work ok in Stretch.

486 speed, so only ok for some GUI apps, not games ( use DOSbox for those)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

jdonald
Posts: 436
Joined: Fri Nov 03, 2017 4:36 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

mikerr wrote:
Tue Dec 24, 2019 11:03 am
The Qemu/wine method described by novaspirit isn't working in Buster last I checked (problem with wine x86)
It does work ok in Stretch.
Well, last I checked it certainly doesn't work with a Buster chroot. With a Stretch chroot (which all the commands in novaspirit's tutorial assume) on a Raspbian Buster system it's alright.

Because the default qemu-i386 package on Raspbian seems to be broken we had to use custom builds. I posted one here and dqs105 got Wine running by switching over to qemu-x86_64-static with an amd64 chroot.
rimrunner wrote:
Tue Dec 24, 2019 10:40 am
So how handy that solution
At some point I realized that because the i386 image is shipped without vc4_dri.so, that means no graphics acceleration. For some apps that's an order of magnitude slowdown on top of another order of magnitude slowdown with CPU emulation.

You can get some mileage out of command-line programs like cmd.exe or PowerShell, but these run on Wine-ARM too (just: sudo apt install wine) or DOSBox so what's the point. At this time I'd say those interested in x86 programs on the Pi are best off sticking to DOSBox, rpix86, or ptitSeb's Box86.

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Re: Pi 4, Raspbian Buster and Wine 4.0

jdonald wrote:
Mon Jan 06, 2020 3:19 pm
You can get some mileage out of command-line programs like cmd.exe or PowerShell, but these run on Wine-ARM too (just: sudo apt install wine) or DOSBox so what's the point. At this time I'd say those interested in x86 programs on the Pi are best off sticking to DOSBox, rpix86, or ptitSeb's Box86.
Hi ! In order to at last be able to ditch my Wind*ws desktop puter (or at least, relegate it to the cup-board) I've been looking for a **simple** as possible way to run a handful Wind*ws apps (albeit even limited Wind*w3/Win16) that I **need** at hand (== have no available source and no Linux counterpart; e.g, the password generator "keymaker" I've been using for years so I can't live without) . Nothing fancy, no gaming here (ever!) - I've been browsing this (and more) threads, WHAT IS BEST, EASIEST way under the current Raspbian 32 ?
Win 3 real or std mode under DOSBOX ? Where IS "FastDOSbox" nowadays, would it work ? DOSEmu ?
I've just downloaded and tried "RPIX86" which you touted but it won't run, telling something like "can't install service, maybe running already?" . Can you please point to up-to-date, working, instructions - even better would be an installable package for automatic installation in Rasbian but I guess there isn't such a thing.

scruss
Posts: 3072
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

### Re: Pi 4, Raspbian Buster and Wine 4.0

NimbUx wrote:
Sun Apr 12, 2020 3:22 pm
… I've been looking for a **simple** as possible way to run a handful Wind*ws apps …
There is no simple way of doing this. You might be able to get Windows 3.1 running under dosbox, but it's quite a bit of work just to get the thing booted. Also, the dosbox developers do not support (and actively shut down requests for help with) running applications. Dosbox is for games, in their view. There are a mess of forks that support additional features for applications, but a) finding them, b) translating the docs (some of the cooler ones are from Japan) and c) actually getting them to compile, let alone run, on a Raspberry Pi is a major feat.

Maybe start a new thread listing the apps you need and other people might be able to suggest some. For instance, Keymaker - I'm pretty sure the encryption it uses to hold its password data won't be state of the art since it hasn't been updated since 2003, and the only version I found online appeared to contain a malicious keylogger. You could replace that with the package keepass2, aka KeePass Password Safe. It has thoughtful peer-reviewed security, so you could keep your password file on a cloud service so it's with you everywhere. My passwords have migrated from Keyring (PalmPilot, c.2003) to 1Password (Mac only, c.2007) to KeePass with little hassle.

Running x86 on a Raspberry Pi is generally a great disappointment.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Re: Pi 4, Raspbian Buster and Wine 4.0

scruss wrote:
Sun Apr 12, 2020 4:43 pm
NimbUx wrote:
Sun Apr 12, 2020 3:22 pm
… I've been looking for a **simple** as possible way to run a handful Wind*ws apps …
There is no simple way of doing this. You might be able to get Windows 3.1 running under dosbox, but it's quite a bit of work just to get the thing booted.
This part should not be too much of a problem : on my boxes running modern Wind*ws, , I have working installations of Win 3 over DOSBOX (or preferred, vDOS, a DOSBOX fork that specificly says it is "NOT for games"). Now the question becomes : how to most simply install a good compatible version of DOSBOX (or vDOS, if possible) together with the needed emulation of X86 (16 bit code, at least, preferably also 32) on the Pi 4 ?
{snip...}
Maybe start a new thread listing the apps you need and other people might be able to suggest some. For instance, Keymaker - I'm pretty sure the encryption it uses to hold its password data won't be state of the art since it hasn't been updated since 2003, and the only version I found online appeared to contain a malicious keylogger. You could replace that with the package keepass2...
Yep, I'm sure there are equivalent or better alternatives for password generators, but having been using keymaker (*not* malicious) to generate per site passwords for hundreds of services for what, 20 years, is the reason I'm not enthused about the idea of switching over.
Running x86 on a Raspberry Pi is generally a great disappointment.
I'm sure it can be, like almost everything in life, if one has too great expectations. But it's not the case here, I know what (not) to expect :=) Looking for a kludge really, not a miracle. Thank you for the hints anyway, appreciated in earnest.

jdonald
Posts: 436
Joined: Fri Nov 03, 2017 4:36 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

Sorry to hear that rpix86 has rotted. For Win16 programs all I can suggest doing is:

Code: Select all

    sudo apt install dosbox

then see how your applications hold up.

For small Win32 programs, the easiest used to be the main idea in this thread with Wine + qemu-i386, because mikerr made a ready-to-go image.

That one is tied to Pi 3B or older hardware though. With Pi 4 and Buster, unless someone has shared a consistently working *.img file, expect to work through the issues discussed here such as the default qemu installation being broken on Buster.

Starting a new thread specific to keymaker or one of your trickier apps isn't a bad idea though.

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Success: Pi 4, Raspbian Buster and DOSBox 0.74.2

Catching up, I wish to report full success running Windows 95 (original, build 950) on the R-Pi,
within DOSBox (regular version 0.74.2 from the Raspbian repository).
Adjusting and tuning the DOSBox configuration file took me bigger
efforts than I had anticipated, though - but the result is here at last, Win 95 runs beautifully
in the DOSBox, as does the "Keymaker" win32 app (version 1.2a, freeware, copyright 1999-2000 Softnik Systems) with which I have been generating almost all my passwords for 20 years... and was the
initial motivation for said efforts :=)

I don't have much of the patience and skills for making "tutos", BUT, hear, should someone be interested in seeing my DOSBox configuration file for running Win 95 in Buster, please ask and I'll make it public FWIW.

jdonald
Posts: 436
Joined: Fri Nov 03, 2017 4:36 pm

### Re: Pi 4, Raspbian Buster and Wine 4.0

That's awesome! It sounds much more straightforward than Wine + qemu-i386, given DOSBox is reasonably stable on Raspbian.

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Re: Pi 4, Raspbian Buster and Wine 4.0

jdonald wrote:
Sun May 03, 2020 11:08 pm
OK, here is a good working config file for Windows 95 (original) leaving only the options I settled on (for brevity). I shall not explain how to install and set-up Windows 95 in this DOS-Box, far off topic here, plus there are ample online tutos and guides - I will just insist on a point : to get a satisfying experience, keep to Windows 95 original edition. Don't try to fetch and install "updates" with ONE exception : get the "common controls" update (comm32upd.exe) that is really needed by many applications - and easily found, e.g. on the web archive. No OSR2, no Win98, no internet-inegrated desktop nonsense should ever touch this "virtual" machine if you want stability, please ! You won't be networking it anyway :=)

One last, useful hint : for exchanging files from/to the host on the Pi, I recommend mounting the virtual disk on a loopback device like so :
1- Important! ensure your DOSbox is closed, NOT RUNNING !
2- in terminal, use following commands (adjusting for path/name of your own disk image)

Code: Select all

$sudo losetup --partscan --find --show ./.dosbox/w95-256m1.img (if all OK system will respond w/ name of the loopback device, probably /dev/loop0) (mount it like so - assuming loop0 and your image has one main partition :$  sudo mount /dev/loop0p1 /mnt/disk
(first create the mount point, /mnt/disk/  if it had not existed yet)
3- sudo cp, or mv, files at will to/from the mounted DOW/windows partition under /mnt/disk.
4- when finished,

Code: Select all

umount /mnt/disk
(optionnally undo the loopback:

Code: Select all

\$ sudo losetup -d
) before launching the DOSBox !
-----------------------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

## NimbUx's sample DOSBox.conf : for running Windows 95-original in DOSBox (0.74.2)
#  on the Raspberry Pi 4, under Raspbian w/ regular desktop and window managers.
#  These settings are by no means 'the' absolute truth - they gave me a stable and smooth experience
#  w/ DOSBox windowed or full-screen as well. Suggested at least as a good starting point.

# Lines starting with a # are commentlines and are ignored by DOSBox.
[sdl]

fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=1404x872
# Adjust width x height according to size and resolution of your screen.

output=openglnb
autolock=true
sensitivity=100
waitonerror=true
priority=higher,lower
# or try : =higher,normal
mapperfile=mapper-0.74.map
usescancodes=true

[dosbox]

language=
machine=svga_s3
captures=capture
memsize=31
# memsize : megabytes extended memory, Adjust to needs, 15 may be enough, 31 ample; don't exceed 63!

[render]

frameskip=0
aspect=false
scaler=none

[cpu]

core=auto
cputype=auto
# has served me well. Some tutos suggest 'cpu_type=pentium_slow' instead, but breaks some apps.
# maybe use pentium_slow during Windows *installation*, and switch back to auto whene done.
cycles=auto 10000 90%
cycleup=10
cycledown=20

[mixer]

nosound=false
rate=44100
blocksize=1024
prebuffer=20

[midi]

mpu401=intelligent
mididevice=default
midiconfig=14:0

[sblaster]

sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
sbmixer=true
oplmode=auto
oplemu=default
oplrate=44100

[gus]

gus=false
gusrate=44100
gusbase=240
gusirq=5
gusdma=3

[speaker]

pcspeaker=true
pcrate=44100
tandy=auto
tandyrate=44100
disney=true

[joystick]

joysticktype=none
# Pi's don't use no joysticks ;=)

[serial]

serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]

xms=true
ems=true
umb=true
keyboardlayout=fr189
# adjust to YOUR keyboard's layout; else try =auto (didn't work well for me)

[ipx]
# ipx: Enable ipx over UDP/IP emulation.

ipx=false
# you don't want to network your Windows_95_original_in_DOSBox anyway, do you ?

[autoexec]

# Lines in this section will be run at startup.
# This mounts a 256-Mbyte, partitioned and FAT formatted disk image, then boots Windows 98 from it.
# You'll want to replace your image-file name, path, a,d possibly parameters :
imgmount 2 ~/.dosbox/w95-256m1.img -size 512,63,16,520 -fs none
boot -l c

Finally, for your eyes' pleasure here's a screen capture of Win 95 running on the Raspberry-4 2GB

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Re: Pi 4, Raspbian Buster and Windows in DOSBOX

I guess we should make a new topic, but just to add an interesting twist to the previous post,
I found a fun & simple way to do file transfers to/from the RUNNING Windows 95 under DOSBox on R-PI ;
whereas the way proposed in the earlier post was preferably done with the DOSBox off.

Actually we'll be able to transfer files between the running "virtual" Windows-95 machine and, not just
the R-Pi host but ANY tcp-enabled machine on your LAN or even the internets (provided fierwalls, NATs etc don't get in the way). All this using the standard DOSBox - that has no emulated network adapter and without having to install any network protocol in the Windows 95 !

Here is the trick : Windows 95 comes natively with "Hyperterminal" and that can do file transfers through serial ports, using ZModem (preferred) or similar protocols.
Now, DOSBox can pipe internal (emulated) serial ports to/from an TCP socket on the host (Rpi).
The last piece of the puzzle, install the "Tools for zmodem file transfer" (lrsz) package on the
host Pi (and on other connected *X system which you'd want to exchange files w/ the Windows in DOSBox),
and you're all set !

Details

In dosbox-xxx.conf, [serial] section :

Code: Select all

serial1=nullmodem port:2323
In Windows 95/Hyperterminal : create a "direct connection" using COM1.

To send a file from host (or other connected client) :
In Hyperterminal menus : Tranfer...Receive file...(choose a directory), click : Receive,
In terminal (on host or client):

Code: Select all

 sz --tcp-client 127.0.0.1:2323 
That's all ! If transferring from a client other than the host-RPi, substitute the Pi's IP address (on the LAN or, firewalls allowing, WAN) instead of 127.0.0.1 (which is localhost).

To transfer files in the other direction, i.e. from the DOSBox, it's just a matter of :
In Hyperterminal, selecting Transfer... Send..., select file to send, click : Send,
In Linux terminal,

Code: Select all

 rz --tcp-client 127.0.0.1:2323 
That is, rz to receive / sz to send (by Z-modem protocol).

That's all folks ! :=)

scruss
Posts: 3072
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

### Re: Pi 4, Raspbian Buster and Windows in DOSBOX

NimbUx wrote:
Thu May 21, 2020 9:23 pm
Now, DOSBox can pipe internal (emulated) serial ports to/from an TCP socket on the host
So - if you felt so inclined - enable full networking via WinSock or one of the SLIP/PPP serial networking drivers. It won't be fast, it's unlikely to be pretty, but you seem up for a challenge and it would open up the whole "delightful" world of early Windows networking.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

NimbUx
Posts: 135
Joined: Fri Jan 03, 2020 10:33 am

### Re: Pi 4, Raspbian Buster and Windows in DOSBOX

scruss wrote:
Fri May 22, 2020 11:47 am
So - if you felt so inclined - enable full networking via WinSock or one of the SLIP/PPP serial networking drivers. It won't be fast, it's unlikely to be pretty, but you seem up for a challenge and it would open up the whole "delightful" world of early Windows networking.
PPP over serial should be possible and DOSBox even does provide for intercepting standard Hayes modem commands. But no, I am not interested in trying to setup and fix such a thing personally, I won't even be installing TCP/IP or any network protocol inside the windows-95 "guest". My interest in the whole DOSbox setup has been limited to bringing at hand, ono the Pi, a handfull Windows apps which I find useful and have no practical Linux counterpart.
You're absolutely right though, someone (you?) could jump the next step and connect your/their Windows-in-a-DOSBox to the internet, 1995-ISP-style. It might even prove to be faster than a 486 with a bare-metal Hayes 14400 or 28800 was, back then, who knows ? :=) I'd certainly be delighted to read reportings of such achievements here on the board !