fgu*_*len 21 macos vnc screensharing raspberry-pi raspbian
我想使用Screen Sharing OSx内置应用程序来操作我的Raspberry PI中打开的实际X会话.
为了清楚起见,我希望在我的VNC会话中看到Raspberry通过HDMI发送的相同图像.所以我可以在我的电脑中移动鼠标,光标也在Raspberry屏幕上移动.
我已经尝试了几种vnc-servers和configs的组合,但都没有工作.
fgu*_*len 40
因为我已经花了几个小时来解决这个问题,所以如果有人需要我的指示,我会回答我自己,因为我想找到它们.
首先,最受欢迎的vnc-server(tightvncserver)并未满足我的规范,即X-session必须在我的VNC客户端应用程序和Raspberry屏幕中相同.
执行此工作的vnc服务器是x11vnc
sudo apt-get install x11vnc
Run Code Online (Sandbox Code Playgroud)
看起来它需要您设置密码:
x11vnc -storepasswd
Run Code Online (Sandbox Code Playgroud)
您已经可以启动vnc-server:
x11vnc -forever -usepw -display :0 -ultrafilexfer
Run Code Online (Sandbox Code Playgroud)
检查服务是否有效并正在收听
$ sudo netstat -nlp | grep vnc
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 2575/x11vnc
Run Code Online (Sandbox Code Playgroud)
只需打开屏幕共享并介绍Raspberry的ip,从Mac连接:
配置:
# ~/.config/autostart/x11vnc.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false
Run Code Online (Sandbox Code Playgroud)
确保访问此文件没有问题:
sudo chmod a+r ~/.config/autostart/x11vnc.desktop
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install netatalk
sudo apt-get install avahi-daemon
sudo update-rc.d avahi-daemon defaults
Run Code Online (Sandbox Code Playgroud)
配置:
# /etc/avahi/services/afpd.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>
Run Code Online (Sandbox Code Playgroud)
配置2:
# /etc/avahi/services/rfb.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_rfb._tcp</type>
<port>5900</port>
</service>
</service-group>
Run Code Online (Sandbox Code Playgroud)
重启服务:
sudo /etc/init.d/avahi-daemon restart
Run Code Online (Sandbox Code Playgroud)
将Finder用于" 共享">"全部... "部分应该是您的Raspberry.从那里你可以点击按钮共享屏幕...
| 归档时间: |
|
| 查看次数: |
23594 次 |
| 最近记录: |