• Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
No Result
View All Result
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
No Result
View All Result
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
No Result
View All Result
Home Tutorials

RUN Wine/Windows Inside Docker! Autoclick, winetricks, Save-As, DotNet45, .NET46!

by Sick Codes
April 11, 2020 - Updated on June 24, 2020
in Tutorials
3
dotnet46 dockerfile run windows application

dotnet46 dockerfile run windows application

To install wine and winetricks inside a docker, you need a fake X display server for winetricks to finish installing.

dotnet46 dockerfile run windows application
dotnet46 dockerfile run windows application

The following code is the bare minimum, you need every line!

ENV TZ prevents a dialog from happening during the xfce installation.

ARG DEBIAN_FRONTEND=noninteractive prevents another dialog.

xfce4 is the desktop, it has just enough features for the xdotool to work.

We choose DISPLAY number :99

[code]

FROM ubuntu:18.04
WORKDIR /root
RUN apt update -y
RUN apt install wine-stable wine-development winetricks xdotool -y
RUN dpkg –add-architecture i386
RUN apt-get update && apt-get install wine32 -y
RUN apt install zenity -y
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install keyboard-configuration -y
RUN apt install xfce4 xfce4-goodies -y
RUN apt install xvfb -y
RUN apt install winbind -y
ENV DISPLAY :99

WORKDIR /root
ADD display.sh display.sh
RUN chmod a+x display.sh

CMD { bash display.sh; }

[/code]

Inside a file called display.sh. Note, Xfvb is case-sensitive.

[code]
export DISPLAY=:99
Xvfb :99 -screen 0 1000x1000x16 &
xrandr –query
sleep 5
nohup startxfce4 &
sleep 10
xdotool mousemove 493 539 click 1
xrandr –query
winetricks -q msxml4 msxml6 corefonts vcrun2010 vcrun2013 vcrun2017 dotnet46
[/code]

Then run
docker build -t somelabel .
docker run -t somelabel

End result, a fully headless Wine DotNet46 installation!

You can interact with the Windows program using xdotool:

[code]

xdotool mousemove 493 539 click 1
sleep 5
xdotool key KP_Enter
sleep 5
xdotool key KP_Enter
sleep 5
xdotool key KP_Enter
sleep 5
xdotool key KP_Enter

[/code]

Next Post
firefox screenshot inside docker container

Take Terminal Screenshots Inside Docker Container! Scrot + imcat

How to Check if SELinux is Enabled or Disabled Ubuntu, CentOS

json flattenned array using python for sql

Pandas to SQL: Flatten JSON from Requests using Pandas (Multiple methods!)

Comments 3

  1. y2kbug says:
    5 years ago

    Hello,

    I want to run Windows applications on my office computer which is a Mac. May I know if this Dockerfile could work on MacOS? Running the Docker container gave “Can’t open display :99” “nohup: appending output to ‘nohup.out'”.

    Thanks.

    Reply
    • admin says:
      5 years ago

      This runs heedlessly, you can’t actually see the screen. It’s for auto-clicking wine apps inside the container.

      I could write a tutorial using the x11 method.

      Reply
      • y2kbug says:
        5 years ago

        I love the Mac running in Docker on Ubuntu. I wonder if Windows could be run in Docker on Ubuntu as well.

        Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training

© 2017-2021 Sick.Codes

@sickcodes

@sickcodes

@sickcodes

Discord Server

sickcodes.slack.com

t.me/sickcodeschat

./contact_form