| 1 | [[PageOutline]] |
| 2 | |
| 3 | = on Ubuntu = |
| 4 | * https://help.ubuntu.com/community/KVM |
| 5 | * [https://help.ubuntu.com/community/KVM/Installation KVM Installation] |
| 6 | * [https://help.ubuntu.com/community/KVM/Networking KVM Networking] |
| 7 | * http://virt-manager.et.redhat.com/ |
| 8 | |
| 9 | == install == |
| 10 | * $ uname -a |
| 11 | {{{ |
| 12 | Linux milly 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux |
| 13 | }}} |
| 14 | |
| 15 | 1. $ sudo aptitude install -R qemu libvirt-bin ubuntu-vm-builder bridge-utils |
| 16 | {{{ |
| 17 | The following NEW packages will be installed: |
| 18 | binutils{a} bridge-utils dbus{a} debootstrap{a} dnsmasq-base{a} hal{a} |
| 19 | hal-info{a} kpartx{a} libaio1{a} libasound2{a} libavahi-client3{a} |
| 20 | libavahi-common-data{a} libavahi-common3{a} libdbus-glib-1-2{a} |
| 21 | libdirectfb-1.2-0{a} libflac8{a} libhal-storage1{a} libhal1{a} libice6{a} |
| 22 | libogg0{a} libpciaccess0{a} libpulse0{a} libsdl1.2debian{a} |
| 23 | libsdl1.2debian-alsa{a} libsm6{a} libsndfile1{a} libts-0.0-0{a} |
| 24 | libvirt-bin libvirt0{a} libvorbis0a{a} libvorbisenc2{a} libxen3{a} |
| 25 | libxi6{a} libxtst6{a} python-cheetah{a} python-vm-builder{a} qemu |
| 26 | qemu-common{a} qemu-kvm seabios{a} tsconf{a} ubuntu-vm-builder vgabios{a} |
| 27 | x11-common{a} |
| 28 | The following packages are RECOMMENDED but will NOT be installed: |
| 29 | consolekit cpu-checker devscripts lvm2 pm-utils python-libvirt |
| 30 | smartdimmer |
| 31 | 0 packages upgraded, 44 newly installed, 0 to remove and 0 not upgraded. |
| 32 | Need to get 10.8MB of archives. After unpacking 41.8MB will be used. |
| 33 | }}} |
| 34 | * [https://edge.launchpad.net/cpu-checker cpu-checker] 0.1-0ubuntu2 |
| 35 | > Description: tools to help evaluate certain CPU (or BIOS) features |
| 36 | > There are some CPU features that are filtered or disabled by system BIOSes. |
| 37 | > This set of tools seeks to help identify when certain features are in this |
| 38 | > state, based on kernel values, CPU flags and other conditions. Supported |
| 39 | > feature tests are NX/XD and VMX/SVM. |
| 40 | * $ qemu --version |
| 41 | {{{ |
| 42 | QEMU PC emulator version 0.12.3 (qemu-kvm-0.12.3), Copyright (c) 2003-2008 Fabrice Bellard |
| 43 | }}} |
| 44 | * $ virsh -c !qemu:///system list |
| 45 | {{{ |
| 46 | Id Name State |
| 47 | ---------------------------------- |
| 48 | }}} |
| 49 | 1. $ sudo aptitude install -R virt-manager |
| 50 | {{{ |
| 51 | The following NEW packages will be installed: |
| 52 | acl{a} consolekit{a} dbus-x11{a} defoma{a} esound-common{a} fontconfig{a} |
| 53 | fontconfig-config{a} gamin{a} gconf2{a} gconf2-common{a} |
| 54 | gnome-mime-data{a} gvfs{a} libappindicator0{a} libart-2.0-2{a} |
| 55 | libatasmart4{a} libatk1.0-0{a} libaudiofile0{a} libavahi-glib1{a} |
| 56 | libbonobo2-0{a} libbonobo2-common{a} libbonoboui2-0{a} |
| 57 | libbonoboui2-common{a} libcairo2{a} libck-connector0{a} libcroco3{a} |
| 58 | libcups2{a} libdatrie1{a} libdbusmenu-glib1{a} libdbusmenu-gtk1{a} |
| 59 | libeggdbus-1-0{a} libesd0{a} libffi5{a} libfontconfig1{a} libgail18{a} |
| 60 | libgamin0{a} libgconf2-4{a} libgdu0{a} libglade2-0{a} |
| 61 | libgnome-keyring0{a} libgnome2-0{a} libgnome2-common{a} |
| 62 | libgnomecanvas2-0{a} libgnomecanvas2-common{a} libgnomeui-0{a} |
| 63 | libgnomeui-common{a} libgnomevfs2-0{a} libgnomevfs2-common{a} |
| 64 | libgsf-1-114{a} libgsf-1-common{a} libgtk-vnc-1.0-0{a} libgtk2.0-0{a} |
| 65 | libgtk2.0-common{a} libgudev-1.0-0{a} libgvfscommon0{a} libidl0{a} |
| 66 | libindicator0{a} libjasper1{a} libjpeg62{a} libjson-glib-1.0-0{a} |
| 67 | liborbit2{a} libpango1.0-0{a} libpango1.0-common{a} libpixman-1-0{a} |
| 68 | libpolkit-agent-1-0{a} libpolkit-backend-1-0{a} libpolkit-gobject-1-0{a} |
| 69 | librsvg2-2{a} librsvg2-common{a} libsgutils2-2{a} libthai-data{a} |
| 70 | libthai0{a} libtiff4{a} libvte-common{a} libvte9{a} |
| 71 | libxcb-render-util0{a} libxcb-render0{a} libxcomposite1{a} libxcursor1{a} |
| 72 | libxdamage1{a} libxfixes3{a} libxft2{a} libxinerama1{a} libxrandr2{a} |
| 73 | libxrender1{a} policykit-1{a} policykit-1-gnome{a} python-appindicator{a} |
| 74 | python-cairo{a} python-dbus{a} python-gconf{a} python-glade2{a} |
| 75 | python-gnome2{a} python-gnomecanvas{a} python-gobject{a} |
| 76 | python-gtk-vnc{a} python-gtk2{a} python-libvirt{a} python-libxml2{a} |
| 77 | python-pyorbit{a} python-urlgrabber{a} python-vte{a} shared-mime-info{a} |
| 78 | ttf-dejavu-core{a} udisks{a} virt-manager virtinst{a} |
| 79 | The following packages are RECOMMENDED but will NOT be installed: |
| 80 | esound-clients gnome-keyring gvfs-backends hicolor-icon-theme |
| 81 | indicator-application libatk1.0-data libgtk2.0-bin libpam-ck-connector |
| 82 | mtools ntfsprogs x-ttcidfont-conf |
| 83 | 0 packages upgraded, 106 newly installed, 0 to remove and 0 not upgraded. |
| 84 | Need to get 16.6MB of archives. After unpacking 107MB will be used. |
| 85 | }}} |
| 86 | |
| 87 | == Configuring Bridged Networking == |
| 88 | 1. $ sudo aptitude install -R libcap2-bin |
| 89 | 1. $ sudo setcap cap_net_admin=ei /usr/bin/qemu |
| 90 | * on x86_64 |
| 91 | {{{ |
| 92 | sudo setcap cap_net_admin=ei /usr/bin/qemu-system-x86_64 |
| 93 | }}} |
| 94 | 1. $ sudo vim /etc/security/capability.conf |
| 95 | {{{ |
| 96 | +cap_net_admin mitty |
| 97 | }}} |
| 98 | 1. $ sudo vim /etc/network/interfaces |
| 99 | {{{ |
| 100 | # The primary network interface |
| 101 | auto eth0 |
| 102 | -iface eth0 inet dhcp |
| 103 | +iface eth0 inet manual |
| 104 | + |
| 105 | +auto br0 |
| 106 | +iface br0 inet dhcp |
| 107 | + bridge_ports eth0 |
| 108 | + bridge_stp off |
| 109 | + bridge_fd 0 |
| 110 | + bridge_maxwait 0 |
| 111 | }}} |
| 112 | * with DHCP |
| 113 | 1. $ sudo /etc/init.d/networking restart |
| 114 | |
| 115 | * $ ifconfig |
| 116 | {{{ |
| 117 | br0 Link encap:Ethernet HWaddr 00:d0:59:xx:yy:zz |
| 118 | inet addr:192.168.0.122 Bcast:192.168.0.255 Mask:255.255.255.0 |
| 119 | |
| 120 | (snip) |
| 121 | eth0 Link encap:Ethernet HWaddr 00:d0:59:xx:yy:zz |
| 122 | inet6 addr: fe80::2d0:59ff:fexx:yyzz/64 Scope:Link |
| 123 | }}} |
| 124 | |
| 125 | == install Guest with PXE boot == |
| 126 | * $ sudo aptitude install -R kvm-pxe |
| 127 | * $ dpkg -L kvm-pxe |
| 128 | {{{ |
| 129 | /. |
| 130 | /usr |
| 131 | /usr/share |
| 132 | /usr/share/qemu |
| 133 | /usr/share/qemu/pxe-e1000.bin |
| 134 | /usr/share/qemu/pxe-ne2k_pci.bin |
| 135 | /usr/share/qemu/pxe-pcnet.bin |
| 136 | /usr/share/qemu/pxe-rtl8139.bin |
| 137 | /usr/share/qemu/pxe-virtio.bin |
| 138 | /usr/share/doc |
| 139 | /usr/share/doc/kvm-pxe |
| 140 | /usr/share/doc/kvm-pxe/copyright |
| 141 | /usr/share/doc/kvm-pxe/changelog.Debian.gz |
| 142 | }}} |