一、前言
1、安装32位系统(Bookworm)24.3.15后,多次开启vnc、xrdp均告失败,参考网上多篇教程均为解决。vnc灰屏,xrdp秒退。
2、安装64位系统,vnc开启直接成功。换清华源更新后,安装xrdp直接成功。
二、VNC设置
1、sudo raspi-config 进去之后 选择advanced 设置,里面有一项wayland,进去选择x11模式,然后重启(最新,这一步可省去)
2、sudo raspi-config进入--3interface--vnc--OK
三、换清华源
将 /etc/apt/sources.list
文件中 Debian 默认的源地址 http://deb.debian.org/
替换为镜像地址即可。
sudo nano /etc/apt/sources.list
复制以下:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
sudo apt-get update
sudo apt-get upgrade
sudo apt update
sudo apt upgrade
四、xrdp设置
1、安装
sudo apt install xrdp
2、重启Xrdp服务器:
sudo service xrdp restart
3、查看服务运行状态:
sudo service xrdp status
出现active(running)即说明服务已运行。可以使用Windows电脑进行连接啦!
4、设置开启自动启动(设置开机启动可以在树莓派无屏幕启动时直接远程连接):
sudo update-rc.d xrdp defaults