[[PageOutline]] [[TitleIndex(TipAndDoc/VM/KVM,format=group)]] = KVM = * [https://help.ubuntu.com/community/KVM The Kernel Virtual Machine - Community Ubuntu Documentation] * [http://blog.sibrof.net/ken/2008/05/17/778/ KVM – Ubuntu Hardy | Ken's blog] * [http://blog.sibrof.net/ken/2008/05/18/779/ 動き出したUbuntu Hardy on KVM | Ken's blog] * [http://research.sakura.ad.jp/2010/11/17/kvm-desktop/ KVMを使う(Ubuntu Desktop編) « さくらインターネット研究所] * [http://www.asahi-net.or.jp/~aa4t-nngk/kvm.html Stray Penguin - Linux Memo (KVM)] * [http://www.aji.sakura.ne.jp/linux/fedora15_kvm_install.html Fedora 15 - KVM インストール] * KVM自体にはIntel-VT or AMD-V が必須 {{{ egrep '(vmx|svm)' --color=always /proc/cpuinfo }}} * AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ with ASUS M2A-VM HDMI => attachment:amdv.png * QEMUはVT/AMD-vが無くても動く(ただし非常に遅い) * -> [../LegacyHardware] * [http://eucalyptus.linux4u.jp/wiki/index.php?Sheepdog%2F%E6%A6%82%E8%A6%81 Sheepdog/概要 - Eucalyptus linux4u.jp Wiki] > SheepdogはKVM用の分散ストレージです. * Guest with Bridged Network => [../../network/bridge] == Client == * http://www.davereyn.co.uk/ Qemu Manager (for Windows) * ローカルに対するGUIツールなので注意 (Linux boxへ接続して…という使い方は出来ない) * [http://www.linux-kvm.org/page/Management_Tools Management Tools - KVM] = Windows Guest = == drivers == * NIC -> virtio * [http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers WindowsGuestDrivers/Download Drivers - KVM] * http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/ * Video -> vmvga * http://softwareupdate.vmware.com/cds/ * http://softwareupdate.vmware.com/cds/vmw-desktop/ws/8.0.1/528992/windows/packages/tools-windows-8.8.1.exe.tar 1. tools-windows-8.8.1.exe.tar -> tools-windows-8.8.1.exe 1. > tools-windows-8.8.1.exe /e tools-windows-8.8.1 1. tools-windows-8.8.1\tools-windows.msi > Data1.cab > windows.iso > setup.exe (圧縮ファイルとして展開) 1. > setup.exe /a * 64bitゲストの場合はsetup64.exeの中身が必要。 1. 適当な場所に展開する 1. VMware SVGA II driver > setup\Program Files\VMware\VMware Tools\VMware\Drivers\video_xpdm * 参考 [http://www.linux-kvm.com/content/using-vmware-vga-kvm-windows-guests Using Vmware VGA with KVM Windows Guests | KVM - The Linux Kernel-Based Virtual Machine] * デバイスマネージャ[[br]][[Image(KVM-XP.png,33%)]] === block device === * [http://ask.fedoraproject.org/question/1111/why-the-virtio-win-1116vfd-file-is-removed-from Why the virtio-win-1.1.16.vfd file is removed from the download page? - Ask Fedora: Community Knowledge Base and Support Forum] * http://www.linuxwind.org/download/virtio-win-1.1.16.vfd !00ccbf02149a584de5d3bd344823fb33c31af00b (sha1) * http://web.archive.org/web/20110514090604/http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-1.1.16.vfd !00ccbf02149a584de5d3bd344823fb33c31af00b (sha1) * http://autosetup1.googlecode.com/files/virtio-win-1.1.16.vfd !16c8adfe6833e4bc86d661a3158ed0e8faab12a4 (sha1) {{{ 00004A72: 34 2B 00004A73: 3D 40 00004D32: 34 2B 00004D33: 3D 40 00004D72: 34 2B 00004D73: 3D 40 00004DB2: 34 2B 00004DB3: 3D 40 }}} * [http://turukiya.wordpress.com/2012/02/10/windows-xp-%e3%81%ae%e6%ba%96%e4%bb%ae%e6%83%b3%e5%8c%96%e7%92%b0%e5%a2%83/ Windows XP の準仮想化環境 « おたくの日記帳] = virbr0 = * libvirtdによって自動で作られる「default」のNAT * ps aux | grep dns {{{ nobody 2684 0.0 0.0 21264 792 ? S Feb07 0:01 dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --listen-address 192.168.122.1 --except-interface lo --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-lease-max=253 }}} * lease file => /var/lib/misc/dnsmasq.leases == iptables == * sudo iptables-save {{{ # Generated by iptables-save v1.4.8 on Thu Feb 16 10:31:29 2012 *nat :PREROUTING ACCEPT [743892:129452770] :POSTROUTING ACCEPT [1179:112796] :OUTPUT ACCEPT [1215:115607] -A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535 -A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535 -A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE COMMIT # Completed on Thu Feb 16 10:31:29 2012 # Generated by iptables-save v1.4.8 on Thu Feb 16 10:31:29 2012 *filter :INPUT ACCEPT [4957020:3457557240] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [3323525:4327643495] -A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT -A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT -A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT -A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT -A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT -A FORWARD -i virbr0 -o virbr0 -j ACCEPT -A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable -A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Thu Feb 16 10:31:29 2012 }}} === port forwarding === * [http://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections Forwarding Incoming Connections] > 3) Create the file /etc/libvirt/hooks/qemu (or add the following to an already existing hook script), with contents similar to the following (replace GNAME, IP, GP, and HP appropriately for your setup): * [http://git.zaytsev.net/?p=anubis-puppet.git;a=blob;f=manifests/files/puppet/libvirt/hooks/qemu git repositories at zaytsev.net - anubis-puppet.git/blob - manifests/files/puppet/libvirt/hooks/qemu] = Live Migration = * [http://www.cuspy.org/diary/2010-03-20 qemu-kvm の live migration を試してみたよ - cuspy diary] * [http://research.sakura.ad.jp/2010/06/23/kvm-migration/ KVMを使う(LiveMigration編) « さくらインターネット研究所] * [http://www.linux-kvm.org/page/Migration Migration - KVM] * [http://d.hatena.ne.jp/enakai00/20111124/1322106772 RHEL6.1のKVMでストレージ・ライブマイグレーション - めもめも] = kvm-spice = * Ubuntu 12.04でqemu-kvm-spiceをインストールすると、デフォルトのemulatorが/usr/bin/kvm-spiceになって以下の様な問題が起きる * kern.logにAppArmorからDENIEDとエラーが出る {{{ Oct 13 22:45:08 HOSTNAME kernel: [507466.445098] type=1400 audit(1350135908.372:69): apparmor="DENIED" operation="open" parent=1 profile="libvirt-52d08545-a490-c890-654a-260caf35d27d" name="/proc/17685/auxv" pid=17685 comm="kvm-spice" requested_mask="r" denied_mask="r" fsuid=104 ouid=104 }}} * Video modelをcirrus以外にすると、画面が表示されなくなる(真っ黒のまま) * [https://bugs.launchpad.net/ubuntu/+source/seabios/+bug/958549 Bug #958549 “Black screen on guest with anything except Cirrus” : Bugs : “seabios” package : Ubuntu] * [https://bugs.launchpad.net/ubuntu/+source/qemu-kvm-spice/+bug/970234 Bug #970234 “Selecting spice and qxl mode results in blank scree...” : Bugs : “qemu-kvm-spice” package : Ubuntu] * [https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/975165 Bug #975165 “Can't use spice even though qemu-kvm-spice is insta...” : Bugs : “virt-manager” package : Ubuntu] * [https://bugs.launchpad.net/ubuntu/+source/qemu-kvm-spice/+bug/962376 Bug #962376 “spicevmc not supported in QEMU binary” : Bugs : “qemu-kvm-spice” package : Ubuntu]