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>

  • 相关阅读:
    Facebook发布神经蛋分离法,可从嘈杂环境中提取音视频
    前线观察 | AWS re:Invent 2018见闻实录
    SSO
    8-5 Navicat工具与pymysql模块
    saltstack
    nginx 集群介绍
    Docker 持久化存储
    Docker 多机网络
    《深入理解JAVA虚拟机》笔记1
    jquery 学习日记之选择器
  • 原文地址:https://www.cnblogs.com/zhangzhang/p/2350993.html
Copyright © 2011-2022 走看看