Visual Studio Code allows you to write and run programs stored on the Linux server directly from your laptop. You will use the Remote SSH extension that is already installed in VS Code.
Step 1: Open VS Code
Launch VS Code on your laptop.
Step 2: Open the Remote SSH Command
Press:
Ctrl + Shift + P (Windows) Command + Shift + P (macOS)
In the command box that appears, type:
Remote-SSH: Connect to Host...
Press Enter.
Step 3: Add the Linux Server
If you do not see the Kenyon server listed, add it manually.
Select:
Add New SSH Host
Enter the connection:
ssh <your username>@10.192.145.179
Example:
ssh jones1@10.192.145.179
Choose the default SSH config file location when prompted.
Step 4: Connect to the Server
Select the host:
10.192.145.179
Choose:
Linux
when asked for the remote operating system.
If this is your first time connecting, you will be asked to trust the host. Choose “Yes”.
If you already completed SSH key setup, you will connect automatically.
If not, you will be asked for your password. Enter your student ID password.
Step 5: Create a Folder for Your Code
Once connected, open a terminal inside VS Code:
Ctrl + `
(That is a backtick key, under ESC.)
Then create a working directory:
mkdir csds cd csds
Step 6: Create a C++ File
In VS Code:
- Click “File”
- Choose “New File”
- Save it as:
main.cpp
Type in this code:
#include <iostream>
using namespace std;
int main() {
cout << "Hello from VS Code on Linux!" << endl;
return 0;
}
Save the file.
Step 7: Compile and Run on the Server
In the VS Code terminal:
g++ main.cpp -o app ./app
You should see your program output:
Hello from VS Code on Linux!
Step 8: Editing and Debugging
Everything you edit and save in VS Code is stored on the server.
You can open and modify multiple files, make folders, and use Git version control.
Optional: Reconnect Later Without a Password
If you have not already set up SSH keys, please do so using the login instructions on the website. Passwordless login greatly improves your workflow.
You Are Ready to Develop!
You can now:
- Write C++ code
- Compile and run programs on a real Linux system
- Use debugging and Git tools inside VS Code
- Develop exactly like software engineers do in the field
If you have any issues, contact your instructor or bring your laptop to the next class for assistance.
