{"id":166,"date":"2009-05-29T12:20:36","date_gmt":"2009-05-29T03:20:36","guid":{"rendered":"http:\/\/www.mozilla.gr.jp\/~shimono\/blog\/?p=166"},"modified":"2009-05-29T12:20:36","modified_gmt":"2009-05-29T03:20:36","slug":"kvm%e3%83%9e%e3%82%b7%e3%83%b3%e7%94%a8%e3%81%ae%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/blog.himor.in\/?p=166","title":{"rendered":"KVM\u30de\u30b7\u30f3\u7528\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a"},"content":{"rendered":"<p>\u8907\u6570\u306ekernel\u304c\u5fc5\u8981\u306a\u3068\u304d (\u8ffd\u52a0\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3055\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u304b) \u306b\u30de\u30b7\u30f3\u3092\u78ba\u4fdd\u3059\u308b\u306e\u304c\u3081\u3093\u3069\u304f\u3055\u3044\u3057\u5834\u6240\u3082\u3068\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3044\u3044\u52a0\u6e1bVM\u3092\u30db\u30b9\u30c8\u3059\u308b\u30de\u30b7\u30f3\u3092\u7acb\u3066\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3068\u601d\u3063\u3066\u305f\u306e\u3067\u3059\u304c\u3001\u3088\u3046\u3084\u304fKVM\u3092\u52d5\u304b\u3059\u30db\u30b9\u30c8\u3092\u78ba\u4fdd\u3057\u305f\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2\u3001\u3068\u3044\u3046\u3088\u308a\u306f\u3001KVM\u5468\u308a\u306e\u8a2d\u5b9a\u30e1\u30e2\u304b\u3082\u3002\u3002(@ Debian lenny)<\/p>\n<p>KVM\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f<\/p>\n<blockquote><p>aptitude install kvm bridge-utils<\/p><\/blockquote>\n<p>\u3067\u884c\u3046\u3002VM\u7528\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u306e\u6e96\u5099\u3084\u3089\u30b2\u30b9\u30c8OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u666e\u901a\u3069\u304a\u308a\u3002<\/p>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f\u3001LAN\u5185\u306e\u5404\u7a2e\u306e\u30b5\u30fc\u30d0\u3068\u306e\u9023\u643a\u3092\u8003\u3048\u3066\u3001\u30db\u30b9\u30c8\u306b\u30d6\u30ea\u30c3\u30b8\u3092\u4f5c\u3063\u3066\u3001tap\u30c7\u30d0\u30a4\u30b9\u3067\u30b2\u30b9\u30c8\u304c\u76f4\u63a5LAN\u306b\u51fa\u3066\u884c\u3051\u308b\u69cb\u6210\u3092\u53d6\u308b\u3053\u3068\u306b\u3002\u3053\u306e\u8a2d\u5b9a\u306f\u3001br0\u30c7\u30d0\u30a4\u30b9\u3092\u4f5c\u3063\u3066\u3001eth0\u306b\u7d10\u4ed8\u3051\u308b\u3060\u3051\u3001\u3067\u306f\u3042\u308b\u3051\u3069\u3001\u624b\u52d5\u3067\u3084\u308b\u3068\u9762\u5012\u306a\u306e\u3067\u3001\/etc\/network\/interfaces\u3092\u7de8\u96c6\u3057\u3066\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3067\u3002\/etc\/network\/interfaces\u304b\u3089eth0\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u6d88\u3057\u3066\u3001<\/p>\n<blockquote>\n<pre>auto br0\r\niface br0 inet dhcp\r\n  pre-up \/sbin\/ifconfig eth0 promisc up\r\n  pre-up \/usr\/sbin\/brctl addbr br0\r\n  pre-up \/usr\/sbin\/brctl addif br0 eth0\r\n  post-down \/sbin\/ifconfig eth0 down\r\n  post-down \/sbin\/ifconfig br0 down\r\n  post-down \/usr\/sbin\/brctl delbr br0<\/pre>\n<\/blockquote>\n<p>\u3092\u7a81\u3063\u8fbc\u3080\u3002LAN\u5185\u306fDHCP\u74b0\u5883\u306a\u306e\u3067\u3001\u3053\u308c\u3067\u30db\u30b9\u30c8\u306f\u81ea\u52d5\u7684\u306bLAN\u306b\u3064\u306a\u304c\u308b\u3002<\/p>\n<p>\u5404VM\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068\u304d\u306f\u3001tap\u30c7\u30d0\u30a4\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u6a29\u9650\u306e\u3042\u308b\u30a2\u30ab\u30a6\u30f3\u30c8(root?)\u304b\u3089\u3001<\/p>\n<blockquote>\n<pre>kvm -hda disk-image.img -boot c -m &lt;mem&gt; -curses -net nic,macaddr=&lt;mac addr&gt; -net tap,ifname=&lt;tap device&gt;,script=\/etc\/kvm\/kvm-ifup<\/pre>\n<\/blockquote>\n<p>\u3092\u5b9f\u884c\u3059\u308b\u3002\u30b2\u30b9\u30c8VM\u306eMAC\u30a2\u30c9\u30ec\u30b9\u306f\u6307\u5b9a\u3057\u306a\u3044\u3068\u3059\u3079\u3066\u30c7\u30d5\u30a9\u30eb\u30c8(52:54:00:12:34:56)\u306b\u306a\u308b\u306e\u3067\u3001\u91cd\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u5404VM\u8d77\u52d5\u6642\u306b\u6307\u5b9a\u3057\u3066\u3084\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8907\u6570\u306ekernel\u304c\u5fc5\u8981\u306a\u3068\u304d (\u8ffd\u52a0\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3055\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u304b) \u306b\u30de\u30b7\u30f3\u3092\u78ba\u4fdd\u3059\u308b\u306e\u304c\u3081\u3093\u3069\u304f\u3055\u3044\u3057\u5834\u6240\u3082\u3068\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3044\u3044\u52a0\u6e1bVM\u3092\u30db\u30b9\u30c8\u3059\u308b\u30de\u30b7\u30f3\u3092\u7acb\u3066\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3068\u601d\u3063\u3066\u305f\u306e\u3067\u3059\u304c\u3001\u3088\u3046\u3084\u304fKVM\u3092\u52d5\u304b\u3059\u30db\u30b9\u30c8\u3092\u78ba\u4fdd\u3057\u305f\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2\u3001\u3068\u3044\u3046\u3088\u308a\u306f\u3001KVM\u5468\u308a\u306e\u8a2d\u5b9a\u30e1\u30e2\u304b\u3082\u3002\u3002(@ Debian lenny) KVM\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f aptitude install kvm bridge-utils \u3067\u884c\u3046\u3002VM\u7528\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u306e\u6e96\u5099\u3084\u3089\u30b2\u30b9\u30c8OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u666e\u901a\u3069\u304a\u308a\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f\u3001LAN\u5185\u306e\u5404\u7a2e\u306e\u30b5\u30fc\u30d0\u3068\u306e\u9023\u643a\u3092\u8003\u3048\u3066\u3001\u30db\u30b9\u30c8\u306b\u30d6\u30ea\u30c3\u30b8\u3092\u4f5c\u3063\u3066\u3001tap\u30c7\u30d0\u30a4\u30b9\u3067\u30b2\u30b9\u30c8\u304c\u76f4\u63a5LAN\u306b\u51fa\u3066\u884c\u3051\u308b\u69cb\u6210\u3092\u53d6\u308b\u3053\u3068\u306b\u3002\u3053\u306e\u8a2d\u5b9a\u306f\u3001br0\u30c7\u30d0\u30a4\u30b9\u3092\u4f5c\u3063\u3066\u3001eth0\u306b\u7d10\u4ed8\u3051\u308b\u3060\u3051\u3001\u3067\u306f\u3042\u308b\u3051\u3069\u3001\u624b\u52d5\u3067\u3084\u308b\u3068\u9762\u5012\u306a\u306e\u3067\u3001\/etc\/network\/interfaces\u3092\u7de8\u96c6\u3057\u3066\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3067\u3002\/etc\/network\/interfaces\u304b\u3089eth0\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u6d88\u3057\u3066\u3001 auto br0 iface br0 inet dhcp pre-up \/sbin\/ifconfig eth0 promisc up pre-up \/usr\/sbin\/brctl addbr br0 pre-up \/usr\/sbin\/brctl addif br0 eth0 post-down \/sbin\/ifconfig eth0 down post-down \/sbin\/ifconfig br0 down post-down \/usr\/sbin\/brctl delbr br0 \u3092\u7a81\u3063\u8fbc\u3080\u3002LAN\u5185\u306fDHCP\u74b0\u5883\u306a\u306e\u3067\u3001\u3053\u308c\u3067\u30db\u30b9\u30c8\u306f\u81ea\u52d5\u7684\u306bLAN\u306b\u3064\u306a\u304c\u308b\u3002 \u5404VM\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068\u304d\u306f\u3001tap\u30c7\u30d0\u30a4\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u6a29\u9650\u306e\u3042\u308b\u30a2\u30ab\u30a6\u30f3\u30c8(root?)\u304b\u3089\u3001 kvm -hda disk-image.img -boot c -m &lt;mem&gt; -curses -net [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17,4,14],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/posts\/166"}],"collection":[{"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.himor.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166"}],"version-history":[{"count":1,"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/blog.himor.in\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/blog.himor.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.himor.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.himor.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}