{"id":20435864,"url":"https://github.com/andyneff/wine_msys64","last_synced_at":"2025-04-12T21:37:00.234Z","repository":{"id":90969606,"uuid":"121814503","full_name":"andyneff/wine_msys64","owner":"andyneff","description":"Running Msys2 64 in Wine","archived":false,"fork":false,"pushed_at":"2018-05-14T12:37:14.000Z","size":36,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T15:48:10.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyneff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-17T00:14:18.000Z","updated_at":"2024-10-23T07:49:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"e77bac67-aaac-42ba-88f5-358ab3249bf2","html_url":"https://github.com/andyneff/wine_msys64","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyneff%2Fwine_msys64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyneff%2Fwine_msys64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyneff%2Fwine_msys64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyneff%2Fwine_msys64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyneff","download_url":"https://codeload.github.com/andyneff/wine_msys64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637771,"owners_count":21137537,"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":[],"created_at":"2024-11-15T08:38:12.228Z","updated_at":"2025-04-12T21:37:00.229Z","avatar_url":"https://github.com/andyneff.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Getting msys2 to work in wine is very tricky. Here is a set of docker images\nbased off of https://github.com/TeaCI/msys2-docker that should work with Linux\nbase images other than Ubuntu 14.04.\n\n## TL;DR\n\n```bash\ndocker run -it --rm --cap-add SYS_PTRACE \\\n           -v /tmp/.X11-unix:/tmp/.X11-unix:ro \\\n           -v wine_ubuntu_14.04:/home/.user_wine \\\n           -e DISPLAY -e USER_ID=`id -u` \\\n           andyneff/wine_msys64:ubuntu_14.04\n\n#or\n\ndocker-compose run -e USER_ID=`id -u` --rm ubuntu_14.04\n```\n\nFor non-graphical (ncurses) mode:\n\n\n```bash\ndocker run -it --rm --cap-add SYS_PTRACE \\\n           -v wine_ubuntu_14.04:/home/.user_wine \\\n           -e USER_ID=`id -u` \\\n           andyneff/wine_msys64:ubuntu_14.04\n\n#or\n\ndocker-compose run -e DISPLAY= -e USER_ID=`id -u` --rm ubuntu_14.04\n```\n\n## Running with bells and whistles\n\n```\n. setup.env # Only need to run this once\njust run ubuntu_14.04\n```\n\n## Graphics\n\nWith these dockers you can run MSYS2 bash in a docker either graphically\n(which leverages `mintty.exe`) or non-grapically using `wineconsole` in ncurses\nmode. All of the bugs I have encountered have been worked around to the best\nof my ability and should work out of the box.\n\n## Special command\n\n1. `root` - Starts the container as root in normal bash. From there, you can do\n   What is needed as root. To run wine commands\n\n    ```\n    gosu user wineconsole # etc...\n    ```\n\n    You can also add addition argument after root, and these are passed along\n    as arguments to the bash call. So `root -c \"echo hi\"` would print \"hi\" and\n    end.\n\n## Installing packages into the msys environment\n\nSince msys2 requires SYS_PTRACE, you can not run any `wine` `pacman` commands in\na Dockerfile. Just getting bash up and running is complicated enough, so where is\nthere room for a setup script to install pacman packages, or anything else for\nthat matter?\n\nThe compromise I came up was the ability to add additional entrypoints so that\non the start of the docker container, packages will be installed. And since the\nwine environment can be mounted into a docker volume, this \"install\" will last\nfor the life of the docker volume, which can be the lifetime of the container or\nnot, depending on what you want your container use pattern to be.\n\nThese additional entrypoints are executed at the end of the original wine\nentrypoint, right before the final wine commands would be executed.\n\nExample:\n\n```Dockerfile\nFROM andyneff/wine_msys64:ubuntu_14.04\n\nADD setup_entrypoint.bsh /\nRUN chmod 755 /setup_entrypoint.bsh\nENTRYPOINT [\"/wine_entrypoint.bsh\", \"--add\", \"/setup_entrypoint.bsh\"]\n```\n\nBy changing the `ENTRYPOINT` instead of `CMD`, you are free to use the command\noverride mechanisms in docker without having to remember to add your additional\nentrypoints every time.\n\nHere's an example of an `setup_entrypoint.bsh` file\n\n```bash\n#!/usr/bin/env bash\n\nif [ ! -f /home/user/.wine/drive_c/msys64/usr/bin/cmp.exe ]; then\n( # Use a subshell here, so that you aren't unsetting DISPLAY for everything.\n  # This comes down to preference, of how you want it to look/feel\n  unset DISPLAY\n  # This fixes a known (by me) wineconole bug\n  gosu user wineconsole cmd /c :\n  # Install diffutils\n  gosu user wineconsole 'C:\\msys64\\usr\\bin\\bash.exe' --login -c \"pacman -S --noconfirm diffutils\"\n  # Wait for the wineserver to end\n  gosu user wineserver -w\n)\nfi\n```\n\nYou can have multiple additional entrypoints, for example:\n\n```Dockerfile\nENTRYPOINT [\"/wine_entrypoint.bsh\", \"--add\", \"/one.bsh\", \"--add\", \"/two.bsh\"]\n```\n\n## Options\n\n1. `DISPLAY` - Environment variable\n    - By default, copies your current `DISPLAY` host value. You can set it to\n      something else, or set it to null (blank) to disable graphics\n1. `USER_ID` - Environment variable\n    - Sets the UID inside the docker to match the user_id on the host. This\n      makes X11 work smoother, and files that you write to other mounted volumes\n      be owned correctly\n1. `GROUP_ID` - Environment variable\n    - Set the GID inside the docker, less important, but nice to have it match\n1. `FAST_WINE_DIR`  - Environment variable\n    - \"You do a lot of ownership stuff for files, and it takes time, and I really\n      don't care about it, can you stop that?\"\n    - Sure! Just set the environment variable `FAST_WINE_DIR` to anything\n1. `WINE_MONO_VERSION`, `WINE_GECKO_VERSION`, `WINE_VERSION`, `MSYS2_VERSION` - Build Argument\n    - Build args you can change to easily change these versions. But be careful\n      MSYS2 may not work with the wine version you pick\n    - The repo that docker image is configured with might not have the wine\n      version you want too.\n1. `MSYSTEM` - Environment variable\n    - Can be set to MINGW64, MINGW32, or MSYS2 for the desired mode.\n    - Defaults to MINGW64\n1. `MSYS2_WINE_WORKAROUND` - Environment variable\n    - 0 for debian:8 based OSes, 1 for all others. If additional workarounds\n      are needed, then 2, 3, 4, etc...\n1. `CHERE_INVOKING` Environment variable\n    - By default, a login shell on msys2 will change to the home directory. This\n      behavior is disabled by default, to re-enable it, set `CHERE_INVOKING` to\n      a blank string\n\n## Motivation\n\n- The [original repo](https://github.com/TeaCI/msys2-docker) is sort of out\nof date and cannot be reproduced using just the git repo. And only works on\nUbuntu 14 in a very special configuration. While little progress has been\nmade into solving the main cygwin core v2.6 in wine, I wanted to reproduce\nthis work, and update where possible.\n\n- Even the links to the bugs that the TeaCI docker fixes no longer work. Thanks\nwinehq!\n\n- There was a lack of documentation. Like knowing you need to run `--privileged`,\nand actually knowing you just need to run `--cap-add=SYS_PTRACE` and the way they\nhad it set up, `xhost +`, etc... There was no readme to help with that\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyneff%2Fwine_msys64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyneff%2Fwine_msys64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyneff%2Fwine_msys64/lists"}