Prerequisites
Please check whether you have completed all of the steps carefully for ROS setup and that you have setup X-forwarding with xQuartz
Unable to open display “host.docker.internal:0”
Solution 0: Did you install everything?
- Did you install homebrew?
-
Did you install docker?
Download with Homebrew
brew install docker
It is also nice to install the Desktop app itself:
You might want to make a docker account and select the free plan
-
Did you install xQuartz?
Download with Homebrew:
brew install --cask xquartz
Download Online:
-
Did you install xeyes?
xeyes is command that can test whether you have configured your environment.
Note: You need to install macports to run it (see below).
sudo port install xeyes
Run the following command to see a pair of eyes following your cursor!
xeyes
If it does not work, it means that your setup is broken.
-
(Optional) Did you install macports?
Macport installation guide: Macport guide
Solution 1: Did you configure xQuartz, xhost and Docker?
-
Check if you installed xquartz in solution 0
- open xquartz through terminal with
open -a XQuartz
-
Go to x11 preferences and security, and make both checkmarks are selected:
- Restart your Mac
sudo shutdown -r now
- After restarting, start up xQuartz with
open -a XQuartz
- Start xhost with
xhost
- Continue with the guide!
Solution 2: Did you set your Display IP address?
- Attach your local ip address
127.0.0.1
to xhost:xhost + YOUR_IP_ADDRESS_FROM_ABOVE
If this doesnt work:
- Get your local ip address with
ifconfig en0 | grep inet | awk '$1=="inet" {print $2}
- Attach the result to xhost:
xhost + YOUR_IP_ADDRESS_FROM_ABOVE
- Continue with the guide!
Solution 3: Manually set the display:
- Set the display with
DISPLAY=127.0.0.1:0
- initialize xhost:
xhost
- open xhost ports:
xhost +
- try steps 1 to 3 with your ip address from Solution 2
Use the following command in step 1:
DISPLAY=YOUR_IP_ADDRESS:0
- Continue to follow the guide!
Solution 4: Try combination of Solution 2 and 3:
- Use the commands in a different order, after starting xquartz and docker
Solution 5: add x11 server through Mac Ports:
- If you don’t have
macport
installed:Macport installation guide: Macport guide
- Install x11 server through:
sudo port install xorg-server
- Continue to follow the guide or try Solutions 1-4!