使用ros时,小车一般搭载minipc,没有显示屏,每次打开终端都要ssh来控制不方便,使用远程桌面一般比较方便.
ubuntu从机端设置
1安装xrdp
sudo apt-get install xrdp
重启xrdp服务
sudo service xrdp restart
2安装ssh,先使用ps -e |grep ssh,显示sshd则已经安装ssh,没有就安装一下
sudo apt-get install openssh-server
为保证ssh开机正常运行,需要设置开机启动,在/etc/rc.local开机配置文件加入命令
#在exit 0之前加入ssh服务
sudo service ssh start
#如果rc.local文件权限不足,在/etc 路径下赋予一下读写权限
sudo chmod +x rc.local
3安装vnc
sudo apt-get install vnc4server
4打开桌面共享
应用程序搜索桌面共享,允许他人查看
5使用dconf-editor取消加密传输选项
#安装dconf-editor
sudo apt-get install dconf-editor
#新开终端,打开dconf-editor
dconf-editor
在org/gonme/desktop/remote-access 下取消require-encryption的勾选
6这样的配置在带显示器的情况下可以正常远程,但是不接显示器的情况下,远程从机分辨率极小而且极其卡顿,我通过安装虚拟显示器来解决,安装xorg和xserver相应的包,如果提示依赖冲突无法安装,可以先卸载冲突的包.
sudo apt-get install xorg-video-abi-20
sudo apt-get install xserver-xorg-core
sudo apt-get install xserver-xorg-video-*
这样从机端配置就完成了
主机端设置
应用程序搜索remmina
终端
协议选vnc
服务器选ipv4 ipv6都可以
输入从机用户名和密码就可以连接了,但是分辨率还是比较小,强制修改分辨率,在从机端打开终端
#x是字母x,不是数学* 1920x1080为我远端屏幕的显示分辨率
xrandr --fb 1920x1080