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>

  • 相关阅读:
    [转载] $CF652B$ 题解
    [转载] $Luogu$ $P4951$ 题解
    luoguP3723 HNOI2017 礼物
    动态dp学习笔记
    noip级别模板小复习
    noip2017简要题解。
    noip考前抱佛脚 数论小总结
    HDU 6071 Lazy Running
    POI2012 ODL-Distance
    [NOI2002]荒岛野人
  • 原文地址:https://www.cnblogs.com/zhangzhang/p/2350993.html
Copyright © 2011-2022 走看看