1) First, confirm you’re actually on an X11-forwarded display
Run as your normal user (not root):
If DISPLAY looks like localhost:10.0, you’re using SSH X11 forwarding. In that case, xhost is often unnecessary (and sometimes useless) because the “X server” is actually on your Mac and access is controlled by xauth cookies.
2) Use xauth (works even when xhost syntax fails)
Goal: let root use your forwarded X session by giving root the same Xauthority cookie.
As your normal user:
If that prints a line, export the cookie into a temp file:
Then become root via pbrun:
As root:
Test with something simple (if available):
Then start IBMIM: