带有启动画面和Kiosk模式的Ubuntu Server 16.04.02

我正在尝试使用Chrome在Kiosk模式下配置Ubuntu Server 16.04.02。 它正在工作,但我无法配置启动画面而不是显示启动消息。

到目前为止工作

创建Chrome Kiosk的步骤

  1. 使用OpenSSH Server安装Ubuntu Server 16.04.02
  2. 更新: sudo apt update && sudo apt upgrade -y
  3. 显示服务器+ Windows管理器: sudo apt install xorg openbox -y

    注意:我尝试使用--no-install-recommends安装openbox,但屏幕的一半(右侧)是黑色的。

  4. 谷歌浏览器

     sudo add-apt-repository 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo apt update && sudo apt install google-chrome-stable -y 
  5. 创建一个“Kiosk”用户: sudo adduser kiosk
  6. 启动Chrome脚本:

     sudo tee -a /home/kiosk/startchrome.sh <<EOF #!/bin/bash # Turn off DPMS (Display Power Management Signaling) xset -dpms # Disable screen saver blanking xset s off # Start OpenBox openbox-session & # Make sure Chrome is always started - restart if needed while true; do rm -rf ~/.{config,cache}/google-chrome/ google-chrome --ignore-certificate-errors --kiosk --no-first-run --disable-infobars --disable-session-crashed-bubble --disable-translate 'http://localhost:8080' done EOF 

    使其可执行并在登录时运行:

     sudo chmod +x /home/kiosk/startchrome.sh echo "/usr/bin/startx /etc/X11/Xsession /home/kiosk/startchrome.sh -- :0 &> /dev/null" | sudo tee -a /home/kiosk/.profile 
  7. 配置自动登录:

    配置Getty:

     sudo mkdir /etc/systemd/system/getty@tty1.service.d/ sudo tee -a /etc/systemd/system/getty@tty1.service.d/autologin.conf <<EOF [Service] ExecStart= ExecStart=-/sbin/agetty --skip-login --noissue --autologin kiosk --noclear %I $TERM Type=idle EOF 

    启用Getty:

     sudo systemctl enable getty@tty1.service 
  8. 在启动时隐藏横幅消息

     sudo touch /home/kiosk/.hushlogin sudo chown kiosk:kiosk /home/kiosk/.hushlogin 

问题 – X没有开始

我想删除所有引导消息。 我在/etc/default/grub尝试了GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"但是现在,我看到的只是屏幕左上方的一个小光标。 Chrome不再显示了?

必须将信息亭用户添加到video组! 在我安装普利茅斯之前不知道它为什么工作:

  sudo usermod -a -G audio kiosk sudo usermod -a -G video kiosk 

注意:我在Ubuntu 17.04中尝试了自己的程序,我必须执行以下附加步骤:

  sudo apt install xserver-xorg-legacy sudo dpkg-reconfigure xserver-xorg-legacy 

现在,您在菜单上选择“任何人”。 比修改/etc/X11/Xwrapper.config并设置:

  needs_root_rights=yes allowed_users=anybody 

问题 – 如何配置新主题

我也想要一个Splash Screen,我想我必须安装普利茅斯? 我应该安装什么以及如何配置它?

我创建了一个基于ubuntu-logo的主题,并将其复制到/usr/share/plymouth/themes/比我做的更多:

  sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/MY_THEME/MY_THEME.plymouth 150 sudo update-alternatives --config default.plymouth 

它将要求选择主题,我选择我的,然后你必须做:

  sudo update-initramfs -u sudo update-grub 

谢谢!

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"可以避免引导消息。 我不知道为什么你仍然会得到光标。

无论如何,要回答关于普利茅斯的问题,你想通过运行命令sudo apt-get install plymouth来安装它。 这应该将它安装到系统中。 然后,您想要将/usr/share/plymouth/themes/ubuntu-logo所有内容复制到另一个文件夹(最好位于/usr/share/plymouth/themes目录中的某个位置)。 然后,您最有可能想要在新复制的文件夹中更改图像ubuntu-logo 。 然后,要更改新的引导徽标,请编辑位于/etc/alternatives/default.plymouth plymouth的配置文件。 在那里,将下面两行的地址更改为您之前创建的新文件夹:

 ImageDir=/usr/share/plymouth/themes/ubuntu-logo ScriptFile=/usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.script 

所以,例如,我可能会编辑这样的行:

 ImageDir=/usr/share/plymouth/themes/mytheme ScriptFile=/usr/share/plymouth/themes/mytheme/ubuntu-logo.script 

然后,保存配置并重新启动。 你现在应该有你的启动徽标图像而不是常规的Ubuntu图像。

如果你想摆脱鼠标光标,当你制作startchrome.sh可执行文件(让它可执行并在登录时运行:)只需添加-nocursor例如:

 sudo chmod +x /home/kiosk/startchrome.sh echo "/usr/bin/startx /etc/X11/Xsession /home/kiosk/startchrome.sh -- -nocursor :0" | sudo tee -a /home/kiosk/.profile 

我的grub条目,您可以使用sudo hwinfo --framebuffer检查您的可能解决sudo hwinfo --framebuffer

如果条目完成sudo update-grub

如果在plymouth / grub上进行编辑,那么从来没有错误地运行sudo update-initramfs -u