Skip to content

Instantly share code, notes, and snippets.

@ashee
Created October 22, 2010 14:26
Show Gist options
  • Save ashee/640625 to your computer and use it in GitHub Desktop.
Save ashee/640625 to your computer and use it in GitHub Desktop.
kvm libvirt config
<domain type='kvm'>
<name>encore-dev</name>
<uuid>c8bbf2df-c68b-63d9-6cad-cec7aa27b536</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='block' device='disk'>
<source dev='/dev/virtpool/centos-guest-3.img'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='bridge'>
<mac address='54:62:00:36:30:34'/>
<source bridge='br0'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/6'/>
<target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/6'>
<source path='/dev/pts/6'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
</devices>
</domain>
amitava@et-vmhost:~$ cat /etc/network/interfaces
# 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 "metric" directives are used to specify the preferred interface
# lower values are higher priority
# The primary network interface
auto eth0
iface eth0 inet static
address X.X.X.X
netmask 255.255.255.128
network X.X.X.X
broadcast x.x.x.x
gateway X.X.X.X
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers x.x.x.X X.X.X.X
dns-search whatever.com
metric 0
# configure the bridge for kvm
# eth1 will be the bridge port
# set it up, but provide further config in the bridge
auto eth1
iface eth1 inet manual
# configure bridging
auto br0
# configure the bridge using DHCP
iface br0 inet dhcp
bridge_ports eth1
bridge_stp off
bridge_maxwait 0
metric 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment