Skip to content

Instantly share code, notes, and snippets.

@williballenthin
Last active April 3, 2024 00:50
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save williballenthin/1c6ae0fbeabae075f1a4 to your computer and use it in GitHub Desktop.
Save williballenthin/1c6ae0fbeabae075f1a4 to your computer and use it in GitHub Desktop.
Install IDA Pro under Wine in Docker
# build wine Docker image
pushd wine; docker build -t wine .; popd
# build x11 Docker image for IDA
pushd ida; docker build -t wine/ida .; popd
# demonstrate x11 forwarding works
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida xclock
# interactive shell in container
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida /bin/bash
efadeadb5142> cd /home/user/
efadeadb5142> wine ida-installer.exe
# in another terminal, after you've installed IDA, but before you stop the container!
# get container ID, efadeadb5142 is the ID i'll use here
docker ps
# commit container as new image
docker commit efadeadb5142 wine/ida/6.8
# now you can stop the IDA container
efadeadb5142> exit
# bring up new IDA GUI instances
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida/6.8 wine /home/user/.wine/drive_c/Program\ Files\ \(x86\)/IDA\ 6.8/idaq.exe
# or, more interestingly, run IDA headless
# to do so,
# start Xvfb: Xvfb :1 &
# set $DISPLAY: export $DISPLAY=:1
# run ida: wine /home/user/.wine/drive_c/Program\ Files\ \(x86\)/IDA\ 6.8/idaq.exe
# save the entire image to migrate to another host
docker save efadeadb5142 > 6.8.tar
# via: http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
FROM wine
# just to demonstrate x11 fowarding works
RUN apt-get install -y x11-apps
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:user,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
chown ${uid}:${gid} -R /home/user
# make sure to have this file handy in the same directory
ADD ida-installer.exe /home/user/ida-installer.exe
USER user
ENV HOME /home/user
CMD xclock
# via: https://github.com/monokrome/docker-wine
FROM ubuntu
MAINTAINER Brandon R. Stoner <monokrome@monokro.me>
RUN dpkg --add-architecture i386
RUN apt-get update -y
RUN apt-get install -y software-properties-common && add-apt-repository -y ppa:ubuntu-wine/ppa
RUN apt-get update -y
RUN apt-get install -y wine1.7 winetricks xvfb
RUN apt-get purge -y software-properties-common
RUN apt-get autoclean -y
@najeex
Copy link

najeex commented Sep 13, 2018

what is awesome. but don't know how to use docker this GUI app on docker. any tutorial

@j11332
Copy link

j11332 commented Oct 31, 2020

Following method has some serious security issues, but you can run X11 client in docker.
Mount /tmp/.X11-unix to same location in the container, then run with privileged mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment