pauleve / docker-mtgo

Docker image with ready-to-play MTGO (Magic Online) for Linux and macOS
https://hub.docker.com/r/panard/mtgo/
482 stars 34 forks source link

Run Docker image on Mac M1 #116

Open twoerner89 opened 3 years ago

twoerner89 commented 3 years ago

I installed Docker for M1 because x86 won't install or run on it https://www.docker.com/blog/download-and-try-the-tech-preview-of-docker-desktop-for-m1/

I followed the instructions on your GitHub and did the home-brew Xquartz dance.

Yet at the end of it, this is the result I get running the mtgo image.

./run-mtgo 
Using network interface 'en1'
open -a XQuartz
socat on 10.0.1.55 forwarding to /private/tmp/com.apple.launchd.OHFnIWJrd6/org.macosforge.xquartz:0
docker run --privileged --rm -e DISPLAY -v mtgo-data-user:/home/wine/.wine/host/ -v mtgo-data-user:/home/wine/.wine/drive_c/users/ -e WINE_X11_NO_MITSHM=1 --net=host --ipc=host -e TZ=/usr/share/zoneinfo/zoneinfo/America/Chicago --name mtgo_running panard/mtgo:latest mtgo
WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: exec format error
pauleve commented 3 years ago

See #71 You need emulation of x86/amd64.

twoerner89 commented 3 years ago

I followed the comments on #71 and ran command docker run --rm --privileged aptman/qus -s -- -p i386 output is

cat ./qemu-binfmt-conf.sh | sh -s -- --path=/qus/bin -p i386 --suffix -static
Setting /qus/bin/qemu-i386-static as binfmt interpreter for i386

that looks promising. I run command./run-mtgo

I get a lengthier output. notice it complains about the architecture mismatch again but also complains about wine tricks package manager needing an update - I'm not sure how to do that. I also have two images in Docker now, an aptman/qus and a panard/mtgo. I'm not sure who's who or what's what but I guess these commands invited them in. I'm pretty sure mtgo is the good guy but who's aptman/qus? is he gonna emulate something for me? does he run on top of or underneath the other (mtgo) or in replacement of?

I do thank you for your time and attention to it. I just find it's more fun when computers can be humanized. Apple really screwed us with these M1s huh?

Using network interface 'en1'
open -a XQuartz
socat on 10.0.1.55 forwarding to /private/tmp/com.apple.launchd.gf860I5JJM/org.macosforge.xquartz:0
docker run --privileged --rm -e DISPLAY -v mtgo-data-twoerner:/home/wine/.wine/host/ -v mtgo-data-twoerner:/home/wine/.wine/drive_c/users/ -e WINE_X11_NO_MITSHM=1 --net=host --ipc=host -e TZ=/usr/share/zoneinfo/zoneinfo/America/Chicago --name mtgo_running panard/mtgo:latest mtgo
WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
winetricks gdiplus=native sound=alsa winegstreamer=disabled wmp=disabled
------------------------------------------------------
You are running winetricks-20200412, latest upstream is winetricks-20201206!
------------------------------------------------------
------------------------------------------------------
You should update using your distribution's package manager, --self-update, or manually.
------------------------------------------------------
Executing mkdir -p /home/wine
Using winetricks 20200412 - sha256sum: 40ff4c67804584b73d4d36153e1f64ca426d739f1790bd748f5ded0865e8cc7f with wine-5.12 and WINEARCH=win32
Using native override for following DLLs: gdiplus
Executing wine regedit C:windowsTemp_nativeoverride-dll.reg
0044:err:explorer:initialize_display_settings Failed to query current display settings for L"\\.\DISPLAY1".
0094:err:ntoskrnl:ZwLoadDriver failed to create driver L"\Registry\Machine\System\CurrentControlSet\Services\wineusb": c0000142
Executing w_do_call sound=alsa
Executing mkdir -p /home/wine
Executing load_sound alsa
Setting sound driver to alsa
Executing wine regedit C:windowsTempset-sound.reg
Using override for following DLLs: winegstreamer
Executing wine regedit C:windowsTemp_disabledoverride-dll.reg
Using override for following DLLs: wmp
Executing wine regedit C:windowsTemp_disabledoverride-dll.reg
wineboot
wine /opt/mtgo/mtgo.exe
00fc:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
00fc:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00fc:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
00fc:err:ole:apartment_getclassobject DllGetClassObject returned error 0x80040154 for dll L"mscoree.dll"
pauleve commented 3 years ago

