KVM インストール2013/04/27 |
KVM ( Kernel-based Virtual Machine ) +QEMU での仮想化です。
搭載しているCPUが仮想化機構( Intel VT 等 )を備えている必要があります。
|
|
[1] | まずは必要なもののインストールです。 |
root@dlp:~# aptitude -y install qemu-kvm libvirt-bin virtinst bridge-utils
|
[2] | ネットワーク仮想化のオーバーヘッドを減らすことができる vhost-net を有効にしておきます。 |
root@dlp:~# modprobe vhost_net root@dlp:~# lsmod | grep vhost vhost_net 27606 0 root@dlp:~# echo vhost_net >> /etc/modules |
[3] | ブリッジネットワークを構成しておきます。 |
root@dlp:~#
vi /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 primary network interface # 以下のように変更 auto eth0 iface eth0 inet manual # iface eth0 inet static# address 10.0.0.50# network 10.0.0.0# netmask 255.255.255.0# broadcast 10.0.0.255# gateway 10.0.0.1# dns-nameservers 10.0.0.30
# ブリッジインターフェース設定追記
iface br0 inet static
address 10.0.0.30 network 10.0.0.0 netmask 255.255.255.0 broadcast 10.0.0.255 gateway 10.0.0.1 dns-nameservers 10.0.0.30 bridge_ports eth0 bridge_stp off auto br0 initctl restart networking root@dlp:~# br0 Link encap:Ethernet HWaddr 00:0c:29:0a:5c:60 inet addr:10.0.0.30 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe0a:5c60/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:123 errors:0 dropped:0 overruns:0 frame:0 TX packets:118 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:12928 (12.9 KB) TX bytes:13311 (13.3 KB) eth0 Link encap:Ethernet HWaddr 00:0c:29:0a:5c:60 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:354 errors:0 dropped:0 overruns:0 frame:0 TX packets:262 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:44146 (44.1 KB) TX bytes:24693 (24.6 KB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:256 errors:0 dropped:0 overruns:0 frame:0 TX packets:256 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:19776 (19.7 KB) TX bytes:19776 (19.7 KB) virbr0 Link encap:Ethernet HWaddr 7a:08:04:58:2e:4f inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
Sponsored Link |
|