
Seamlessly Connect VSCode to RHEL 10 for Remote Development
Unlock the full potential of your development workflow by combining the powerful, feature-rich experience of Visual Studio Code on your local machine with the robust performance of a Red Hat Enterprise Linux 10 server. Remote development isn’t just a convenience; it’s a game-changer for handling large projects, leveraging powerful server-side hardware, and maintaining a clean, consistent development environment.
This guide provides a comprehensive walkthrough for setting up a secure and efficient remote development environment using VSCode and RHEL 10.
Why Use VSCode for Remote Development?
Before diving in, it’s important to understand the benefits. When you connect VSCode to a remote server, you aren’t just editing files over a network drive. VSCode installs a lightweight server component on the remote machine, allowing your local editor to interact directly with the server’s file system and terminal.
This means you get:
- Local Editor Performance: Enjoy the fluid, responsive UI of your desktop VSCode installation.
- Full Server Power: All compilation, code execution, and intensive tasks run on the RHEL 10 server, using its CPU and RAM.
- Seamless Terminal Integration: The integrated terminal in VSCode becomes a direct shell into your RHEL 10 server.
- Extension Compatibility: Many of your favorite extensions will run directly on the server, providing rich language support and linting right where your code lives.
Step 1: Preparing Your RHEL 10 Server
The first step is to ensure your RHEL 10 server is ready to accept secure connections. This involves installing and configuring the OpenSSH server.
First, connect to your server and ensure the SSH server package is installed and running.
sudo dnf install openssh-server
Once installed, you need to enable and start the SSH service so it runs automatically on boot.
sudo systemctl enable --now sshd
Next, and crucially, you must configure the firewall to allow SSH traffic. RHEL 10 uses firewalld by default. The following command permanently adds a rule to allow SSH connections and reloads the firewall to apply the change.
sudo firewall-cmd --add-service=ssh --permanent
sudo firewall-cmd --reload
Your RHEL 10 server is now configured to accept secure shell connections.
Step 2: Configuring Your Local VSCode Environment
With the server ready, the focus shifts to your local machine. The magic behind VSCode’s remote capabilities lies in a specific extension.
- Open Visual Studio Code.
- Navigate to the Extensions view (Ctrl+Shift+X).
- Search for
Remote - SSHand install the official extension provided by Microsoft. This extension is the core component for managing remote connections.
Once installed, a new green icon will appear in the bottom-left corner of your VSCode window. This is your gateway to remote sessions.
Step 3: Establishing the Connection
Now it’s time to connect the two environments. The Remote - SSH extension makes this process straightforward.
- Click the green remote icon in the bottom-left corner or press F1 to open the Command Palette and type
Remote-SSH: Connect to Host.... - Select
+ Add New SSH Host.... - Enter the SSH command to connect to your server, for example:
ssh your_username@your_server_ip - You will be prompted to select an SSH configuration file to update. The default option is usually the correct choice.
This action automatically adds a new host entry to your SSH configuration file, making future connections as simple as clicking a button. You can view and manage these hosts by clicking the remote icon and selecting a host from the dropdown list.
When you connect for the first time, VSCode will automatically download and install the required VSCode Server component on your RHEL 10 machine. This process is fully automated and may take a minute.
Step 4: Start Developing Remotely
Once the connection is established, your VSCode window reloads and you are now operating on the RHEL 10 server. You can confirm this by looking at the green remote indicator in the bottom-left, which will now display your server’s address.
- Open a Folder: Go to File > Open Folder… and you will be browsing the filesystem of your RHEL 10 server. Select your project directory to get started.
- Use the Terminal: Open a new terminal (**Ctrl+
**) and you'll have a direct shell prompt on your remote machine. You can now rungit,npm,gcc`, or any other command-line tool installed on the server.
Security Best Practice: Use SSH Key Authentication
For a significant security improvement, it is highly recommended to use SSH keys instead of passwords. This method is more secure and more convenient.
- Generate an SSH Key: If you don’t have one, open a terminal on your local machine and run
ssh-keygen. Follow the prompts, and it’s best practice to secure your key with a strong passphrase. - Copy the Key to the Server: The easiest way to copy your public key to the RHEL 10 server is with the
ssh-copy-idcommand.
bash
ssh-copy-id your_username@your_server_ip
- Connect Seamlessly: The next time you connect via VSCode, you will be prompted for your key’s passphrase (if you set one) instead of your server password, streamlining your login process.
By following these steps, you have successfully bridged your local VSCode editor with a powerful RHEL 10 server, creating a secure, efficient, and modern development workflow.
Source: https://infotechys.com/remote-development-in-vscode-on-rhel-10/


