Runnng IDL Without an X Server
QUESTION: I run IDL on a LINUX machine, logged on from a Windows machine. If the Windows machine doesn't have an X server running, IDL won't start. What do I have to do to get IDL to run correctly? (I don't really want to do graphics, just run a math analysis program.)
![]()
ANSWER: As you know, X servers are not really my thing. :-)
But this topic did come up in an IDL newsgroup thread entitled "IDL without X on Linux" on March 3, 2005. Here is a short synopsis of the answers.
- If you can modify the source code and do not need to make plots.
Just simply avoid any calls to DEVICE or any other command that would create a window on the display (PLOT, WINDOW, etc). The easiest way to avoid creating windows is to set the current graphics device to NULL.
Set_Plot, 'NULL'
Note that calls to DEVICE are often found in your IDL start-up file. Be sure to also remove them from there!
- If you can modify the source code and you need to make plots.
Set the current graphic device to the Z-buffer (Set_Plot, 'Z') and leave it that way. Your graphics displays will now be going to an "offscreen" device that will not be displayed anywhere, but all your graphics commands will still work.
If using object graphics, use IDLgrBuffer instead of IDLgrWindow.
- If you can't modify the source code and the code needs an X server.
Download Xvfb, run it and set the DISPLAY variable to the Xvfb session. Xvfb (X virtual frame buffer) is basically an X server which runs offscreen and doesn't need to have any physical display. Programs which need X servers don't realize that it's running off screen. Let's say that you start an Xvfb session on server 1, screen 0. Before running the IDL program you'd need to set the DISPLAY environmental variable to your_machine_name:1.0. Typically you will write a little shell script that sets the DISPLAY and then runs your IDL program. That way you don't have to remember to set DISPLAY each time.
Additional information about Xvfb can be found on the RSI web page.
![]()
Additional Information
You can find a great deal of additional information about using the Z-graphics buffer and Xvfb on Ken Bowman's web page. I highly recommend reading his article if you want to do this kind of thing.
![]()
Copyright © 2005-2008 David W. Fanning
Last Updated 3 March 2008
