<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Subrata Das</title>
    <description>The latest articles on DEV Community by Subrata Das (@subrata).</description>
    <link>https://dev.to/subrata</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F627906%2Fc71b612a-1e13-47c3-be27-cbcfbf6d330c.jpg</url>
      <title>DEV Community: Subrata Das</title>
      <link>https://dev.to/subrata</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/subrata"/>
    <language>en</language>
    <item>
      <title>Connect to Unsupported Older Linux servers with VS Code Remote-SSH using Custom glibc &amp; libstdc++</title>
      <dc:creator>Subrata Das</dc:creator>
      <pubDate>Tue, 15 Apr 2025 02:54:40 +0000</pubDate>
      <link>https://dev.to/subrata/connect-to-unsupported-older-linux-servers-with-vs-code-remote-ssh-using-custom-glibc-libstdc-m63</link>
      <guid>https://dev.to/subrata/connect-to-unsupported-older-linux-servers-with-vs-code-remote-ssh-using-custom-glibc-libstdc-m63</guid>
      <description>&lt;p&gt;VS Code Remote-SSH is a game-changer for remote development. However, if you’ve tried a recent version of VS Code (1.99.x or later) to connect to an older Linux distro, you may encounter this error:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[LinuxPrereqs]: The remote host may not meet VS Code Server's prerequisites for glibc and libstdc++ (The remote host does not meet the prerequisites for running VS Code Server)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This error indicates that the system requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;glibc &amp;gt;= 2.28&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;libstdc++ &amp;gt;= 3.4.25&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This issue is common with older CentOS, Debian, or Ubuntu LTS systems.&lt;/p&gt;

&lt;p&gt;Fortunately, a workaround using &lt;code&gt;brew&lt;/code&gt;, &lt;code&gt;glibc&lt;/code&gt;, and &lt;code&gt;patchelf&lt;/code&gt; can enable Remote-SSH on unsupported Linux targets. This guide will walk you through the steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solutions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;glibc&lt;/code&gt; and &lt;code&gt;patchelf&lt;/code&gt; using &lt;code&gt;brew&lt;/code&gt; (&lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;), or build from source, or use a prebuilt binary (if available). This guide uses &lt;code&gt;brew&lt;/code&gt;. Also you can see &lt;a href="https://code.visualstudio.com/docs/remote/faq#_can-i-run-vs-code-server-on-older-linux-distributions" rel="noopener noreferrer"&gt;this&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use environment variables to point VS Code to the custom &lt;code&gt;glibc&lt;/code&gt; and &lt;code&gt;patchelf&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Install glibc and patchelf
&lt;/h2&gt;

&lt;p&gt;By default, &lt;code&gt;glibc&lt;/code&gt; gets installed by &lt;code&gt;brew&lt;/code&gt;. Run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; glibc
&lt;span class="c"&gt;# Output: /home/username/.homebrew/opt/glibc (example output)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install &lt;code&gt;patchelf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;patchelf
which patchelf
&lt;span class="c"&gt;# Output: /home/username/.homebrew/bin/patchelf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set Remote Environment
&lt;/h2&gt;

&lt;p&gt;Set the following environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VSCODE_SERVER_CUSTOM_GLIBC_LINKER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/username/.homebrew/opt/glibc/lib/ld-linux-x86-64.so.2
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VSCODE_SERVER_CUSTOM_GLIBC_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/username/.homebrew/opt/glibc/lib
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VSCODE_SERVER_PATCHELF_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/username/.homebrew/bin/patchelf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use the &lt;code&gt;bash&lt;/code&gt; shell, add the above lines to the remote &lt;code&gt;~/.bash_profile&lt;/code&gt;. For the &lt;code&gt;zsh&lt;/code&gt; shell, add them to &lt;code&gt;~/.zprofile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can now proceed to connect with VS Code Remote-SSH, and it should work as expected. Let me know if you encounter any issues!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>glibc</category>
      <category>ssh</category>
      <category>remotessh</category>
    </item>
  </channel>
</rss>
