惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
B
Blog
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
A
About on SuperTechFans
H
Heimdal Security Blog
AI
AI
F
Full Disclosure
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
量子位
I
InfoQ
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
N
News and Events Feed by Topic
腾讯CDC
L
LINUX DO - 最新话题
Attack and Defense Labs
Attack and Defense Labs
Hacker News: Ask HN
Hacker News: Ask HN
Google Online Security Blog
Google Online Security Blog
博客园_首页
Forbes - Security
Forbes - Security
The Register - Security
The Register - Security
博客园 - 三生石上(FineUI控件)
PCI Perspectives
PCI Perspectives
V
Vulnerabilities – Threatpost
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LangChain Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
NISL@THU
NISL@THU
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
H
Hacker News: Front Page
Project Zero
Project Zero
P
Privacy International News Feed
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - 海乐学习

Java Maven 开发的常用命令 C语言开发的常用命令 三汇Linux配置Config说明 Java实现优雅的关闭程序并执行清理流程的写法 C语言开发中优雅的关闭程序并执行清理流程的写法 将C语言开发的程序做成 麒麟系统的服务(Systemd 标准服务,Linux 通用) 实现开机自启动 ZeroMQ的DEALER双帧结构(路由空帧 + 业务帧)(支持异步收发、主动推送事件)C写服务端 java写客户端 ZeroMQ中ZMQ_DEALER单帧数据(支持异步收发、主动推送事件)C写服务端 java写客户端 win10系统中 关闭专注助手 执行 xx.sh 脚本文件时出现: /bin/bash^M:解释器错误: 没有那个文件或目录 运行编译打包好的 xxx.jar 中没有主清单属性 出现这个错误 将Java编译的 .jar文件做成 麒麟系统的服务(Systemd 标准服务,Linux 通用) 实现开机自启动 将Java编译的 .jar文件做成windows服务 实现开机自启动 方法二 RabbitMQ在麒麟系统中离线安装说明 VMware启动虚似机后出现 无法获取快照信息: 锁定文件失败 模块“Snapshot”启动失败。未能启动虚拟机。 C语言在Linux中开发完整Demo包含读配置文件写日志和定时器Timer C语言在Linux中开发读取配置文件app.conf 麒麟V10 Server系统中搭建C语言开发环境 麒麟ServerV10 修改IP4地址 麒麟ServerV10 配置IP4 当系统中有两个版本的Maven时,用IDEA创建Maven有时会出错 麒麟ServerV10安装 espeak-ng 和 ffmpeg 方法 C语言在Linux中开发没有界面纯后台运行的Demo程序(含日志和Timer) C语言在Linux中开发使用定时器Timer在界面上显示时间 C语言在Linux中开发带界面的程序(含每小时日志) C语言在Linux中开发第一个项目Hello Word 在apache-maven项目中使用log4写日志 在apache-maven项目中解决中文乱码问题 在apache-maven项目中读取配置文件 创建apache-maven项目 远程桌面连接时出现身份验证错误 要求的函数不受支持 这可能是由于CredSSP加密数据库修正 win10系统查看电脑从锁屏状态回到使用状态 apache-maven的常用命令 C语言在 Linux 中的常用命令 apache-maven安装配置 麒麟CentOS下安装ZeroMQ开发包 win10弹出 无法使用内置管理员账户打开 Microsoft Edge。请使用其他账户登录 在麒麟系统上安装Qwen3-TTS文字转语音 在麒麟系统上安装MaryTTS文字转语音 FTP上传Linux/Unix文件系统权限的修改方法 麒麟系统Kylin Linux Advanced Server 中安装 python3.10 将exe做成windows服务 java实现ftp上传 java实现TTS文字转语音wav (Jacob + SAPI) node.js和Next.js 编译部署说明
Window上用VS Code + Remote-SSH组件的方式来实现开发编译Linux上的C++程序
海乐学习 · 2026-03-09 · via 博客园 - 海乐学习

VS Code Remote-SSH 工作方式

1 ┌─────────────────────────────────────────────────────────────┐
2 │ Windows 本机 │
3 │ ┌──────────────────────────────────────────────────────┐ │
4 │ │ VS Code 界面 (GUI) │ │
5 │ │ - 代码编辑 │ │
6 │ │ - 文件浏览 │ │
7 │ │ - 终端 │ │
8 │ │ - 调试器前端 │ │
9 │ └──────────────────────────────────────────────────────┘ │
10 │ │ │
11 │ │ SSH 连接 │
12 │ ▼ │
13 └─────────────────────────────────────────────────────────────┘
14 │
15 │ 网络
16 │
17 ┌──────────────────────────▼──────────────────────────────────┐
18 │ Linux 远程服务器 │
19 │ ┌──────────────────────────────────────────────────────┐ │
20 │ │ VS Code Server (后台进程) │ │
21 │ │ - 文件系统访问 │ │
22 │ │ - 编译器 (g++) │ │
23 │ │ - 调试器 (gdb) │ │
24 │ │ - Make/CMake │ │
25 │ └──────────────────────────────────────────────────────┘ │
26 │ │ │
27 │ ▼ │
28 │ 你的代码 (在 Linux 文件系统上) │
29 │ 直接调用 Linux API 和硬件驱动 │
30 └─────────────────────────────────────────────────────────────┘

具体功能


┌──────────┬─────────────────────────────────────────────────┐
│ 功能 │ 说明 │
├──────────┼─────────────────────────────────────────────────┤
│ 编辑代码 │ 在 Windows VS Code 中直接编辑 Linux 上的文件 │
│ 文件同步 │ 无需手动同步,直接操作远程文件 │
│ 编译运行 │ 在 VS Code 终端中执行 make,实际在 Linux 上运行 │
│ 调试 │ 可以设置断点、单步调试,gdb 在 Linux 上执行 │
│ 插件 │ 大部分插件在远程 Linux 上运行 │
└──────────┴─────────────────────────────────────────────────┘


配置步骤

1. 在 Windows 上安装 VS Code
2. 安装 Remote-SSH 插件 (Microsoft 出品)
3. 配置 SSH 连接 - 按 F1 → Remote-SSH: Connect to Host
4. 连接后 - VS Code 窗口左下角显示 SSH: <主机名>

优点

- ✅ 代码实际运行在 Linux 上,可以调用所有 Linux API 和硬件驱动
- ✅ 使用 Windows 熟悉的编辑环境
- ✅ 无需文件同步,直接编辑远程文件
- ✅ 性能好在本地,编译在远程

一、安装 Remote-SSH 插件 (Microsoft 出品)

image

 二、 配置 SSH 连接 - 按 F1 → Remote-SSH: Connect to Host

image

image

image

image

右下角出现

image

若出现 

“过程试图写入的管道不存在。”  字样的错误

则在cmd中执行

icacls "C:\Users\YOYO\.ssh\config" /inheritance:r
icacls "C:\Users\YOYO\.ssh\config" /grant "%USERNAME%:R"

若出现

image