{"id":13901258,"url":"https://github.com/scottyhardy/docker-wine","last_synced_at":"2025-07-17T21:32:49.870Z","repository":{"id":41271479,"uuid":"80212941","full_name":"scottyhardy/docker-wine","owner":"scottyhardy","description":"Docker image that includes Wine and Winetricks for running Windows applications on Linux and macOS","archived":false,"fork":false,"pushed_at":"2023-07-31T14:37:53.000Z","size":1231,"stargazers_count":872,"open_issues_count":42,"forks_count":151,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-06T21:40:35.829Z","etag":null,"topics":["dockerfile","linux","macos","pulseaudio","remote-desktop","unix-sockets","wine","xfce","xrdp"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottyhardy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-27T14:13:08.000Z","updated_at":"2024-08-06T09:40:16.000Z","dependencies_parsed_at":"2024-01-07T18:09:28.799Z","dependency_job_id":null,"html_url":"https://github.com/scottyhardy/docker-wine","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottyhardy%2Fdocker-wine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottyhardy%2Fdocker-wine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottyhardy%2Fdocker-wine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottyhardy%2Fdocker-wine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottyhardy","download_url":"https://codeload.github.com/scottyhardy/docker-wine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226305303,"owners_count":17603789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","linux","macos","pulseaudio","remote-desktop","unix-sockets","wine","xfce","xrdp"],"created_at":"2024-08-06T21:01:05.848Z","updated_at":"2025-07-17T21:32:49.855Z","avatar_url":"https://github.com/scottyhardy.png","language":"Shell","funding_links":[],"categories":["Shell","Build \u0026 Packaging Automation"],"sub_categories":[],"readme":"# docker-wine\n\n[![build](https://github.com/scottyhardy/docker-wine/actions/workflows/build.yml/badge.svg)](https://github.com/scottyhardy/docker-wine/actions/workflows/build.yml)\n[![Docker Pulls](https://img.shields.io/docker/pulls/scottyhardy/docker-wine.svg?style=social)](https://hub.docker.com/r/scottyhardy/docker-wine)\n[![Docker Stars](https://img.shields.io/docker/stars/scottyhardy/docker-wine.svg?style=social)](https://hub.docker.com/r/scottyhardy/docker-wine)\n[![GitHub forks](https://img.shields.io/github/forks/scottyhardy/docker-wine.svg?style=social)](https://github.com/scottyhardy/docker-wine/network)\n[![GitHub stars](https://img.shields.io/github/stars/scottyhardy/docker-wine.svg?style=social)](https://github.com/scottyhardy/docker-wine/stargazers)\n\n\u003cimg align=\"right\" height=\"300\" width=\"300\" src=\"https://raw.githubusercontent.com/scottyhardy/docker-wine/master/images/logo.png\" \u003e\n\n\u003eDocker image that includes Wine and Winetricks for running Windows applications on Linux and macOS\n\nThe docker-wine container can either be run with X11 forwarding or as an RDP server to suit your use case.  The default is to use X11 forwarding which utilizes your machine's X server to render graphics directly into your current session and play sounds through pulseaudio.\n\nUsing docker-wine with an RDP server allows the container to be run on a headless machine or a machine that may not be running an X server. You can then use a Remote Desktop client to connect to the container which may be located either on your local or a remote machine.\n\n---\n\n## Getting Started\n\nUsing the `docker-wine` script is the easiest way to get started and should be all you need for Linux and macOS.\n\n### Download the `docker-wine` script\n\nOn Linux:\n\n```bash\nwget https://raw.githubusercontent.com/scottyhardy/docker-wine/master/docker-wine\nchmod +x docker-wine\n```\n\nOn macOS:\n\n```bash\ncurl -O https://raw.githubusercontent.com/scottyhardy/docker-wine/master/docker-wine\nchmod +x docker-wine\n```\n\n## Run `docker-wine` with X11 forwarding\n\nRunning the script with no other arguments will start an interactive bash session:\n\n```bash\n./docker-wine\n```\n\nYou can override the default interactive bash session by adding `wine`, `winetricks`, `winecfg` or any other valid commands with their associated arguments:\n\n```bash\n./docker-wine wine notepad\n```\n\n![Screenshot of Notepad](https://raw.githubusercontent.com/scottyhardy/docker-wine/master/images/screenshot_1.png)\n\n## Run `docker-wine` with Xvfb\n\nStarts up a frame buffer display defaulting to: Xvfb :95 -screen 0 320x200x8\nExports DISPLAY to the server number :95\n\n```bash\n./docker-wine --xvfb\n```\n\n### Customizable options\n\n```bash\n./docker-wine --xvfb=:95,0,320x200x8\n```\n\n## Run `docker-wine` attached with notty\n\n```bash\n./docker-wine --notty\n```\n\n## Run `docker-wine` with RDP server\n\nRun with the `--rdp` option to start the RDP server with an interactive bash session:\n\n```bash\n./docker-wine --rdp\n```\n\nOr, you can run the container as a detached daemon that runs in the background.  To start the daemon:\n\n```bash\n./docker-wine --rdp=start\n```\n\nThen to stop the daemon:\n\n```bash\n./docker-wine --rdp=stop\n```\n\n## Connecting with an RDP client\n\nAll Windows desktops and servers come with the Remote Desktop Connection client pre-installed and macOS users can download the Microsoft Remote Desktop application for free from the App Store. For Linux users, I'd suggest using the Remmina Remote Desktop client.\n\nFor the hostname, use `localhost` if the container is hosted on the same machine you're running your Remote Desktop client on and for remote connections just use the name or IP address of the machine you are connecting to.\nNOTE: To connect to a remote machine, it will require TCP port 3389 to be exposed through the firewall.\n\nTo log in, use the following default user account details:\n\n```bash\nUsername: wineuser\nPassword: wineuser\n```\n\n![Screenshot of login prompt](https://raw.githubusercontent.com/scottyhardy/docker-wine/master/images/screenshot_2.png)\n\n![Screenshot of XFCE desktop](https://raw.githubusercontent.com/scottyhardy/docker-wine/master/images/screenshot_3.png)\n\n## Additional options when running `docker-wine`\n\nStart the container as root:\n\n```bash\n./docker-wine --as-root\n```\n\nOr start the container as yourself with the same username, UID, GID and home path (especially useful when binding to local file system):\n\n```bash\n./docker-wine --as-me\n```\n\nYou can combine options:\n\n```bash\n./docker-wine --as-root --rdp\n```\n\nYou can also use standard docker syntax to add as many additional environment variables, devices and volumes as you need:\n\n```bash\n./docker-wine --env=\"MY_ENV_VAR=some_value\" --device=/dev/snd --volume=\"myvol:/some/path:ro\" --volume=\"/usr/data:data\"\n```\n\nSee the `docker-wine` help for a full list of options:\n\n```bash\n./docker-wine --help\n```\n\n## Securing your password\n\nThe default password is `wineuser` and it will change to your own username by default if you use the `--as-me` argument.  You can override the default password by using `--password=\"your_password\"` but even though this password is encrypted before passing it to the container, your password still appears in plain text in the process list for any other user connected to the same host machine. Depending on your use case, this could be a problem.\n\nOne solution is to use `--password-prompt` and be prompted to enter the user password when you instantiate the docker-wine container. This will prevent your password from appearing in your machine's process list, but does require manually entering the password each time.\n\nIf prompting is undesirable, the solution is to encrypt your password _before_ passing it to the `docker-wine` script, using `openssl`.  This command will produce an MD5 encrypted hash of your password with a random salt which means each run will produce a different hash:\n\n```bash\nopenssl passwd -1 -salt $(openssl rand -base64 6) \"your_password\"\n\n```\n\nOne method of using this secure string would be to store it to disk:\n\n```bash\necho $(openssl passwd -1 -salt $(openssl rand -base64 6) \"your_password\") \u003e ~/.docker-wine\n```\n\nThen simply `cat` the file when using the `docker-wine` script:\n\n```bash\n./docker-wine --rdp --as-me --secure-password=\"$(cat ~/.docker-wine)\"\n```\n\n## Build and run locally on your own computer\n\nFirst, clone the repository from GitHub:\n\n```bash\ngit clone https://github.com/scottyhardy/docker-wine.git\ncd docker-wine\n```\n\nTo build the container, simply run:\n\n```bash\n./build\n```\n\nTo run the your locally built container, use `docker-wine` with the `--local` switch:\n\n```bash\n./docker-wine --local wine notepad\n```\n\n## Volume container winehome\n\nWhen the docker-wine container is instantiated with the `docker-wine` script, a volume container named `winehome` is created and is mapped to the user's home within the container.  Using a volume container allows the docker-wine container to be safely removed after every execution as user data will persist as long as the `winehome` volume is not removed.  This effectively allows the `docker-wine` image to be swapped out for a newer version at anytime.\n\nYou can manually create the `winehome` volume container by running:\n\n```bash\ndocker volume create winehome\n```\n\nIf you don't want the volume container, you can delete it by using:\n\n```bash\ndocker volume rm winehome\n```\n\n## Use docker-wine image in a Dockerfile\n\nIf you plan to use `scottyhardy/docker-wine` as a base for another Docker image, you should set up the same `ENTRYPOINT` to enable X11 forwarding and RDP server modes to continue operating:\n\n```dockerfile\nFROM scottyhardy/docker-wine:latest\n... \u003cyour code here\u003e\nENTRYPOINT [\"/usr/bin/entrypoint\"]\n```\n\n## Manually running with `docker run` commands\n\nThere's a number of prerequisites to getting pulseaudio redirection working on Linux and for X11 redirection to work on macOS.  I plan to document these in a wiki in the near future but this should be enough to get you started.\n\nFirst, pull the latest image from DockerHub:\n\n```bash\ndocker pull scottyhardy/docker-wine\n```\n\nHere is a basic `docker run` command for X11 redirection on Linux that will start an interactive bash session:\n\n```bash\ndocker run -it \\\n  --rm \\\n  --hostname=\"$(hostname)\" \\\n  --env=\"DISPLAY\" \\\n  --platform=\"linux/amd64\" \\\n  --volume=\"${XAUTHORITY:-${HOME}/.Xauthority}:/root/.Xauthority:ro\" \\\n  --volume=\"/tmp/.X11-unix:/tmp/.X11-unix:ro\" \\\n  scottyhardy/docker-wine /bin/bash\n```\n\nHere is a basic `docker run` command for starting the RDP server on both macOS and Linux with an interactive bash session:\n\n```bash\ndocker run -it \\\n  --rm \\\n  --hostname=\"$(hostname)\" \\\n  --env=\"RDP_SERVER=yes\" \\\n  --platform=\"linux/amd64\" \\\n  --publish=\"3389:3389/tcp\" \\\n  scottyhardy/docker-wine /bin/bash\n```\n\n## Troubleshooting\n\nTo test video, try opening Notepad:\n\n```bash\n./docker-wine wine notepad\n```\n\nTo test sound, try using `pacat`:\n\n```bash\n./docker-wine pacat -vv /dev/urandom\n```\n\nYou can find additional pulseaudio troubleshooting steps at https://github.com/OpenVoiceOS/ovos-docker/blob/dev/README_MACOS.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottyhardy%2Fdocker-wine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottyhardy%2Fdocker-wine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottyhardy%2Fdocker-wine/lists"}