That looks really promising :-) The error is due to the display it cannot found (related to Xquartz), all the other messages are harmless. Maybe try again after rebooting?

The aptman/qus image was used to configure your system for the emulation, it can be removed.

twoerner89 commented 3 years ago

I did a restart of the computer, I get the familiar output if I ./run-mtgo

WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: exec format error

So I went back and did docker run --rm --privileged aptman/qus -s -- -p i386 then ./run-mtgo getting the output from previous comment Also I'm running dual monitors on a M1 Mac mini so I'll try single monitor and report back.

pauleve commented 3 years ago

Ok, so the issue may be related to network between the container and the host. Can you try modifying run-mtgo, changing

     export DISPLAY=$ip:0

to

    export DISPLAY=host.docker.internal:0

(around line 211)

pauleve commented 3 years ago

and if it is not enough, try changing

socat TCP4-LISTEN:6000,bind=$ip,range=$ip/32,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &

to

socat TCP4-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &
twoerner89 commented 3 years ago

Here's my output after trying updated the display code and updating socat TCP

I think it might be losing it on the arm64 platform emulation

twoerner@Tommys-Mac-mini ~ % ./run-mtgo Using network interface 'en1' open -a XQuartz socat on 10.0.1.55 forwarding to /private/tmp/com.apple.launchd.MoN7t7pGRH/org.macosforge.xquartz:0 docker run --privileged --rm -e DISPLAY -v mtgo-data-twoerner:/home/wine/.wine/host/ -v mtgo-data-twoerner:/home/wine/.wine/drive_c/users/ -e WINE_X11_NO_MITSHM=1 --net=host --ipc=host -e TZ=/usr/share/zoneinfo/zoneinfo/America/Chicago --name mtgo_running panard/mtgo:latest mtgo WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested standard_init_linux.go:219: exec user process caused: exec format error

micahhuerta commented 2 years ago

Did this ever get resolved? I'm stuck in the same place.

BenjaminAnding commented 1 year ago

I've managed to get to an XQuartz window with the MTGO Setup dialogs, can accept EULA but hangs on downloading required file 1/1 (DotNet framework)

install.log contents in case you find this interesting

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 6.1.1 {version}
Running checks for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)', phase BuildList
Reading value 'Release' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
Read integer value 393297
Setting value '393297 {int}' for property 'DotNetFull_Release'
Reading value 'v4' of registry key 'HKLM\SOFTWARE\Microsoft\NET Framework Setup\OS Integration'
Unable to read registry value
Not setting value for property 'DotNetFull_OSIntegrated'
The following properties have been set for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)':
Property: [DotNetFull_Release] = 393297 {int}
Running checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe' is 'Bypass'
Running checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'ValueGreaterThan' on property 'DotNetFull_Release' and value '461808': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '6.1.0': false
Result of running operator 'ValueEqualTo' on property 'ProcessorArchitecture' and value 'IA64': false
Result of checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe' is 'Install'
'Microsoft .NET Framework 4.7.2 (x86 and x64)' RunCheck result: Install Needed
EULA for components 'Microsoft .NET Framework 4.7.2 (x86 and x64)' was accepted.
Copying files to temporary directory ""
Downloading files to ""
(7/6/2023 9:20:51 PM) Downloading 'DotNetFX472\NDP472-KB4054531-Web.exe' from 'http://go.microsoft.com/fwlink/?LinkId=863262&clcid=0x409' to ''
Download completed at 7/6/2023 9:20:51 PM
Downloading failed with HRESULT=-2147467259
(7/6/2023 9:22:15 PM) Downloading 'DotNetFX472\NDP472-KB4054531-Web.exe' from 'http://go.microsoft.com/fwlink/?LinkId=863262&clcid=0x409' to ''
Download completed at 7/6/2023 9:22:17 PM
Error: The following package files could not be found:
???
BenjaminAnding commented 1 year ago

fwiw Docker logs show this complaint around the same time as the hangup before segfault

0174:err:ole:apartment_getclassobject DllGetClassObject returned error 0x80040154 for dll L"mscoree.dll"