type
status
date
Jun 21, 2023 09:35 AM
slug
summary
tags
category
icon
password
Using X11 Forwarding over SSH, we can run graphical application that exist on a remote server from a client computer. This technique quite different compared to VNC or RDP, as it only uses an SSH connection to forward X11 graphical application. Now, I want to share how to setup X11 forwarding over SSH from remote machine (Raspberry) in VS Code run on Windows 10 as client computer.
step1. 下载并执行VcXsrv
- Install X11 Server in Client Computer (Windows 10) In order to run X11 Forwarding over SSH, we must be running an X server program on Client Computer. There are several X server program available on internet, one of them is VcXsrv.
Download latest VcXsrv from release page here, https://github.com/ArcticaProject/vcxsrv/releases
Install & Run
VcXsrv
in our Client Computerstep2. win 添加环境变量
Add Windows Environment Variable :
DISPLAY = localhost:0.0
step3. Setup DSPLAY variable on VS Code
Open VS Code and press F1
Search and open Preferences: Open Setting (UI)
Search
terminal.integrated.env.windows
in VS Code Setting UIClick Edit in setting.js
Modify terminal.integrated.env.windows in setting.js to :
step4. Modify SSH Connection in VS Code
edit
~/.ssh/config
file, From
To,
step5. Test X11 Forwarding in VS Code
Connect to Raspberry, using modified connection in previous step,
Open remote terminal in VS Code, and type
chromium-browser
DONE
问题 debug:
- win 下
echo %DISPLAY%
看是否生效
- 看
VcXsrv
是否运行成功. 考虑重启一下试试.