zoukankan      html  css  js  c++  java
  • virsh

    ubuntu18

    sudo apt-get install virt-manager
    

    创建文件

    qemu-img create image/win.qcow2 100g
    

    配置文件

        <domain type='kvm'>
            <name>test1_ubuntu</name> //虚拟机名称
            <memory>2048576</memory> //最大内存,单位k
            <currentMemory>1048576</currentMemory> //可用内存,单位k
            <vcpu>1</vcpu> //虚拟cpu个数
            <os>
              <type arch='x86_64' machine='pc'>hvm</type>
              <boot dev='cdrom'/> //光盘启动
           </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/bin/qemu-system-x86_64</emulator>
             <disk type='file' device='disk'>
              <driver name='qemu' type='raw'/>
               <source file='/home/ubuntu/installwin/image/win.qcow2'/> //目的镜像路径
               <target dev='hda' bus='ide'/>
             </disk>
             <disk type='file' device='cdrom'>
    		 <source file='/home/ubuntu/installwin/Windows-10.iso'/> //光盘镜像路径
               <target dev='hdb' bus='ide'/>
             </disk>
            <input type='mouse' bus='ps2'/>
             <graphics type='vnc' port='-1' listen = '0.0.0.0' keymap='en-us'/>//vnc方式登录,端口号自动分配,自动加1,可以通过virsh vncdisplay来查询
           </devices>
         </domain> 
    
    
    sudo virsh create win10.xml
    
    sudo apt install gvncviewer
    
    installwin/
    ├── image
    │   └── win.qcow2
    ├── win10.xml
    └── Windows-10.iso
    
  • 相关阅读:
    java_list<String> string[]拼接json
    java_method_删除事务回滚
    java_jdk_JDK版本切换批处理脚本
    java_js_检查是否全为数字
    java_method_stringUtils
    java_method_下拉框成json
    java_method_下载导入模版
    java_js_json_日期格式化
    java_js从字符串中截取数字
    gulp+tp5配置
  • 原文地址:https://www.cnblogs.com/liyugeng/p/12531690.html
Copyright © 2011-2022 走看看