硬件平台:Raspberry Pi 2, Model B, 1GB RAM
系统版本:OSMC (Release: 2016.01-1)
说明:以下方法有点旧,patrikolausson在github上提供一个在树莓派上安装VNC服务的更简单的方法(地址:https://github.com/patrikolausson/dispmanx_vnc)。
好啦,下面开始介绍我的旧方法。
我把代码放在:https://github.com/hanzelpeter/dispmanx_vnc
步骤:
1、安装依赖库
sudo apt-get update
sudo apt-get install libvncserver-dev
sudo apt-get install rbp-userland-dev-osmc
sudo apt-get install gcc
2、获取所需代码,并编译
wget https://github.com/hanzelpeter/dispmanx_vnc/archive/master.zip
unzip master.zip -d /home/osmc/
rm master.zip
– 其他 –
如果你想让vnc server快一些,在dispmanx_vnc-master目录中找到main.c,打开并编辑。将
#define PICTURE_TIMEOUT (1.0/15.0)
更改为:
#define PICTURE_TIMEOUT (1.0/25.0)
编译
cd /home/osmc/dispmanx_vnc-master/
sudo chmod +x makeit
./makeit
启动vnc服务
sudo modprobe uinput
sudo chmod 666 /dev/uinput
./dispman_vncserver
注意:终端上打印”Listening for VNC connections on TCP port 5900“,表示客户端需要连接的控制台号码为5900。
(按 Ctrl+C 停止)
PC端登录VNC Viewer
地址为:
IP:5900
如果你想在任何路径都能启动dispman_vncserver,需要完成以下操作:
sudo cp dispman_vncserver /usr/bin
chmod +x /usr/bin/dispman_vncserver
原文地址:https://discourse.osmc.tv/t/howto-install-a-vnc-server-on-raspberry-pi-under-osmc-alpha-4/1517