LoginSignup
2
2

More than 5 years have passed since last update.

CentOS6 で KVM 環境構築

Posted at

CentOS7 上で KVM を構築していたけど、調子が悪いので CentOS6.7 で再構築する。

CentOS6.7 のインストールパッケージは、仮想化ホストを選択してインストールした。

必要なパッケージがインストールされていることを確認。

# rpm -qa | grep -E 'kvm|virt|bridge'
virt-manager-0.9.0-29.el6_7.1.x86_64
libvirt-client-0.10.2-54.el6_7.6.x86_64
libvirt-0.10.2-54.el6_7.6.x86_64
virt-top-1.0.4-3.15.el6.x86_64
bridge-utils-1.2-10.el6.x86_64
libvirt-python-0.10.2-54.el6_7.6.x86_64
qemu-kvm-0.12.1.2-2.479.el6_7.4.x86_64
libgovirt-0.3.2-1.el6_7.2.x86_64
virt-viewer-2.0-7.el6.x86_64
python-virtinst-0.600.0-29.el6.noarch
virt-what-1.11-1.2.el6.x86_64

モジュールが読み込まれているか確認。

# lsmod | grep kvm
kvm_amd                40635  0
kvm                   345659  1 kvm_amd

実行状況の確認。

# service libvirtd status
libvirtd (pid  1918) を実行中...
# service messagebus status
messagebus (pid  1467) を実行中...

自動起動設定の確認。

# chkconfig --list | grep -E 'libvirtd|messagebus'
libvirtd        0:off   1:off   2:off   3:on    4:on    5:on    6:off
messagebus      0:off   1:off   2:on    3:on    4:on    5:on    6:off

ゲストOS 用にブリッジネットワークを構成する。
僕の環境には NIC が 2 つ搭載されているので、ひとまず片方をゲスト用に使用するように設定する。

# cd /etc/sysconfig/network-scripts/
# mv ifcfg-eth1 ifcfg-br1
# vi ifcfg-br1
DEVICE=br1 #変更 eth1 -> br1 
TYPE=Bridge #変更 Ethernet -> Bridge
ONBOOT=yes #変更 no -> yes
NM_CONTROLLED=yes
BOOTPROTO=none #変更 dhcp -> none

# vi ifcfg-eth1
DEVICE=eth1
HWADDR=00:1D:7D:A1:7F:CD
TYPE=Ethernet
ONBOOT=yes
BRIDGE=br1

# service network restart
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2