No Figure Windows When Using MATLAB on Remote Mac

50 views (last 30 days)
I am currently using MATLAB Version (R2010b) which is installed on a Mac Pro machine that I log into remotely. To use MATLAB, I ssh into the machine using 'ssh -X machinename' and then proceed to launch MATLAB. The program launches fine and I am able to process scripts, etc (note - when launched, MATLAB is only in "text-mode"; i.e., there is no desktop launched).
I am able to process data. However, when it comes to plotting or launching a figure window, no figure window will open on my screen. I have checked that X11 Forwarding is enabled when I log onto the machine by doing "tests" - e.g., launching 'xclock' in the terminal window pops up a window with the clock. I have also tried 'ssh -Y machinename' and 'ssh -XY machinename' when logging into the server, but that does not resolve the problem.
There appears to be an issue with MATLAB receiving the X11 forwarding information on the Mac. I have searched online and found similar complaints but no solution. (And no, screen sharing is not an option, as the machine is used by multiple users).
Can someone please tell me how to fix this problem so that I can run, process, and visualize my results on MATLAB through this remote connection?

Answers (11)

Sean O'Brien
Sean O'Brien on 20 Sep 2016
Edited: Sean O'Brien on 20 Sep 2016
My users here at the ODU Center for Coastal Physical Oceanography were having the same issue.
I can confirm that setting "Allow connections from network clients" in the XQuartz preferences solves the problem. Initial windows sent from the remote compute server work fine in any case, but secondary spawned windows require this setting in order to be drawn by X11.
Screen shot below.
Our setup is:
remote machine = RHEL6 (a compute server)
local machine = OS X El Cap 10.11.6
X11 = XQuartz 2.7.9 (xorg-server 1.17.4)
Matlab = R2013 (version irrelevant on this issue)

Alex Taylor
Alex Taylor on 26 May 2011
Have a look at:
The issue is that many of the graphics components of the MATLAB display use the native window system on the Mac, not X11.

Titus Edelhofer
Titus Edelhofer on 26 May 2011
usually this should work. Did you try to play around with the DISPLAY variable? E.g. setting it explicitly to (following depends on your shell):
setenv DISPLAY=yourmachine:0
Titus Edelhofer
Titus Edelhofer on 26 May 2011
Hi Walter,
oops, of course you are right ...

Sign in to comment.

Walter Roberson
Walter Roberson on 26 May 2011
If MATLAB thought that you were using a graphic display, it would have opened the desktop (unless you specifically asked otherwise.)
I do not have MATLAB on my Mac to test with as mine machine is too old to be supported, so I do not know how it works. I would speculate that MATLAB uses the Quartz or Carbon graphics interface rather than X11, as X11 is much slower on Mac.
  1 Comment
Jason on 26 May 2011
MATLAB is run in 'nodesktop' mode when remotely connecting (which is the way I also run it when using it locally and on Linux machines). However, when either using it locally or remotely on Linux, I have no issue with the figure windows. This is a Mac-specific problem.

Sign in to comment.

Jason on 26 May 2011
For further information, here is what is displayed when MATLAB launches:
Thu May 26 09:31:33 [machinename] MATLAB_maci64[88266] Error: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Warning: No window system found. Java option 'MWT' ignored
< M A T L A B (R) >
Copyright 1984-2010 The MathWorks, Inc.
Version (R2010b) 64-bit (maci64)
August 16, 2010
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit
  1 Comment
Walter Roberson
Walter Roberson on 26 May 2011
If it was trying to use Carbon and failing to find a Carbon window system, what error message would it display?

Sign in to comment.

Jason on 26 May 2011
Thanks Alex for that information and I have actually done this (along with the -nodesktop option). However, the -nojvm option is no longer supported and functional for MATLAB:
To no avail, the '-nodesktop' option also does not produce figure windows.
  1 Comment
Walter Roberson
Walter Roberson on 26 May 2011
Odd, that page says "The -nojvm option is available for UNIX platforms" but the page it then refers you to for more information specific to unix says that handle graphics is not supported. Probably the "not supported" is more correct.
Sigh. I like Mac, but it is this kind of non-support for X11 that tends to drive me towards Linux.

Sign in to comment.

Craig on 20 Oct 2011
Interestingly I'm able to use the -nojvm with matlab on a mac pro from my laptop with ubuntu installed. Every time I call figure it says
Warning: This functionality is no longer supported under the -nojvm startup
option. For more information, see "Changes to -nojvm Startup Option" in the
MATLAB Release Notes. To view the release note in your system browser, run
web('', '-browser')
However all the plot functionality works... so now all I have to do is remember how to suppress that pesky warning ;-)
  1 Comment
Craig on 20 Oct 2011
to do this simply run warning('off','MATLAB:HandleGraphics:noJVM')

Sign in to comment.

Y Huang
Y Huang on 23 Jan 2013
Anyone has any solution?
"-nojvm" not working here - Matlab 2012b ( - it simply prevents making any figure.

Andy on 16 Jan 2015
Hi, I'm having the same trouble. -nojvm used to fix the X11 forwarding problems, but in the newer versions of matlab, there are no figures using -nojvm
My figures are showing up on the remote machine where matlab is running, not the machine I am working from. X11 is set up properly -- other programs are properly sending their windows to my laptop. This is a Mac-X11-matlab-java interaction.

Atsushi Takahashi
Atsushi Takahashi on 30 Jan 2015
I have the same issue. Everything was working fine on Mavericks but when I upgraded to Yosemite, it all stopped. I tried to go back and have tried installing MATLAB 2012a, 2012b, 2014b with the same results:
I can log into my Mac Mini server, and open an xterm or xeyes and that works. I start MATLAB -nojvm or -nodesktop and the figures appear on my Mac Mini screen instead of on my Linux machine where I started the ssh -X session...
I have tried this under Yosemite and a fresh install of Mavericks on a different disk.
One hint, perhaps? When I install MATLAB it says I don't have JRE and gives me the option to install without JRE, Get JRE (from Oracle) or "I have JRE." Not sure if it cannot find it because the Apple JRE is not in the rght place?
Or is it an xauth problem?
Thanks! Any hints would be very helpful!

Monica on 10 Apr 2015
Try running
matlab -nodesktop
  1 Comment
Vladislav Sekulic
Vladislav Sekulic on 27 Apr 2015
No, this doesn't work, either (I have the same problem as the previous posters, on Mac OS X Yosemite 10.10.3).

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!