Running a windows .exe with wine on Amazon Linux
Asked Answered
M

0

3

We have a software given to us by the manufacturer of a device. This device captures data from various sensors and generates a file in a specific format (.zph). We have a serverless workflow to process these files using AWS lambda functions.

In order to extract the data from these files, we have received a converter software, which converts the .zph files to .csv files. However, the software is just windows based and there is no support for Linux.

From AWS docs, all AWS Lambda functions run on the Amazon Linux instances. So I have been trying to run this software on an Amazon Linux EC2 instance using wine.

So far, I have done the following:

I have followed the steps to compile wine on the instance using the Step 1 mentioned in this post. Compile Wine for Amazon Linux

Set the following environment variables:

export DISPLAY=
export WINEARCH=win64
export WINEPREFIX=~/.wine (default)

Then copy pasted the windows .exe into the drive_c of the .wine folder.

cd ./wine-dirs/wine-source

Run the .exe using the following command:

./wine ~/.wine/drive_c/ZPH2CSV/ZPH2CSV/ZPH2CSV.exe

However, I get the following error:

$ ./wine ~/.wine/drive_c/ZPH2CSV/ZPH2CSV/ZPH2CSV.exe
0044:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0044:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0044:err:systray:initialize_systray Could not create tray window
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
00fc:err:environ:init_peb starting L"C:\\ZPH2CSV\\ZPH2CSV\\ZPH2CSV.exe" in experimental wow64 mode
wine: failed to load L"\\??\\C:\\windows\\syswow64\\ntdll.dll" error c0000135
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: Internal error.

I have also tried the following, to run wine in headless mode.

$ sudo yum install xorg-x11-server-Xvfb

rm -f /tmp/.X0-lock 
if ! pgrep -x "Xvfb" > /dev/null 
then 
    Xvfb :0 -screen 0 1024x768x16 & 
fi 

But the same error occures. I am really unable to understand what is going wrong here. I am stuck on this error and cannot get the .exe running with wine. Also note, the installation of the .exe on Windows also required .NET. Not sure if that could be causing an issue.

I plan to replicate this on an AWS Lambda function and deploy the function as a docker container. Container Support for Lambda

The command will be run by a python script in the lambda function.

What could be going wrong here? Any help would be much appreciated. Thank you in advance.

Marchand answered 10/10, 2023 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.