kvm虚拟化

目录

简介

KVM部署

环境

CPU虚拟化功能

虚拟机设置

 KVM管理界面安装


简介

KVM(Kernel-Based Virtual Machines)是一个基于Linux内核的虚拟化技术, 可以直接将Linux内核转换为Hypervisor(系统管理程序)从而使得Linux内核能够直接管理虚拟机, 直接调用Linux内核中的内存管理、进程管理子系统来管理虚拟机。

KVM部署

环境

系统:CentOS8

IP:192.168.91.134

CPU虚拟化功能

部署前请确保你的CPU虚拟化功能已开启,分为两种情况:

(1)虚拟机要关机设置CPU虚拟化

(2)物理机要在BIOS里开启CPU虚拟化

虚拟机设置

(内存:8G 磁盘:200G 虚拟化功能:开启)

//设置虚拟机内存,添加一块200G的硬盘

//开启虚拟化

 

//关闭防火墙、selinux
[root@kvm ~]# systemctl stop firewalld.service
[root@kvm ~]# systemctl disable firewalld.service
[root@kvm ~]# sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
[root@kvm ~]# reboot

//新建分区,将硬盘所有大小都给这个分区
[root@kvm ~]# parted -l
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 322GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  xfs          boot
 2      1075MB  322GB   321GB   primary               lvm


Error: /dev/sdb: unrecognised disk label     //这里的错误是因为你还没有进行那种分区
Model: VMware, VMware Virtual S (scsi)                                    
Disk /dev/sdb: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 


[root@kvm ~]# parted /dev/sdb
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel                                                          
New disk label type?    //使用那种类型进行分区,按两次TAB键就出现下面这几种类型                     
aix    amiga  atari  bsd    dvh    gpt    loop   mac    msdos  pc98   sun    
New disk label type? msdos
(parted) p                                                                
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 215GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) unit        //设置单元单位                                                      
Unit?  [compact]?                                                         
%        B        chs      compact  cyl      GB       GiB      kB       kiB      MB       MiB      s        TB       TiB
Unit?  [compact]? MiB   以兆为单位
(parted) p                                                                
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 204800MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) mkpart                 //进行分区                                           
Partition type?  primary/extended? primary //分区类型 (主分区/扩展分区)                     File system type?  [ext2]? xfs   //默认的话就是ext2类型                                     
Start? 10MiB                    //起始点(我们留个几兆)单位是上面设置                            End? 204790MiB                  //结束点&
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值