0

I have an 32-bit windows program that I want to run using wine in a container in AWS Lambda.

According to this question on how to run 64-bit wine in AWS Lambda and this blog posting on how to run 32-bit binaries in Lambda it seems possible.

So far my Dockerfile looks like this:

FROM ubuntu:20.04

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -yq \
    wget \
    software-properties-common \
    gnupg2 \
    xvfb \
    python3 \
    python3-pip

# Install the runtime interface client
RUN pip3 install \
    awslambdaric

RUN dpkg --add-architecture i386
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
RUN apt-get update && \
    apt-get install -y \
    winehq-stable \
    winetricks \
    winbind

RUN apt-get clean -y
RUN apt-get autoremove -y

ENV WINEDEBUG=fixme-all

ENV WINEARCH=win32
ENV DISPLAY=""
ENV WINEPREFIX="/tmp/wineprefix"
RUN winecfg

RUN winetricks msxml6

WORKDIR /lambda-poc

COPY handler.py ./
COPY hello.exe ./
COPY qemu-i386-static ./

ENTRYPOINT [ "/usr/bin/python3", "-m", "awslambdaric" ]
CMD [ "handler.lambda_handler" ]

Where the lambda handler calls hello.exe: qemu-i386-static /usr/bin/wine hello.exe
This works when I run it on my computer or on an EC2 but when in the Lambda it just hangs and the call will time out. Tried increasing the timeout to 10 min with the same result.

I tried to turn on logging in wine with WINEDEBUG="+all" and on my local computer I get several megabytes of log but nothing at all when running in Lambda.

What is wrong?

oskla129
  • 23
  • 6
  • Timeouts with no apparent cause often indicate network connectivity issues. Does this program require Internet access? If yes, do you have a NAT that allows Lambda to talk to the Internet? And if you're running inside a VPC, is your Lambda associated with a security group that has an egress rule? – Parsifal Feb 08 '21 at 13:31
  • No, networking. I am trying to run a simple "Hello, world" program. – oskla129 Feb 08 '21 at 21:10

0 Answers0