A note on running mathematica remotely using Xming

Related: notes on setting up mathematica fonts for remote runs under *nixes

I’ve been trying to run mathematica remotely off the Unix cluster at school (using the excellent Xming X Window server under Windows), but apparently fonts that remote applications call need to be installed locally. There are two ways to solve this: install the fonts locally, or use a font server. If Caltech or my department in particular is running a font server, I can’t find any reference to it on the IT sites, so let’s have a go at the first option.

Surprising to me, Wolfram provides the latest versions of the Mathematica font files: Windows fonts, Unix fonts.

Get Xming, install it, and get Xming-fonts, install that too. Get the Unix fonts from above and unarchive them. You have two options here: keep the Mathematica fonts in a separate location from Xming’s, or mix them in. I prefer keeping them separate– updating is easier that way. Follow the appropriate instructions for initializing the font directories (running mkfontscale) for whichever option you choose.

If you installed the fonts to the Xming font directories, you can run Xming as usual and start mathematica over a SSH-tunneled X session. If you didn’t, you can either always start Xming from the command line using e.g.:

Xming -fp "built-ins,C:/Program Files/Xming/fonts/misc/,
               C:/Program Files/Xming/fonts/TTF/,
               C:/Program Files/Xming/fonts/Type1/,
               C:/Program Files/Xming/fonts/75dpi/,
               C:/Program Files/Xming/fonts/100dpi/,
               C:/Mathematica Fonts/Type1,
               C:/Mathematica Fonts/BDF"
         -multiwindow -clipboard

or add the appropriate directories to the font-dirs file in C:\Program Files\Xming. Also, if you’ve already started an SSH session without doing either of the above, you can still add the fonts by using xset from within the SSH session:
xset fp+ "C:/.../Fonts/Type1, C:/.../Fonts/BDF"

I don’t know what the AFM directory is in the Mathematica font distribution: you can leave it out of the font paths and Mathematica will run fine. Maybe it just needs to be there, relative to the Type1 and BDF dirs?

4 Responses to “A note on running mathematica remotely using Xming”

  1. Anonymous Says:

    great notes, thank you!

  2. Firestone 214 Says:

    Yes, but it’d be *cool* if you could tell me how to do this on a linux box that I don’t have root access too, e.g. library computers. Of course, if I had root access, google gives me dozens of pages describing what to do…

  3. Alex Says:

    It’d be *cool* if you weren’t a hater.

  4. Stephen Says:

    So, my answer was on the mathematica website, but I didn’t see it at first because they had so much other unnecessary info. It’s basically the same as your Windows stuff. Here’s what I do:

    The setup: the server I run Mathematica off of has its fonts in a certain location. My local machine’s fonts are in a different location (in this case, I did a local user install of Mathematica 6, so my local machine’s Mathematica base directory is MATHBASE=~/mathematica; you don’t need a full Mathematica install, because they will also provide the font file — see link at end).

    I run these commands (or put them into a script):
    >> xset fp+ MATHBASE/SystemFiles/Fonts/Type1/
    >> xset fp+ MATHBASE/SystemFiles/Fonts/BDF/
    >> xset fp rehash

    where MATHBASE is wherever Mathematica or the Font Files are installed.

    I’m not even sure if the rehash is necessary. Alternatively, a sysadmin suggestesd to me that you can set up symbolic links on your local computer that point from the (non-existent) remote-computer’s font files to your computer’s actual font files, but again, this probably requires root access since the the remote-computer’s font files should not be in a user-writable location.

    References:
    http://support.wolfram.com/mathematica/systems/linux/general/fonterrors.en.html
    and
    http://reference.wolfram.com/mathematica/tutorial/FontsOnUnixAndLinux.html

Leave a Reply