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.
Q: Why would you like to run GUI applications inside Docker?
The sudo command lets you launch applications with root access, but it requires the path to the executable file within the application package. Most default Mac applications, as well as many third-party programs, organize the package contents the same way, so it's worth trying this. Under that, Apple use GNU tools, the same as Linux use (GCC, G, autotools, binutils). To get mac apps to compile in Linux, you have to rewrite Quartz, CoreImage, the remainning part of Cocoa, core animation, interface coreAudio using pulseAudio and rewrite 5-10 other libs. Plain Classic WINE. Doesn't require a Windows license to use Windows applications. Wine is a compatibility layer that allows Windows applications to run on Linux.
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?
![]()
A: Good question. 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)
Mac Apps Store
Quite easy
For MacRun Mac Software On Linux
For macOS we need to install xQuartz. You can use brew:
brew cask install xQuartz Run Mac Apps Under Linux Installer
Or download the dmg file:
Can You Run Linux On A Mac
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 Run Mac Apps Under Linux Download
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 For LinuxMac Apps Free
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 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 |