打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
KVM 常用命令
  <domain type='kvm'>
  <name>test_Ubuntu</name> //虚拟机名称
  <memory unit='KiB'>2097152</memory> //最大内存,单位Kib
   <currentMemory unit='KiB'>2097152</currentMemory> //可用内存,单位Kib
   <vcpu>8</vcpu> //虚拟cpu个数
   <os>
    <type arch='x86_64' machine='rhel6.2.0'>hvm</type>
    <boot dev='cdrom'/>  // 光盘启动为首选启动项
    <boot dev='hd'/>     // 硬盘启动为次要启动项 
 </os>
  <features>
    <acpi/>
    <apic/>
   <pae/>
  </features>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
 <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
     <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test.qcow2'/> //目的镜像路径
      <target dev='hda' bus='ide'/> //bus值还可以设置为virtio
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/var/lib/libvirt/images/ubuntu.iso'/> //光盘镜像路径
      <target dev='hdb' bus='ide'/>
    </disk>
   <interface type='bridge'> //虚拟机网络连接方式
     <source bridge='kvmbr0'/> //当前主机网桥的名称
     <mac address="00:16:3e:5d:aa:a8"/> //为虚拟机分配mac地址,务必唯一
   </interface>
   <input type='mouse' bus='ps2'/>
   <graphics type='vnc' port='-1' listen = '0.0.0.0' keymap='en-us'/>//vnc方式登录,端口号自动分配,自动加1,可以通过virsh vncdisplay来查询
  </devices>
</domain> 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
烂泥:KVM为虚拟机添加设备总结 | 烂泥行天下
kvm虚拟化学习笔记(十)之kvm虚拟机快照备份
kvm 学习教程
使用libvirt管理kvm(virsh篇)
[ubuntu] KVM/libvirt VM console access?
电脑词汇中英文对照表
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服