zoukankan      html  css  js  c++  java
  • Ubuntu 10.04下使用 libvirt 创建KVM虚拟机

    配置网络

    vim /etc/network/interface 

    改为如下

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet manual

    auto br0 
    iface br0 inet dhcp //宿主机是vmware创建的,需要使用动态的IP
    bridge_ports eth0
    bridge_fd 0
    bridge_stp off
    bridge_maxwait 0

    编写setup.xml

    <domain type = 'kvm'>
    <name>test_ubuntu</name>
    <memory>1048576</memory>
    <currentMemory>1048576</currentMemory>
    <vcpu>1</vcpu>
    <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/kvm</emulator>
    <disk type = 'file' device = 'disk'>
    <driver name = 'qemu' type = 'raw'/>
    <source file = '/disks/ubuntu.raw'/>
    <target dev = 'hda' bud = 'ide'/>
    </disk>
    <disk type = 'file' device = 'cdrom'>
    <source file = '/iso/ubuntu-10.04.3-server-amd64.iso'/>
    <target dev = 'hdb' bus = 'ide'/>
    </disk>
    <interface type = 'bridge'>
    <source bridge = 'br0'/>
    <mac address = "00:16:3e:5d:aa:a8"/>
    </interface>
    <input type = 'mouse' bus = 'ps2'/>
    <graphics type = 'vnc' port = '-1' autoport = 'yes' keymap = 'en-us'/>
    </devices>
    </domain>

  • 相关阅读:
    random,time,os
    内置函数
    迭代器,生成器,开放封闭原则,列表推导式
    函数的有用信息
    装饰器
    动态参数,作用域,闭包
    初始函数def
    python之文件操作
    “SLR”指人造卫星激光测距,“VLBI”指甚长基线干涉测量。
    解压软件使用方法
  • 原文地址:https://www.cnblogs.com/zhangzhang/p/2350993.html
Copyright © 2011-2022 走看看