Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mising option to run x86_64 container on M1 MacBook #168

Open
CodingMarkus opened this issue Mar 21, 2025 · 24 comments
Open

Mising option to run x86_64 container on M1 MacBook #168

CodingMarkus opened this issue Mar 21, 2025 · 24 comments
Assignees

Comments

@CodingMarkus
Copy link

When I just run this on a M1 MacBook

# ./docker-wine --rdp        

I end up with this error

latest: Pulling from scottyhardy/docker-wine
no matching manifest for linux/arm64/v8 in the manifest list entries
Unable to find image 'scottyhardy/docker-wine:latest' locally
latest: Pulling from scottyhardy/docker-wine
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
See 'docker run --help'.

This confuses me, since when I run it like this

# ./docker-wine --rdp --arm64

it does work fine and according to script, all that this option does is

    --arm64)
        add_run_arg --platform="linux/arm64"
        IMAGE_TAG="arm64"
        ;;

So platform linux/arm64 is fine but when I searched for linux/arm64/v8 before it was an error?

Also I miss an option to force x86 after all Docker can run x86 code on ARM Macs. E.g. if I add the folllowing

    --x86_64)
        add_run_arg --platform="linux/x86_64"
        ;;

this also does work and now I have a container running in x86 emulation mode but this container doesn't allow log in (attempting to log in always fails).

Even though much slower, a x86_64 container is much more useful considering that a huge chunk of Windows software only exists for that architecture.

@scottyhardy
Copy link
Owner

I've actually been working on a solution to this the last couple of weeks. I gave up a few years ago because compiling and running wine in an ARM container meant it could only run windows executables compiled on ARM, or when trying to run the x86 image on M1 (ARM) with emulation, Docker's qemu emulator would fail and cause the container to throw a segmentation fault.

The new solution is to use an ARM based image in combination with box86 and box64 that does the emulation for x86 binaries on the fly without needing qemu. I've got it working with Ubuntu 20.04 focal and wine version 8.0.2 but run into issues with newer versions of wine or Ubuntu, so I'm still trying to see if I can improve more before release.

So watch this space, I'll be releasing the new code and container images soon.

@scottyhardy scottyhardy self-assigned this Mar 22, 2025
@CodingMarkus
Copy link
Author

but this container doesn't allow log in (attempting to log in always fails).

I have to correct myself: This statement is wrong. After a couple of attempts, I was able to log in. I notice it sporadically also fails on ARM using an ARM container, so this issue is maybe not even related.

Once I did log in, I failed to run anything with wine though. Here's what I got:

$ wine notepad
0024:err:environ:run_wineboot failed to start wineboot c000007b
wine: could not load kernel32.dll, status c0000135

So something is wrong with the prefix. I first had to create two new prefixes:

WINEARCH=win32 WINEPREFIX=~/wine32 winecfg
WINEARCH=win64 WINEPREFIX=~/wine64 winecfg

Those two prefixes than worked and allowed me to run x86/x86_64 binaries in my Docker container. Painfully slow to start and not that fast when running either, but they did run which was already beyond my expectations.

So

# ./docker-wine --rdp --arm64

works fine for me. And after patching the script to support the --x86_64 argument

# ./docker-wine --rdp --x86_64

also worked fine for me, after I created two new prefixes by hand.

Side note: That this option should probably not be named --x86_64 but --amd64 to match --arm64 (otherwise arm64 would have to be aarch64; using the architecture name or marketing name, both is fine but I guess one should be consistent).

@scottyhardy
Copy link
Owner

Ok, that's interesting - obviously there's been improvements to allow the x86 image to run on ARM. It used to just fall over immediately with a segmentation fault and unfortunately I don't have an M-series Mac to test with so I had no idea things had changed.

My new image should be significantly faster though, as it's running native ARM and uses emulation only for the x86 binaries. I'm hoping to release this weekend.

@sztupy
Copy link

sztupy commented Mar 29, 2025

