{"id":137919,"date":"2021-12-03T15:09:46","date_gmt":"2021-12-03T20:09:46","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=137919"},"modified":"2024-06-12T16:37:09","modified_gmt":"2024-06-12T20:37:09","slug":"ssh-x-forwarding","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/ssh-x-forwarding\/","title":{"rendered":"SSH with X Forwarding"},"content":{"rendered":"<div id=\"x-forwarding\">\n<p><a name=\"top\"><\/a><\/p>\n<h2>Overview<\/h2>\n<div class=\"highlight-yellow\"><strong>Due to the ease of use and excellent graphics performance of the <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/scc-ondemand\/\">SCC OnDemand<\/a> system&#8217;s Desktop Session, we recommended its use instead of using X forwarding as described here.<\/strong><\/div>\n<p>X Forwarding is the term for running software on a remote Unix or Linux computer (such as <b>scc1.bu.edu<\/b>) while displaying the graphics (interface and resulting images) to one&#8217;s local machine (such as a Windows desktop). This functionality is useful for applications such as MATLAB that require a graphical user interface. It is possible to do on all major operating systems but the difficulty of doing so varies. X Forwarding will perform best if your computer is connected to the BU campus network using a wired Ethernet connection.<\/p>\n<p>However, if you do wish to use X Forwarding with an <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/ssh\/\">SSH Client<\/a>, please consult the appropriate section for your operating system:<\/p>\n<h4>Select your operating system<\/h4>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><strong><input name=\"os\" id=\"windows1\" onclick=\"show_os('windows')\" value=\"windows\" type=\"radio\" \/><\/strong><br \/>\n<strong> <label for=\"windows1\"><br \/>\nMicrosoft Windows<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"os\" id=\"apple1\" onclick=\"show_os('apple')\" value=\"apple\" type=\"radio\" \/><br \/>\n<strong><label for=\"apple1\"><br \/>\nApple OS X<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"os\" id=\"linux1\" onclick=\"show_os('linux')\" value=\"liux\" type=\"radio\" \/><br \/>\n<strong><label for=\"linux1\"><br \/>\nLinux Distributions<\/label><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!-- Windows --><\/p>\n<div id=\"windows\">\n<h2>Windows<\/h2>\n<p>An X-Server can be installed and configured on a Microsoft Windows system in a few different ways. This section will focus on the MobaXterm application, which was used in the SSH and FTP guides, for simplicity. Other software options are listed below<\/p>\n<h4>X-Forwarding Clients<\/h4>\n<ul>\n<li><a href=\"http:\/\/mobaxterm.mobatek.net\/\">MobaXterm<\/a><\/li>\n<li><a href=\"https:\/\/www.bu.edu\/tech\/z-retired-pages\/windows\/x-win32\/\">X-Win 32<\/a> (proprietary, BU site license)<\/li>\n<\/ul>\n<h4>Viewing Graphics using MobaXterm<\/h4>\n<ul>\n<li>MobaXterm has an X-server built-in, so after you <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/getting-started\/connect-ssh\/\"> login to the SCC<\/a> you should be able to launch a remote graphical application without any extra work.<\/li>\n<li>To check that the X-server is working properly, type <b>xclock<\/b> at the command prompt and hit &#8220;Enter&#8221;:\n<pre><code><span class=\"prompt\">scc1$<\/span> xclock<\/code><\/pre>\n<p>A new graphics window showing an analog clock should appear on your desktop:<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2013\/10\/xclock.png\" style=\"margin: 10px;\" width=\"529\" height=\"322\" class=\"alignnone\" alt=\"New window displays analog clock on black background with white command codes.\" \/><\/li>\n<li>Close the window to return to the command prompt.<\/li>\n<\/ul>\n<\/div>\n<p><!-- END WINDOWS --><\/p>\n<p><!-- Apple --><\/p>\n<div id=\"apple\">\n<h2>Apple OS X<\/h2>\n<div class=\"highlight-yellow\">Following the release of OS X 10.8 <a href=\"http:\/\/support.apple.com\/kb\/ht5293\">support for X11 was removed<\/a> from the OS X operating system. If your computer is running 10.8 &#8220;Mountain Lion&#8221; or any newer version of OS X and you have never used X11 or X-forwarding on your computer, you will need to download and install <a href=\"http:\/\/xquartz.macosforge.org\">XQuartz<\/a> before continuing.<\/div>\n<h4>Viewing Graphics on OSX<\/h4>\n<ol>\n<li>Hold the <b>&lt;command&gt;<\/b> key down with your left hand and press the space bar with your right hand; type \u201cXQuartz\u201d followed by the <return> key. If nothing comes up, you must first install the XQuartz\/X11 application, which is available at <a href=\"https:\/\/www.xquartz.org\/\">https:\/\/www.xquartz.org\/<\/a>. Newer versions of the Mac OS do not automatically include it. Make sure you install the XQuartz package associated with your particular version of the Mac operating system. To find out the version number of your operating system, click on the apple icon in the upper-right hand corner of the screen, and then \u201cAbout This Mac.\u201d&nbsp;\n<p><\/return><\/li>\n<li>In the terminal, enter \u201c<code><span class=\"command\">ssh -Y<\/span> <span class=\"placeholder\">yourBULoginName<\/span><span class=\"command\">@scc1.bu.edu<\/span><\/code>\u201d. Don\u2019t forget the \u201c<code><span class=\"command\">-Y<\/span><\/code>\u201d option or it won\u2019t work. Next, hold down the <b>&lt;command&gt;<\/b> key with your left hand and press the \u201c<b>N<\/b>\u201d key with your right. This action will open a new X11 capable terminal window.<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2013\/11\/mac_scc2.png\" width=\"600\" height=\"733\" class=\"alignnone\" alt=\"The new window features a BU username atop a command terminal, with a detailed help section preceding the command line.\" \/><\/li>\n<li>Type <code><span class=\"command\">exit<\/span><\/code> in the terminal when you are done working on the SCC.<\/li>\n<\/ol>\n<\/div>\n<p><!-- END APPLE--><\/p>\n<p><!-- Linux --><\/p>\n<div id=\"linux\">\n<h2>Linux<\/h2>\n<ul>\n<li>X Forwarding should be built-in on your Linux machine but you will need to include the <code><span class=\"command\">-X<\/span><\/code> flag with your <code><span class=\"command\">ssh<\/span><\/code> command.\n<pre class=\"code-block\"><code><span class=\"prompt\"><span class=\"placeholder\">your_local_machine<\/span>%<\/span> <span class=\"command\">ssh \u2013X<\/span> <span class=\"placeholder\">yourBULoginName<\/span><span class=\"command\">@scc1.bu.edu<\/span><\/code><\/pre>\n<\/li>\n<li>To test that your display is working properly, you can run a simple graphical application to display an analog clock:\n<pre class=\"code-block\"><code><span class=\"prompt\">scc1$<\/span> <span class=\"command\">xclock &amp;<\/span><\/code><\/pre>\n<p>If you don\u2019t see a clock, then you either forgot to use the <code><span class=\"command\">\u2013X<\/span><\/code> (capital X) flag to <code><span class=\"command\">ssh<\/span><\/code> above or you have an issue with your local graphical setup.<\/li>\n<\/ul>\n<\/div>\n<p><!-- END LINUX --><\/p>\n<div id=\"backtotop\"><a href=\"#top\">Back to top<\/a><\/div>\n<p><script type=\"text\/javascript\">\r\nfunction show_os(os){    \r\nif (os == \"windows\"){\r\n \t   document.getElementById('windows').style.display = 'block';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t} \r\nelse if (os == \"apple\"){\r\n \t   document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'block';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n         }   \r\nelse if (os == \"linux\"){\r\n           document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'block';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t}  \r\nelse{\r\n \t   document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'none';\r\n     }\r\n }\r\n<\/script><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Due to the ease of use and excellent graphics performance of the SCC OnDemand system&#8217;s Desktop Session, we recommended its use instead of using X forwarding as described here. X Forwarding is the term for running software on a remote Unix or Linux computer (such as scc1.bu.edu) while displaying the graphics (interface and resulting&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":137911,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137919"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=137919"}],"version-history":[{"count":24,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137919\/revisions"}],"predecessor-version":[{"id":152689,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137919\/revisions\/152689"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137911"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=137919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}