vmware创建嵌套虚拟机

本文详细介绍了如何在VMware环境中设置虚拟化选项,安装QEMU、libvirt,使用阿里镜像源下载CentOSISO,创建CentOS虚拟机的XML配置文件,包括内存、CPU、网络和磁盘配置,以及创建系统盘和实际安装过程。
摘要由CSDN通过智能技术生成

嵌套虚拟机的搭建

  • 在vmware 虚拟机设置中,打开处理器的虚拟化Intel VT-x/EPT 或AMD-V/RVI(v)
  • 配置虚拟机yum 源,安装qemu、qemu-kvm、libvirt
  • 从阿里镜像源下载centos iso 阿里源 centos-7-x86
  • 准备虚拟机创建所需xml,centos.xml
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>centos-test</name>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.5.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
    <bios useserial='yes' rebootTimeout='0'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/home/test/test.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/home/test/CentOS-Stream-9-20231218.0-x86_64-boot.iso'/>
      <target dev='sda' bus='scsi'/>
    </disk>
    <controller type='ide' index='0'>
    </controller>
    <controller type='virtio-serial' index='0'>
    </controller>
    <controller type='usb' index='0'>
    </controller>
    <interface type='bridge'>
      <source bridge='virbr0'/>
      <mac address='52:54:00:e0:d9:e9'/>
      <model type='virtio'/>
    </interface>
    <console type='pty'>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' heads='1'/>
    </video>
    <memballoon model='virtio'>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:env name='SPICE_DEBUG_ALLOW_MC' value='1'/>
  </qemu:commandline>
</domain>
  • 创建系统盘
qemu-img create -f qcow2 test.qcow2 10g
  • 创建虚拟机,并进行系统安装
virsh create centos.xml					#创建虚拟机
virsh list								#查看虚拟机
virsh vncdisplay centos-test			#查看虚拟机vnc端口号
vncviewer 0.0.0.0:0							#通过vnc进行虚拟机系统安装

linux 系统启动流程

PC机上电——>加载BIOS——>加载MBR到内存——>GRUB引导——>加载内核
bios是固化在主板上的ROM,掉电仍能保存,主要用于完成cpu、主板、内存检测和初始化。BIOS程序的最后会指向计算机硬盘的MBR主引导扇区(Master Boot Record,启动盘的第一个扇区),然后将MBR中的内容加载到内存(RAM)中,并将控制权转交给MBR。
硬盘上的MBR包含基本的Boot Loader(446字节)和一个小的分区表(64字节)以及分隔标识(2字节),MBR的前446个字节存放的是GRUB(GRand Unified Bootloader 一个多重操作系统引导其,用来引导不同的系统)程序的一部分。

  • 20
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值