Running Matlab Remotely

Note: I have moved my blog to my personal site. The most updated version of this post can be found here.

I have a Matlab R2007a installation on the Windows partition of my Macbook (using Bootcamp). Since I mostly use Mac OS for my daily work, it is inconvenient to have to reboot to Windows every time I need to use Matlab (and Octave cannot save me). I don’t like Matlab R2007a for Mac OS because it’s a little unstable and its user interface is ugly. I don’t like to use Parallel or Fusion because they make my system slower and Windows requires re-activation every time I switch between Bootcamp and the virtualization software. Furthermore, I don’t want to spend money on those software packages. And of course, I don’t have money to purchase the latest version of Matlab. So, what’s the solution? I’ve just discovered one.

My lab has a powerful server which has a full installation of a sub-latest version of Matlab (R2007b) with a network license. I’ve found out that I can connect to that server with X Window tunneling, which allows me to run Matlab on the server computer from my laptop. The interesting thing is that, with X Window tunneling, I have a full Matlab GUI on my laptop. So, it’s like having Matlab on your local computer. With a fast network connection (which is the case whenever I use my school network), running Matlab remotely on the server has some advantages:

  • You don’t have to purchase Matlab, yet having a full installation.
  • You still have full user interface and features as a local Matlab installation, even Simulink runs smoothly.
  • No worry about installing, upgrading, maintaining.
  • Faster Matlab if the server computer is powerful and no other users are doing anything heavy on the server. Actually, most of the time, the remote Matlab is faster than my local Matlab in heavy computation tasks.

Feeling very happy now.

Update: one commenter asked me to elaborate on the steps to run Matlab remotely, so here they are:

Requirements: notice that I don’t use Windows, and these steps are not for Windows; Windows users are probably out of luck. (Windows users might need to install Cygwin/X in order to run X Window, and I believe SSH can be installed on Cygwin).

  • A remote computer (a server) with Matlab installed and has SSH-server capability. OpenSSH is a free SSH package; sshd must be installed and enabled. If the server runs Linux or any UNIX variant, sshd should be pre-installed or is very easy to install. If it runs Mac OS, enable SSH server by going to System Preferences/Sharing and activate Remote Login.
  • You have an account (user-name and password) on the server; your account is allowed to access the server remotely. The server is configured to have a static IP address, which you know.
  • The computer you are using (the client) has X Window system installed. If you runs Linux or any UNIX variant, with GUI, you are good to go. If you runs Mac OS, you need to install X11 whose installer is available on the MacOS disk and also online.
  • The client must have SSH-client installed (see the first requirement, but you don’t need the SSH-server). If your computer runs Linux/UNIX or Mac OS, SSH is usually pre-installed and you don’t need to do anything.

Steps:

  1. Open a terminal on the client. On Mac OS, you must open the X11 terminal, not the default terminal; you can do so by opening the X11 application.
  2. In the terminal, run the command:ssh -X username@server.address. Enter your log-in credentials to remotely log-in to the server via SSH. The -X option is to enable X Window tunneling.
  3. Now you can run any X Window application on the server, and its GUI elements will be displayed on your client computer. You can work with the application as if you are running it on the client. Matlab can usually be started by the command matlab. I would suggest using -nosplash and -nodesktop options. The second option will cause Matlab to run in the console instead of the full GUI. This might be a bit inconvenient but it is faster. Any Matlab GUI you start (e.g. plot windows, Simulink windows…) will still open as usual. You may experience a sluggish GUI, depending on the quality of the network connection between the client and the server.
  4. After you finish, close the remote connection by running exit in the SSH’s console.
Advertisements
This entry was posted in Computer, Matlab and tagged , , , . Bookmark the permalink.

5 Responses to Running Matlab Remotely

  1. Steve says:

    Hi,
    I’ve being searching a way to do that! Great! Can you please elaborate on how you did that? I will look it up in google, but it would help to direct me to the right path 🙂

    thanks in advance

    Steve

  2. niran says:

    hi,
    This is a great information. Thankyou

  3. Fred Hoover says:

    Here is good remote access to matlab, with free 30 days trial for testing https://www.apponfly.com/en/application/matlab?KAI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s