![]() ![]() This command imports various security settings and files into the container. The xhost command configures XQuartz to allow connections from the given IP address. $ docker run - rm -name firefox -e DISPLAY= $IP:0 -e XAUTHORITY=/.Xauthority -net host -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/.Xauthority jess/firefox This magic shell command gets the IP address into an environment variable: export IP=$(ifconfig en0 | grep inet | awk '$1="inet" ') Notice the line reading inet has my IPv4 address, and the lines reading inet6 have my IPv6 address. The first thing is determining your IP address, which you can do like: $ ifconfig -a Let's just take the happy path and document what works. We don't have space to go into all the details of configuring X11 security. Since it would be extremely insecure for X11 displays to allow any application access to the display - there is security built in to the X11 protocol. Running the Docker container, passing along X11 authentication In case you're a Windows user, the VcXsrv Windows X Server is available at this address The Docker container we're about to create counts - as would a Linux machine in your office. This opens the display so it accepts X11 connections from any non-local computer. Namely - Allow connections from network clients. Run the XQuartz application, then in it's application menu you'll find a Preferences choice. It's recommended to reboot your computer before doing the rest. Simply download the application and install it. XQuartz is available through Homebrew and MacPorts if you prefer. Together with supporting libraries and applications, it forms the X11.app that Apple shipped with OS X versions 10.5 through 10.7.Īpple used to ship an X11 display server with Mac OS X, but at some point stopped. The XQuartz project is an open-source effort to develop a version of the Hence "X11 display server" is the correct phrase. The GUI application is seen to be a client application, displaying its GUI on an X11 display which is the server. The phrase "X11 display server" is how the X11 team describes an X11 display. XQuartz - an X11 display server for Mac OS X The last step, to launch the firefox binary, causes Firefox to run and attempt to connect with an X11 display server. The point is that apt-get install firefox will install all dependencies required to run Firefox, including the X11 libraries and everything else. That's Ubuntu - we really should update that to 18.04 or something but what the heck. While we normally think of Docker to run server applications with no GUI, there's no reason that GUI applications cannot be installed.Ĭonsider this Docker image: FROM ubuntu:14.04 The package manager will automatically ensure all needed packages are installed. Since Docker builds container images using regular Linux distributions, it's possible to install any application. See: Use Canonical's Multipass to display Linux GUI applications on macOS desktop A Docker image for a Linux GUI application It is also possible to implement this using Canonical's Multipass environment which makes it easy to run Ubuntu virtual machines on Mac OS X or on Windows. Suitable authentication and permissions suitable for the Linux app that's running inside the Docker container.An X11 display server on a macOS computer.A docker container with the desired Linux GUI application installed.Because X11 allows an X11 application to display on any X11 display server, all that's needed is Since the Docker container is a Linux environment the GUI subsystem is X11. We can set up a Docker container with that application. In this case the desire is to run an X11 application on Linux - one which isn't supported by either MacPorts or Homebrew. In other words, the X11 GUI architecture generalized the connection between application and graphics display, allowing both to run on any computer connected to the Internet, and for the graphics interaction to run across the Internet. The X11 architecture allows an application to run on a distant computer, and be displayed on another computer, in addition to the typical case where the application is displayed on its local computer. The architecture is different from both Windows and Mac OS X GUI environments. Since the 1980's the Unix/Linux/FreeBSD/etc ecosystem has used the X11 windowing system to display GUI applications. We need to start with a little bit of background. ![]()
0 Comments
Leave a Reply. |