如何在 KVM 下安装 Fedora 28 文本控制台而不提示文本模式与 VNC

如何在 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……我很困惑。

概括:

无论我尝试指定只需要文本或命令行安装(无图形),安装程序仍然尝试运行图形,失败得很惨,并提示我指定 VNC 或文本模式。我试图找出我做错了什么,或者是否有可能做到这一点不是提示我任何事物在安装过程中,只需退出 kickstart 文件即可。

答案1

您正在尝试图形安装,因为您的 kickstart 文件明确要求进行安装:

# Use graphical install
graphical

这些错误表明图形安装程序无法启动,这就是为什么系统会提示您是否要继续使用 VNC。

既然您说无论如何都想要基于文本的安装,请将graphical其删除并替换为text.

相关内容