- VNCServer
远程服务器启动 vnc 以访问桌面
vnc4server -geometry 1920x1080 :1 vnc4server -kill :1
- 软件镜像源
#aliyun deb http://mirrors.aliyun.com/debian/ stretch main contrib non-free deb http://mirrors.aliyun.com/debian-security/ stretch/updates main contrib non-free deb http://mirrors.aliyun.com/debian/ stretch-updates main contrib non-free
- 中文相关
安装中文字体 sudo apt-get install ttf-wqy-zenhei 安装中文输入法 sudo apt-get install scim-pinyin 再使用 raspi-conf 修改 change_locale 切换到zh_CN.utf8
- PiServer 相关
3.1 介绍
使用此工具可以轻松地建立通过以太网连接到单个基于 x86 的服务器的客户端 Raspberry Pi 的网络。 使用 PiServer,您不需要 SD 卡,可以通过服务器控制所有客户端,还可以添加和配置用户帐户-非常适合用于教室,家庭或工业环境。
下面介绍一些相关配置,优化使用场景,可以根据需要进行配置。
# 相关网站 https://www.raspberrypi.org/downloads/raspberry-pi-desktop/ https://www.raspberrypi.org/blog/stretch-pcs-macs-raspbian-update/ https://www.wandianshenme.com/play/use-raspberry-pi-piserver-boot-from-network/
3.1 检测网络通讯
在完成 PiServer 部署后,如果局域网内的树莓派没有成功启动,可以在 PiServer 的 host 上运行如下命令
sudo tcpdump -i eth0 port bootpc
理论上在客户端树莓派上电后,会发送 bootpc,服务端会立即回复一个 reply,没有回复,或是回复后没有启动,说明某些网路配置存在错误,请检查路由器、或交换机的配置信息。
3.2 启用自动登录将 home 目录挂载到 tmpfs
作为开机即用,用完即走的模式,需要实现 pi 的自动登录。
为了实现系统的自动恢复,可以通过把 home 目录挂载到 tmpfs 来实现。
参考地址:Issue #11 · raspberrypi/piserver
注意: 后续命令需要在 client command 中运行
1) mv /etc/security/pam_mount.conf.xml /etc/security/pam_mount.disabled
2) adduser pi
**PASSWORD: 123456**
3) Edit /etc/fstab
Modify:
tmpfs /home tmpfs defaults,mode=755 0 0
To:
tmpfs /home/pi tmpfs defaults 0 0
4)raspi-config "boot options" -> "desktop/cli" -> "desktop autologin"
5)Put your files in the shared folder prepared on the piserver computer,
and create a one-line `/etc/rc.local` script that populates /home/pi on boot?
#!/bin/sh
cp -a /mnt/shared/preparedfiles/* /home/pi
3.3 禁止 pi 切换到 root
意义不大,文件都挂在了 tmpfs,全部都是只读的临时文件
1) vi /etc/pam.d/su 去掉这行的注释 auth required pam_wheel.so use_uid 2) 在文件/etc/login.defs 中添加一行 SU_WHEEL_ONLY yes
3.4 取消 pi 第一次启动的弹窗
由于系统是网络启动,而且每次都是全新的状态,所以树莓派每次都会认为是第一次启动,此时会弹出一个提示框。
通过删除/etc/xdg/autostart/piwiz.desktop 此文件即可取消该弹窗。
- 软件的开机自启动
比如开机自启动浏览器
vi ~/.config/autostart/chromium-browser.desktop [Desktop Entry] Version=1.0 Name=Chromium Web Browser GenericName=Web Browser Exec=chromium-browser %U --start-maximized --incognito http://127.0.0.1:8080/ Terminal=false X-MultipleArgs=false Type=Application Icon=chromium-browser Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true Actions=NewWindow;Incognito;TempProfile; X-AppInstall-Package=chromium-browser
chrome 相关参数
--incognito 隐身模式,如果异常断电关机,每次启动都会有一个异常恢复的提示,开启隐身后就不会有了
--start-maximized 最大化
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于