There's WineHQ to run Windows applications on Linux (and macOS). But, what about other way around? What if you want to run Linux applications on Windows (and Mac). Docker is the answer but it if you think that Docker only can run terminal applications then you're wrong.
![]()
Docker - Settings – Daemon. Let’s Get Started. With Docker for Windows started and Windows containers selected, you can now run either Windows or Linux Containers simultaneously. The new –platform=linux command line switch is used to pull or start Linux images on Windows. Docker pull -platform=linux ubuntu. The preferred choice for millions of developers that are building containerized apps. Docker Desktop is a tool for MacOS and Windows machines for the building and sharing of containerized applications and microservices. Access Docker Desktop and follow the guided onboarding to build your first containerized application in minutes.
Q: Why would you like to run GUI applications inside Docker?
A: Bad question. I don't know. This tutorial is not about the reason. It could be any reason.
Q: How can you run GUI applications inside a Docker container on Windows, Linux and Mac hosts?
Running Windows App On A Mac With Docker Chrome
A: Good question. Apple mac notes app. I know the answer.
I am using a simple Docker image that I have created and uploaded into DockerHub. You can use it directly or make your own. It's as simple as this:
For Windows
docker run --rm -it -e DISPLAY=192.168.1.68:0.0 aliustaoglu/firefox
This will create a container and from this container Firefox will run. When you finish with it, the container will be removed (--rm)
Quite easy
For Mac
For macOS we need to install xQuartz. You can use brew: https://ivhrmn.weebly.com/blog/download-mac-ghost-app.
brew cask install xQuartz
Or download the dmg file:
Running Windows App On A Mac With Docker Ubuntu
After installing xQuartz, run it and check the option 'Allow connections from network clients'. Keep xQuarts running.
Now find your local IP address using
ifconfig or any other method you know. My address was 192.168.1.76. And run bellow command:
xhost + 192.168.1.76
Now we are ready to run the docker image:
docker run --rm -e DISPLAY=192.168.1.76:0 -v /tmp/.X11-unix:/tmp/.X11-unix aliustaoglu/firefox Running Windows App On A Mac With Docker UsbFor Linux
X11 (X Windows System) is the GUI environment in Unix operating systems. Since it's a native Linux platform we don't need to install xQuartz or XLaunch as Linux already has it. We only need to run this command:
Docker On Windows 10docker run --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aliustaoglu/firefox Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |