# virt-install --name test_1 --ram 8192 --vcpus 4 \ -f /root/test_1.qcow2 --os-type linux \ --os-variant rhel7 --network bridge=virbr0 \ --cdrom CentOS-7-x86_64-DVD-1810.iso \ --graphics vnc,listen=0.0.0.0,port=5920 # 输出如下 WARNING Graphics requested but DISPLAY is not set. Not running virt-viewer. WARNING No console to launch for the guest, defaulting to --wait -1 Starting install... Domain installation still in progress. Waiting for installation to complete. # 这个位置需要连接vnc,进行选择语言/硬盘等界面的操作
=================================================================================================== =================================================================================================== Installation 1) [x] Language settings 2) [x] Time settings (English (United States)) (Asia/Shanghai timezone) 3) [!] Installation source 4) [!] Software selection (Processing...) (Processing...) 5) [!] Installation Destination 6) [x] Kdump (No disks selected) (Kdump is enabled) 7) [ ] Network configuration 8) [!] Root password (Not connected) (Password is not set.) 9) [!] User creation (No user will be created) Please make your choice from above ['q' to quit | 'b' to begin installation | 'r' to refresh]: 5 # 选择5,进行硬盘选择分区 =================================================================================================== =================================================================================================== Probing storage... Installation Destination
[x] 1) : 20 GiB (vda)
1 disk selected; 20 GiB capacity; 20 GiB free ...
Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]: c # 因为只有一个20G的qcow2文件,所以只有一块虚拟硬盘,c继续 =================================================================================================== =================================================================================================== Autopartitioning Options [ ] 1) Replace Existing Linux system(s) [x] 2) Use All Space [ ] 3) Use Free Space Installation requires partitioning of your hard drive. Select what space to use for the install target. Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]: c # 选择2或者c,使用所有硬盘空间 =================================================================================================== =================================================================================================== Partition Scheme Options [ ] 1) Standard Partition [ ] 2) Btrfs [x] 3) LVM [ ] 4) LVM Thin Provisioning Select a partition scheme configuration. Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]: 3 # 选择3,使用LVM的方式进行分区,看情况定即可,然后选择c继续
1) [x] Language settings 2) [x] Time settings (English (United States)) (Asia/Shanghai timezone) 3) [x] Installation source 4) [x] Software selection (Local media) (Minimal Install) 5) [x] Installation Destination 6) [x] Kdump (Automatic partitioning (Kdump is enabled) selected) 8) [!] Root password 7) [ ] Network configuration (Password is not set.) (Not connected) 9) [!] User creation (No user will be created) Please make your choice from above ['q' to quit | 'b' to begin installation | 'r' to refresh]: 8 # 选择8进行设置密码 =================================================================================================== =================================================================================================== Please select new root password. You will have to type it twice. Password: # 输入密码 Password (confirm): # 再次输入确认密码 =================================================================================================== =================================================================================================== Question The password you have provided is weak: The password fails the dictionary check - it is too simplistic/systematic. Would you like to use it anyway? Please respond 'yes' or 'no': yes # 输入yes,确认使用这样的密码,复杂性要求够了就不会出现这一步
开始安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [x] Time settings (English (United States)) (Asia/Shanghai timezone) (Local media) (Minimal Install) 5) [x] Installation Destination 6) [x] Kdump (Automatic partitioning (Kdump is enabled) selected) 8) [x] Root password 7) [ ] Network configuration (Password is set.) (Not connected) 9) [ ] User creation (No user will be created) Please make your choice from above ['q' to quit | 'b' to begin installation | 'r' to refresh]: b # 开始安装
Configuring installed system ^C. Writing network configuration . Creating users . Configuring addons . Generating initramfs ^C. Running post-installation scripts . Use of this product is subject to the license agreement found at /usr/share/centos-release/EULA Installation complete. Press return to quit [anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1