centos7 Linux 下 kvm虚拟机文本模式安装教程

28 篇文章 4 订阅
27 篇文章 13 订阅

 

如果你是用了我的脚本那么就可以跳到下面的加号位置➕

 

                       虚拟机 名        内存         cpu                           镜像

virt-install --name kvname1 --ram 512 --vcpus 1 --location=/root/CentOS-7-x86_64-DVD-1804.iso
 --disk path=/home/kvm/"kvname1".img,size=5 --graphics none --network bridge=virbr0  --extra-args "console=ttyS0"

               安装位置                  硬盘            文本下安装                 桥接网卡                  

 

 

等待。。。。

Installation

 

Installation

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++这里➕

1) [x] Language settings 2) [!] Time settings

(English (United States)) (Timezone is not set.)

3) [x] Installation source 4) [x] Software selection

(Local media) (Minimal Install)

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]: 2

到这里第一个选项输入2

#############################

Time settings

 

Timezone: not set

 

NTP servers:not configured

 

1) Set timezone

2) Configure NTP servers

Please make your choice from above ['q' to quit | 'c' to continue |

'r' to refresh]:

这个地方输入1

################################

Timezone settings

 

Available regions

1) Europe 6) Pacific 10) Arctic

2) Asia 7) Australia 11) US

3) America 8) Atlantic 12) Etc

4) Africa 9) Indian

5) Antarctica

Please select the timezone.

Use numbers or type names directly [b to region list, q to quit]: 2

这里输入2

#######################

6) Aqtobe 34) Jerusalem 61) Sakhalin

7) Ashgabat 35) Kabul 62) Samarkand

8) Atyrau 36) Kamchatka 63) Seoul

9) Baghdad 37) Karachi 64) Shanghai

10) Bahrain 38) Kathmandu 65) Singapore

11) Baku 39) Khandyga 66) Srednekolymsk

12) Bangkok 40) Kolkata 67) Taipei

13) Barnaul 41) Krasnoyarsk 68) Tashkent

14) Beirut 42) Kuala_Lumpur 69) Tbilisi

15) Bishkek 43) Kuching 70) Tehran

16) Brunei 44) Kuwait 71) Thimphu

17) Chita 45) Macau 72) Tokyo

18) Choibalsan 46) Magadan 73) Tomsk

19) Colombo 47) Makassar 74) Ulaanbaatar

20) Damascus 48) Manila 75) Urumqi

21) Dhaka 49) Muscat 76) Ust-Nera

22) Dili 50) Nicosia 77) Vientiane

Press ENTER to continue

这里选时间的出现上面的continue的话按下enter键

####

14) Beirut 42) Kuala_Lumpur 69) Tbilisi

15) Bishkek 43) Kuching 70) Tehran

16) Brunei 44) Kuwait 71) Thimphu

17) Chita 45) Macau 72) Tokyo

18) Choibalsan 46) Magadan 73) Tomsk

19) Colombo 47) Makassar 74) Ulaanbaatar

20) Damascus 48) Manila 75) Urumqi

21) Dhaka 49) Muscat 76) Ust-Nera

22) Dili 50) Nicosia 77) Vientiane

Press ENTER to continue

23) Dubai 51) Novokuznetsk 78) Vladivostok

24) Dushanbe 52) Novosibirsk 79) Yakutsk

25) Famagusta 53) Omsk 80) Yangon

26) Gaza 54) Oral 81) Yekaterinburg

27) Hebron 55) Phnom_Penh 82) Yerevan

28) Ho_Chi_Minh

Please select the timezone.

Use numbers or type names directly [b to region list, q to quit]:

会出现这个选中上海输入64

###########################

Installation

 

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) [!] 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]:

这里上面的3和4选项已经好了。如果没好可以等一会按r加enter刷新一下 或多次

一会也会出现我这个情况

###################################################3

Installation

 

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) [!] 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]:

最后这样了就输入8

###############################################

================================================================================

Please select new root password. You will have to type it twice.

 

Password:

然后这里让输入密码输入的是root密码 咱们输入123

Password (confirm):

下面出现确认密码

输入123

##################################

Question

 

The password you have provided is weak: The password is too short.

Would you like to use it anyway?

 

Please respond 'yes' or 'no':

输入yes 确认

###########################

Installation

 

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) [!] Installation Destination 6) [x] Kdump

(No disks selected) (Kdump is enabled)

7) [ ] Network configuration 8) [x] Root password

(Not connected) (Password is 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]:

到这里就可以输入b 安装了

选项9为添加普通用户

选项7为主机名和网卡配置

这里跳过了

上面的q是退出安装 b是安装 不过要设置好才能安装 r是刷新

 

 

 

输入b 后确认就开始安装了

最后有一个确认

Running post-installation scripts

.

Use of this product is subject to the license agreement found at /usr/share/centos-rel

ease/EULA

Installation complete. Press return to quit

输入quit

重启完事

虚拟机就可以使用了

 

###############

如果出现这个

域创建完成。
正在重启客户机。
连接到域 kvvv
换码符为 ^]

则按ctrl+]         返回


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在 CentOS 7 上安装 KVM 虚拟机的步骤: 1. 确认 CPU 支持虚拟化技术: ``` # egrep -c '(svm|vmx)' /proc/cpuinfo ``` 如果返回值大于 0,说明 CPU 支持虚拟化技术。 2. 安装 KVM 及相关组件: ``` # yum install qemu-kvm libvirt virt-install bridge-utils ``` 3. 启动 libvirtd 服务: ``` # systemctl start libvirtd ``` 4. 设置 libvirtd 开机自启: ``` # systemctl enable libvirtd ``` 5. 创建网络桥接: ``` # vi /etc/sysconfig/network-scripts/ifcfg-br0 ``` 将以下内容添加到文件中: ``` DEVICE=br0 TYPE=Bridge BOOTPROTO=static IPADDR=192.168.0.100 # 桥接网络的 IP 地址 NETMASK=255.255.255.0 # 子网掩码 GATEWAY=192.168.0.1 # 网关 IP 地址 DNS1=192.168.0.1 # DNS 服务器 IP 地址 ONBOOT=yes ``` 保存并退出文件。 6. 编辑物理网卡配置文件: ``` # vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 # 根据实际网卡名修改 ``` 将以下内容添加到文件中: ``` DEVICE=enp0s3 TYPE=Ethernet ONBOOT=yes BRIDGE=br0 ``` 保存并退出文件。 7. 重启网络服务: ``` # systemctl restart network ``` 8. 创建虚拟机: ``` # virt-install --name centos7 --ram 2048 --vcpus 2 --disk path=/var/lib/libvirt/images/centos7.img,size=20 --os-type linux --os-variant rhel7 --network bridge=br0 --graphics none --console pty,target_type=serial ``` 其中,--name 表示虚拟机名称,--ram 表示内存大小,--vcpus 表示虚拟 CPU 数量,--disk 表示虚拟磁盘路径和大小,--os-type 和 --os-variant 表示操作系统类型和版本,--network 表示网络配置,--graphics none 表示不使用图形界面,--console pty,target_type=serial 表示使用串口控制台。 9. 安装操作系统: 按照正常操作系统安装流程安装操作系统即可。 以上是在 CentOS 7 上安装 KVM 虚拟机的步骤,希望能对你有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值