Just having this same issue. I can run the container in qemu emulation mode but I get too many errors (for example trying to run a .net 3.5 app crashes outright with CLR error 80004005).

I was just about to look into https://github.com/alzhahirdev/winebox64 which is doing something similar you're looking into right now, but otherwise it's support (like properly setup rdp & X) is nowhere near what this package has, so I might wait for your release. I'm happy to test if you have something.

@scottyhardy
Copy link
Owner

That'd be great, I'm relying on emulation to test the ARM image as I only have an old Intel MacBook. 32 bit prefixes work fine for me but I get a segmentation fault for 64 bit, so I'm not sure if that's a symptom of emulation or if it's genuinely broken.

I've only got ci and documentation to go, but at worst I'll just push an image out today for testing.

@scottyhardy
Copy link
Owner

Ok, I've just push a new image for testing: scottyhardy/docker-wine:debian. The manifest includes both ARM and x86_64 images. If you're just using RDP, you can use this docker run command:

docker run -it \
  --rm \
  --hostname="docker-wine" \
  --env="RDP_SERVER=yes" \
  --publish="3389:3389/tcp" \
  scottyhardy/docker-wine:debian /bin/bash

Or if you want to use the docker-wine helper script:

wget https://raw.githubusercontent.com/scottyhardy/docker-wine/feature/debian_with_arm/docker-wine
chmod +x docker-wine

./docker-wine --tag=debian --rdp

I've got wrappers set up to set WINEARCH=win32 and WINEDEBUG=-all so you shouldn't get the kernel error from no winearch or the deluge of debug logs. If you do export WINEARCH=win64 or WINEARCH=win64 wine <command> ... it'll pass through, but from my own testing 64bit falls over immediately with a segmentation fault, but I'm not sure if that's from emulation on my intel macbook.

You can also force to use the x86_64 image to compare by adding --platform=linux/amd64 to the docker-wine script options or your docker run command, or just add --amd64 to the docker-wine script options for a shortcut.

@sztupy
Copy link

sztupy commented Mar 30, 2025

I had a go with your pushed image. Main notes:

  • RDP is working fine
  • Wine is crashing outright with plenty of various errors
  • bash is crashing a lot as well

I think the issue is that you are trying to run bash under box86 and hoping that will keep resolving stuff, but I don't think it's working.

What I tried instead is just modifying wine to use a box86 wrapper, and keep using arm bash.

So the two changes:

  1. Revert bash:
sudo rm /usr/bin/bash
sudo ln -s /bin/bash-original /usr/bin/bash
  1. Update the wine wrapper:

(I installed vim to have an editor)

edit /usr/bin/wine

#!/bin/bash
export WINEARCH=${WINEARCH:-win32}
export WINEDEBUG=${WINEDEBUG:--all}
exec /bin/bash -c "/usr/local/bin/box86 /opt/wine-stable/bin/wine \"\$@\"" -- "$@"

While this still has issues, I'm trying to debug, I did manage to get much closer to actually have things run, compared with the box'd bash version, although commands still die:

$ WINEARCH=win32 winetricks --unattended -q --force winxp cmd dotnet35
(plenty of logs and then)
qemu-i386: Could not open '/lib/ld-linux.so.2': No such file or directory

or for example

$ wine data/windows-en-us-kb971513.exe /quiet
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
005c:err:dnsapi:DllMain No libresolv support, expect problems
0044:fixme:imm:ImeSetActiveContext (00010026, 0): stub
0044:fixme:imm:ImmReleaseContext (00010020, 00010026): stub
0104:fixme:imm:ImeSetActiveContext (0001005C, 1): stub
0104:fixme:imm:ImmReleaseContext (00010056, 0001005C): stub
0024:fixme:clusapi:GetNodeClusterState ((null),0021ECC4) stub!
0024:fixme:advapi:DecryptFileA ("c:\\9d89abc5ab1c17cbfca90eb61380\\", 00000000): stub
010c:fixme:setupapi:pSetupGetGlobalFlags stub
wine: Unhandled exception 0x00000000 in thread 10c at address 7BC24468 (thread 010c), starting debugger...
winedbg detected, not launching it!
010c:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 264 36" (1359)
Read the Wine Developers Guide on how to set up winedbg or another debugger

