
我正在嘗試使用 Chrome 在 Kiosk 模式下配置 Ubuntu Server 16.04.02。它正在工作,但我無法配置啟動畫面而不是顯示啟動訊息。
工作至今
建立 Chrome 資訊亭的步驟
- 安裝了具有 OpenSSH 伺服器的 Ubuntu Server 16.04.02
- 更新:
sudo apt update && sudo apt upgrade -y
顯示伺服器+Windows管理器:
sudo apt install xorg openbox -y
注意:我嘗試安裝 openbox,
--no-install-recommends
但螢幕的一半(右側)是黑色的。谷歌瀏覽器
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
- 建立“Kiosk”用戶:
sudo adduser kiosk
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
配置自動登入:
配置蓋蒂:
sudo mkdir /etc/systemd/system/[email protected]/ sudo tee -a /etc/systemd/system/[email protected]/autologin.conf <<EOF [Service] ExecStart= ExecStart=-/sbin/agetty --skip-login --noissue --autologin kiosk --noclear %I $TERM Type=idle EOF
啟用蓋蒂:
sudo systemctl enable [email protected]
啟動時隱藏橫幅訊息
sudo touch /home/kiosk/.hushlogin sudo chown kiosk:kiosk /home/kiosk/.hushlogin
問題 - X 未啟動
我想刪除所有啟動訊息。我嘗試過GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
,/etc/default/grub
但現在我看到的只是螢幕左上角的一個小遊標。 Chrome不再顯示了?
解決方案
資訊亭用戶必須添加到視訊群組!不知道為什麼在我安裝普利茅斯之前它可以工作:
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
問題 - 如何配置新主題
我也想要一個啟動螢幕,我想我必須安裝 plymouth?我應該安裝什麼以及如何配置它?
解決方案
我創建了一個基於 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
謝謝!
答案1
可以避免啟動訊息GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
。我不知道為什麼你仍然得到遊標。
無論如何,要回答有關普利茅斯的問題,您需要透過執行命令來安裝它sudo apt-get install plymouth
。這應該將其安裝到系統中。然後,您想要將所有內容複製/usr/share/plymouth/themes/ubuntu-logo
到另一個資料夾(最好是/usr/share/plymouth/themes
目錄中的某個位置)。然後,您很可能想要更改ubuntu-logo
新複製的資料夾中的圖像。然後,要變更新的啟動徽標,請編輯位於 的 plymouth 設定檔/etc/alternatives/default.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 映像。
答案2
如果你想擺脫滑鼠遊標,當你讓 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
答案3
我的條目幼蟲,你可以檢查你可能的分辨率sudo hwinfo --framebuffer
如果條目完成sudo update-grub
如果在 plymouth / grub 上進行編輯,那麼落後絕對不是一個sudo update-initramfs -u
錯誤