如何在 KVM 下安裝 Fedora 28 文本控制台以不提示文本模式與 VNC
一段時間以來,我一直試圖讓無人值守的 linux 安裝(在這種情況下為 fedora 28)在 KVM 下工作。我已經解決了大部分問題,但它仍然詢問我是否要使用文本模式或啟動 VNC。這是一個片段來說明:
(snip) [ OK ] Listening on Open-iSCSI iscsid Socket. [ OK ] Reached target Sockets. [ OK ] Reached target Basic System. [ OK ] Started Hardware RNG Entropy Gatherer Daemon. Starting pre-anaconda logging service... Starting OpenSSH ed25519 Server Key Generation... Starting OpenSSH ecdsa Server Key Generation... Starting Login Service... Starting Hold until boot process finishes up... Starting OpenSSH rsa Server Key Generation... [ OK ] Started Hold until boot process finishes up. [ OK ] Started Terminate Plymouth Boot Screen. Starting installer, one moment... anaconda 28.22.10-1.fc28 for Fedora 28 started. * installation log files are stored in /tmp during the installation * shell is available on TTY2 * when reporting a bug add logs from /tmp as separate text/plain attachments 15:12:21 X startup failed, falling back to text mode 15:12:21 X startup failed, falling back to text mode ================================================================================ ================================================================================ 1) Start VNC 2) Use text mode Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to refresh]: 2 Starting automated install... Generating updated storage configuration Checking storage configuration... ================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [x] Time settings (English (United States)) (America/Denver timezone) 3) [x] Installation source 4) [x] Software selection (https://mirror.chpc.utah.edu/pu (Custom software selected) b/fedora/linux/releases/28/Serve r/x86_64/os/) 5) [x] Installation Destination 6) [x] Network configuration (Automatic partitioning (Wired (ens3) connected) selected) ================================================================================ ================================================================================ Progress . Setting up the installation environment . Configuring storage .. Creating disklabel on /dev/sda Creating ext4 on /dev/sda1 Creating lvmpv on /dev/sda2 (snip)
我將其用作我的 virt-install 行:
virt-install \ --name fedoratest2 \ --ram 2048 \ --disk path=/vm-images/fedoratest2.qcow2,size=15 \ --vcpus 2 \ --network bridge=br0 \ --mac=<insert unicast mac here> \ --graphics none \ --location https://mirror.chpc.utah.edu/pub/fedora/linux/releases/28/Server/x86_64/os/ \ --os-type linux \ --extra-args "console=ttyS0 inst.ks=http://http.mydomain.com/kickstart_fedora_testing.cfg hostname=fedoratest2.mydomain.com"
(mydomain.com 當然不是我的真實域名)
以及以下內容的啟動:
#ptform=x86, AMD64, or Intel EM64T #version=DEVEL # Keyboard layouts keyboard 'us' # Root password rootpw --plaintext thisisnotmyrootpassword # user is needed for fedora? --disabled isn't an option user --name="joe" --password="thisisnotmyuserpassword" # System language lang en_US # System timezone timezone America/Denver # Use graphical install graphical # System authorization information auth --useshadow --passalgo=sha512 # Firewall configuration firewall --disabled # SELinux configuration selinux --enforcing # Do not configure the X Window System skipx # System bootloader configuration bootloader --location=mbr # Partition clearing information clearpart --all # Disk partitioning information autopart --type lvm # these are what were produced in anaconda_ks.cfg after I selected what I wanted during a non-kickstart install %packages @^server-product-environment @headless-management %end # this was in default anaconda_ks.cfg file after non-kickstart install, figure I'll keep it just in case %addon com_redhat_kdump --disable --reserve-mb='128' %end
讓我煩惱的是啟動/設置期間出現的行:
15:12:21 X startup failed, falling back to text mode 15:12:21 X startup failed, falling back to text mode
我想知道 - 為什麼它甚至試圖首先啟動 X?我認識到我
--extra-args
上面的引導參數沒有指定是否應該使用文本模式,據我了解,fedora/anaconda 希望預設為圖形安裝模式。沒關係。我也使用了以下兩個參數--extra-args
來嘗試強制它進入文本模式而不問我任何東西:inst.text inst.cmdline
但這些似乎都沒有任何效果。它仍然抱怨,
X startup failed
然後問我是否要使用 VNC 或文本模式…我正在根據官方 f28 安裝指南嘗試這些設置:https ://docs.fedoraproject.org/en-US/fedora/f28/install-guide/advanced/Boot_Options/
此外,這裡的 anaconda 文件:https ://anaconda-installer.readthedocs.io/en/latest/boot-options.html
這
console=
意味著inst.txt
……我很困惑。概括:
無論我嘗試指定只安裝文本或 cmdline(無圖形),安裝程序仍會嘗試執行圖形,慘遭失敗,並提示我指定 VNC 或文本模式。我試圖找出我做錯了什麼,或者是否有可能讓它在安裝過程中不提示我做任何事情,而只是擺脫 kickstart 文件。
您正在嘗試圖形安裝,因為您的 kickstart 文件明確要求它:
# Use graphical install graphical
這些錯誤表明圖形安裝程序無法啟動,這就是提示您是否要繼續使用 VNC 的原因。
既然您說無論如何都想要基於文本的安裝,請將其刪除
graphical
並替換為text
.