🏕️树莓派 camera 操作笔记-8 x11 forward 在win 开发机显示 raspberry preview 画面的方法
2023-6-21
| 2023-6-21
0  |  0 分钟
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

  1. 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 Computer

step2. 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 UI
Click 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:

  1. win 下 echo %DISPLAY% 看是否生效
  1. VcXsrv 是否运行成功. 考虑重启一下试试.
工作学习
  • 开发
  • 图像编程
  • Raspberry
  • 似乎是 vscode ssh 异常导致 vps 端口异常发完周报
    目录