MATLAB on a MacBook 13″

As of late I’ve been looking for an optimal solution for running MATLAB on my brand new MacBook. I’ve tried running things natively under Windows & Linux as well as in Parallels for both, and the concept of rebooting ad-nauseum or working in a rooted (ie, having an operating system with a root window running) environment for either one doesn’t sound great unless one has an attached external display. With Windows this even allows for seamless mouse movement between environments. But either way, you’re sucking up a whole bunch of non-resizable (changing resolutions is a little too slow) screen realestate sucking windows either minimized or consuming one’s desktop. What solution is there for this without having to emulate MATLAB under Rosetta?I’m glad you asked. While The MathWorks doesn’t support running MATLAB remotely through X11 forwarding or anything else, it actually works quite well so long as things are set up properly. The 3D performance will never be fantastic since GLX doesn’t work with forwarding, at least with Apple’s X11 (though perhaps it doesn’t do this at all considering in most cases the bandwidth usage would be prohibitive), however, everything else works great. I’ve been using a similar solution to access MATLAB graphically (no desktop) on a linux box using Windows & Mac clients, and it works perfectly.So, I thought to myself, why not make a minimal linux setup under parallels that can boot an run matlab, and then use SSH & Apple’s X11 to access this environment locally. In the end you get individual plot windows, edit windows, etc.. that are just like other apps on your Mac, except that it’s running through a local virtual environment.I’m going to work on a guide for getting things set up in this manner, though I need to work on tweaking the setup a bit to minimize the size of the linux install, and get the networking working properly (I’ve been having troubles as of late when switching between VPN, wireless & hardwired connections.). I will however give a quick rundown of what’s necessary to get this working.

  1. Parallels (here)
  1. Use Host-only networking, with internet sharing enabled, or not.
  • Linux (I’m using Ubuntu, but I’m going to see if I can pare things down a bit using, perhaps Slackware, Gentoo, or another Distro)
    1. Make sure you have X installed, and have an SSH daemon running
    2. MATLAB can be installed from loopback devices or actual CDs
  • SSH in with ssh -Y 192.168.2.X (where X is the class D portion of the IP for your environment, get the IP of your linux environment using ifconfig)
    1. Make sure you first “export DISPLAY=:0.0” & Start Apple X11
    2. The -Y is necessary, though less secure, to enable trusted status for X connections coming over SSH.. if you do not enable this, sometimes windows won’t be sized properly, and other X apps may die very horrible deaths due to other issues, which I don’t know the technical origins of (pptpconfig is one such app)
  • Start up matlab! Personally I’m using “matlab -nodesktop” since I prefer running things from terminal. You still get Java plots and whatnot.
  • After a little more playing around with things I may post a parallels image with a minimal linux distro or something along those lines (if anyone is interested), along with brief instructions on installation.Notes:

    • This is still ugly since a fixed amount of RAM needs to be allocated for the whole environment.
    • 3D stuff is damned slow
    • I still consider this to be a nice holdover while waiting for TMW to release an intel compatible Mac release (or beta).
    Posted in Uncategorized

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    %d bloggers like this: