IP变化的所以用向日葵连接,设置开机自动启动
如果ubuntu还没有安装桌面那么先安装桌面
sudo apt install lightdm
在安装过程中选择lightdm,如图所示:
reboot后可以看到图形化桌面了
如果本来就有图形桌面那么需要安装虚拟显示器
因为如果将HDMI或者其他与物理显示器相连的线拔掉,即想节省一块显示器,那么就会发现,向日葵虽然可以远程连接到桌面,但是却控制不了,因此需要虚拟显示器。
需要注意的是:在此之前需要备份或者采取其他一些防止以后进不去系统的操作,这里选择安装ssh服务
sudo apt install openssh-server openssh-client
确保ssh可以远程连接后再往下进行。
安装虚拟桌面:
sudo apt install xserver-xorg-core-hwe-18.04 sudo apt install xserver-xorg-video-dummy
然后配置虚拟显示器,创建这个文件【/usr/share/X11/xorg.conf.d/xorg.conf】
内容如下:
Section "Device" Identifier "Configured Video Device" Driver "dummy" VideoRam 256000 EndSection Section "Monitor" Identifier "Configured Monitor" HorizSync 28.0-80.0 VertRefresh 48.0-75.0 Modeline "1920*1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1920*1080_60.00" EndSubSection EndSection
重启后采用向日葵远程连接,如果桌面不是很好的分辨率,可在图形界面相应设置里设置分辨率。
注意:
重启之后即使接入了显示器,也不会输出信号到显示器上!
要想接真实显示器显示画面得删除配置文件,删除命令
sudo rm /usr/share/X11/xorg.conf.d/xorg.conf
删除后重启电脑即可。
树莓派集群的简单做法
当一个树莓派这样成功后,可以将SD卡完全拷贝给其他的SD卡。