I've seen you added some commits recently, so I'll try to build the container myself and see what I come up with. I think I'll keep trying the "everything is arm except wine itself which runs under box" route for now, which based on https://github.com/alzhahirdev/winebox64/blob/main/image/Dockerfile should hopefully work.

Thanks for your recent contributions, if I manage to get this running I'll let you know or potentially drop a PR

@sztupy
Copy link

sztupy commented Mar 30, 2025

If that doesn't work, the other potential thing to look at the native support for this in Wine 10.0+ using ARM64EC & FEX for 64 bit apps, and in Wine 9.0+ for 32 bit apps

@sztupy
Copy link

sztupy commented Mar 30, 2025

Had a couple tries, I'm usually stuck at getting any kind of win32 apps running regardless of what I try. The common error is always

qemu-i386: Could not open '/lib/ld-linux.so.2': No such file or directory

Which is probably odd as I'm not sure where qemu comes from, as i386 emulation should be taken care of by box86 if I'm not mistaken, and qemu is not installed at all on the containers themselves, so I'm wondering if Docker Desktop's binfmt is doing something weird and the error is coming from there

@sztupy
Copy link

sztupy commented Mar 31, 2025

Final update from me today, looks like I was wrong, the bash redirection does work (or at least that's not the problem), but apparently running commands is not deterministic. Simply trying to run cmd.exe after running the container would return something like:

wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
wine: created the configuration directory '/home/wineuser/.wine'
wine: configuration in L"/home/wineuser/.wine" has been updated.
Microsoft Windows 6.1.7601

Z:\>echo "Hello"
"Hello"

Z:\>exit
wineuser@docker-wine:/$ wine cmd.exe
Microsoft Windows 6.1.7601

Z:\>wineuser@docker-wine:/$ ^D
wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
Illegal instruction
wineuser@docker-wine:/$ wine cmd.exe
Microsoft Windows 6.1.7601

Z:\>

So this works some of the time, not the other times.

I also tried to build the container with mono 10.0.0.0 (the version I'm interested in). The result is the same, except for the fact that even if cmd.exe runs (e.g. doesn't crash), there's no interaction and just exits immediately.

Also one thing I noticed is that wineserver is the 32-bit version in the build, so this cannot run 64 bit apps, as wineserver will always generate 32 bit version of .wine

@sztupy
Copy link

sztupy commented Mar 31, 2025

Bug might be with BOX64 calling BOX86, as the error happens when context switches between BOX64 and BOX86:

with logging enabled this is a failed attempt:

wineuser@docker-wine:/$ wine cmd.exe
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP
[BOX64] Running on - with 12 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 22 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /usr/lib/box64-x86_64-linux-gnu/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
[BOX64] Looking for /usr/local/bin/box64-bash
[BOX64] Bash detected, disabling banner
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP
[BOX64] Running on - with 12 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 23 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /usr/lib/box64-x86_64-linux-gnu/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
[BOX64] Looking for /usr/local/bin/box64-bash
[BOX64] Bash detected, disabling banner
Illegal instruction

and this is a successful one:

[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP
[BOX64] Running on - with 12 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 22 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /usr/lib/box64-x86_64-linux-gnu/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
[BOX64] Looking for /usr/local/bin/box64-bash
[BOX64] Bash detected, disabling banner
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP
[BOX64] Running on - with 12 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 23 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /usr/lib/box64-x86_64-linux-gnu/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
[BOX64] Looking for /usr/local/bin/box64-bash
[BOX64] Bash detected, disabling banner
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP
[BOX64] Running on - with 12 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 23 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /usr/lib/box64-x86_64-linux-gnu/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
[BOX64] Looking for /usr/local/bin/box64-bash
[BOX64] Bash detected, disabling banner
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 SWP IDIVA AES PMULL PageSize:4096 Running on - with 12 Cores
Params database has 32 entries
BOX86: Wine detected, WINEPRELOADRESERVE=""
BOX86: Warning, program break not found
BOX86_LD_LIBRARY_PATH: /usr/lib/box86-i386-linux-gnu/
BOX86_PATH: /usr/lib/box86-i386-linux-gnu/
Counted 21 Env var
Looking for /opt/wine-stable/bin/wine
argv[1]="cmd.exe"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/bin/../lib/wine/i386-unix/ntdll.so
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 SWP IDIVA AES PMULL PageSize:4096 Running on - with 12 Cores
Params database has 32 entries
BOX86: Wine detected, WINEPRELOADRESERVE=""
BOX86: Warning, program break not found
BOX86_LD_LIBRARY_PATH: /usr/lib/box86-i386-linux-gnu/
BOX86_PATH: /usr/lib/box86-i386-linux-gnu/
Counted 23 Env var
Looking for /opt/wine-stable/bin/wine
argv[1]="cmd.exe"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/bin/../lib/wine/i386-unix/ntdll.so
wine: created the configuration directory '/home/wineuser/.wine'
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 SWP IDIVA AES PMULL PageSize:4096 Running on - with 12 Cores
Params database has 32 entries
BOX86: Warning, program break not found
BOX86_LD_LIBRARY_PATH: /usr/lib/box86-i386-linux-gnu/
BOX86_PATH: /usr/lib/box86-i386-linux-gnu/
Counted 23 Env var
Looking for /opt/wine-stable/bin/wineserver
Rename process to "wineserver"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/lib/wine/i386-unix/libwine.so.1
002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0048:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0050:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0048:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0048:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0048:err:systray:initialize_systray Could not create tray window
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0050:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
002c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 3
002c:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x800736b7
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x800736b7
0050:err:ole:apartment_get_local_server_stream Failed: 0x800736b7
0050:err:ole:start_rpcss Failed to open RpcSs service
0040:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0040:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
008c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
008c:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
0094:fixme:file:NtLockFile I/O completion on lock not implemented yet
0094:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
009c:fixme:file:NtLockFile I/O completion on lock not implemented yet
009c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00ac:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00ac:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
009c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
009c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
0094:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
0094:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
008c:err:localspl:process_attach failed to load symbol cupsFinishDocument
00c4:err:service:process_send_command service protocol error - failed to write pipe!
0074:err:dnsapi:DllMain No libresolv support, expect problems
0110:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
wine: configuration in L"/home/wineuser/.wine" has been updated.
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 SWP IDIVA AES PMULL PageSize:4096 Running on - with 12 Cores
Params database has 32 entries
BOX86: Wine detected, WINEPRELOADRESERVE="000400000-00048d000"
BOX86: Warning, program break not found
BOX86_LD_LIBRARY_PATH: /usr/lib/box86-i386-linux-gnu/
BOX86_PATH: /usr/lib/box86-i386-linux-gnu/
Counted 25 Env var
Looking for /opt/wine-stable/bin/wine
argv[1]="C:\windows\system32\conhost.exe"
argv[2]="--unix"
argv[3]="--width"
argv[4]="183"
argv[5]="--height"
argv[6]="45"
argv[7]="--server"
argv[8]="0x10"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/bin/../lib/wine/i386-unix/ntdll.so
0110:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0110:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0110:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
Using emulated /opt/wine-stable/lib/wine/i386-unix/libwine.so.1
Using emulated /opt/wine-stable/lib/wine/i386-unix/win32u.so
Using native(wrapped) libfreetype.so.6
Using native(wrapped) libfontconfig.so.1
Using native(wrapped) libexpat.so.1
Using emulated /opt/wine-stable/lib/wine/i386-unix/win32u.so
Using native(wrapped) libfreetype.so.6
Using native(wrapped) libfontconfig.so.1
Using native(wrapped) libexpat.so.1
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 SWP IDIVA AES PMULL PageSize:4096 Running on - with 12 Cores
Params database has 32 entries
BOX86: Wine detected, WINEPRELOADRESERVE="000400000-000571000"
BOX86: Warning, program break not found
BOX86_LD_LIBRARY_PATH: /usr/lib/box86-i386-linux-gnu/
BOX86_PATH: /usr/lib/box86-i386-linux-gnu/
Counted 25 Env var
Looking for /opt/wine-stable/bin/wine
argv[1]="C:\windows\system32\cmd.exe"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libm.so.6
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/bin/../lib/wine/i386-unix/ntdll.so
Using emulated /opt/wine-stable/lib/wine/i386-unix/libwine.so.1
Using emulated /opt/wine-stable/lib/wine/i386-unix/win32u.so
Using native(wrapped) libfreetype.so.6
Using native(wrapped) libfontconfig.so.1
Using native(wrapped) libexpat.so.1
Microsoft Windows 6.1.7601

Z:\>

wine doesn't even load at all on crashed instances.

Note, I have explictly disabled i386 qemu in Docker Desktop by calling (from the host):

docker run --rm -it --pid=host --privileged ubuntu:22.04 nsenter --all -t 1 -m sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/i386'

but this just helps with getting different error messages when I had trouble with ld_linux.so.2

@scottyhardy
Copy link
Owner

I released the new docker wine code earlier today and the new images have been pushed out. I can only get the box86/box64 arm image to work with 8.0.2, so no point testing with 9.0.0.0 or 10.0.0.0 or the wine-devel versions either because they also don't work.

The tags for the 9 and 10 (if you wanted to test x86 images with emulation) are:

  • stable-9
  • stable-10

or substitute stable for devel if you wanted to try those too.

I'm not sure your dotnet example actually works. I tried it on x86 wine-stable 8.0.2 and 10.0 but I also get errors:

wineuser@docker-wine:~$ WINEARCH=win32 winetricks --unattended -q --force winxp cmd dotnet35 
Executing cd /usr/local/bin
Using winetricks 20250102-next - sha256sum: fd4f57a2b385c89ea896a3a8115003e935551e410128b2353dfebe2915d93d3f with wine-8.0.2 and WINEARCH=win32
Executing w_do_call winxp
Executing load_winxp 
Executing wine winecfg -v winxp
------------------------------------------------------
warning: Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/home/wineuser/.wine terminate
------------------------------------------------------
Application could not be started, or no application associated with the specifie
d file.
ShellExecuteEx failed: File not found.

------------------------------------------------------
warning: Note: command load_winxp  returned status 1. Aborting.
------------------------------------------------------

Instead, could you please try running this for me:

./docker-wine --rm --xvfb --notty winetricks -q winamp

This is what I use to confirm wine is working (to some degree at least) in my ci. I've tested with an ARM runner and it worked without at hitch (also built the image in 8 mins vs 1.5 hrs for cross-compile on x86). I was trying earlier to test with a macOS M-series runner but it doesn't come with docker installed so might try again later.

If that command doesn't work, try running wine notepad either in RDP or X11 mode and see if it at least runs. Thanks!

@sztupy
Copy link

sztupy commented Mar 31, 2025

while dotnet is my end goal, but currently I'm just trying with cmd.exe and notepad.exe and still get intermitttent errors as shown above.

@sztupy
Copy link

sztupy commented Mar 31, 2025

What I'm curently trying is 8.0.2 with box86, completely skipping box64. It seems the most stable config for 32 bit apps for now, at least the errors I'm getting seem to be unrelated to box.

@sztupy
Copy link

sztupy commented Mar 31, 2025

Here is my latest update: sztupy@6566e6b

In short it:

  1. Downloads box86-bash (as box86 doesn't come with it by default) and makes sure it's available
  2. Rolls back bash to remain system default (arm)
  3. Updates the wine wrappers to use the proper box version, including the BOX env vars dependent on WINEARCH
  4. Also added BOXxx_BASH env vars to pick the proper bash version

Note that 64 bit wine still doesn't work as the wineserver in the install is the 32 bit version, I guess becuase it's the same filename in both wine-adm64 and wine-i386, and as the latter is installed later it just overwrites it or something.

I don't have any more random crashes with this setup, e.g. I can consistently load up cmd.exe or notepad.exe without getting Illegal instruction errors, so that's at least good. Errors still remain but I think those are most likely come from some issues in how wine is installed and not from BOX. For example winetricks winxp which should be a moderately simple command fails:

wineuser@docker-wine:~$ winetricks winxp
Executing cd /usr/local/bin
Using winetricks 20250102-next - sha256sum: fd4f57a2b385c89ea896a3a8115003e935551e410128b2353dfebe2915d93d3f with wine-8.0.2 and WINEARCH=win32
Executing w_do_call winxp
Executing load_winxp 
Executing wine winecfg -v winxp
------------------------------------------------------
warning: Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/home/wineuser/.wine terminate
------------------------------------------------------
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

(Not sure which file it's referring to that's missing, using WINDEBUG=all also didn't really get me closer to it)

@scottyhardy
Copy link
Owner

That’s a great start - could you put through a pull request so I can check it out further?

@sztupy
Copy link

sztupy commented Mar 31, 2025

Just done that. Meanwhile I realized OSX Macs don't support 32 bit ARM anyway, so BOX86 runs under qemu emulation in docker. Hence if I have time I might actually play around with Wine 9/10s native x86/x64 emulation under ARM with FEX, it might be a more future proof solution, at least for architectures without native 32 bit support

@scottyhardy
Copy link
Owner

Have you checked out hangover? It uses FEX as the default emulator but I got segmentation faults immediately so moved on to trying box. FEX looks interesting by itself though, so worth a try.

@sztupy
Copy link

sztupy commented Mar 31, 2025

Not yet, but I'll take a look. I've also just seen there's a new compile-time option flag for BOX64 named BOX32, that would allow 32 bit x86 apps to be run natively under aarch64, but it's not yet feature complete

https://box86.org/tag/box32/

Might be worth trying it out though and see how it behaves instead of BOX86

@michalmo
Copy link

michalmo commented Mar 31, 2025

fwiw, this was working perfectly for me but the latest push broke it. switching to the previous tag gets everything working again with the latest docker-wine script.

docker-wine --tag=stable-10.0-20250323 --rdp --amd64

I followed this comment to get set up: #168 (comment)
The only difference is i didn't need to create the new prefix if i created a fresh winehome volume. (I only got the errors described there if i first ran the arm image then switched to the amd64 one.)

with the latest image it's broken because WINEARCH is now win32, it might possibly work with a fresh winehome volume.

@scottyhardy
Copy link
Owner

scottyhardy commented Mar 31, 2025

Make sure you run with ./docker-wine --rm so you run without the winehome volume container and start fresh each time you run the container, just to reduce the number of variables while testing

@sztupy
Copy link

sztupy commented Mar 31, 2025

Just to add to that I'm back on plain x86_64 I'm having trouble with the new builds, for example the winetricks winxp call doesn't work anymore on plain x86_64 too. It was definitely fine in the old builds. Need to roll back to stable-10.0-20250323 as well

@scottyhardy
Copy link
Owner

Ok, I'll roll back soon just to keep things going as they were. I really need to get my hands on an apple silicon Mac!

@scottyhardy
Copy link
Owner

Ok, I've rolled back all the changes, which has prompted new images to be pushed out. Thanks for the feedback everyone, I've got a few more things to test now to ensure the next update I push works properly. I'm going to avoid trying to do any ARM-related updates until I get my hands on an M-series Mac and concentrate on getting a decent updated x86 image running as Ubuntu 20.04 is almost end of life. It sounds like the emulation is doing a pretty decent job for now anyways.

Regarding @CodingMarkus original post, I've removed the --arm64 option and added the --platform=linux/amd64 option to the docker run commands in the docker-wine script and in the examples in the README, so that'll force the x86 image to run with emulation on ARM by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants