XenのCentOSへのインストールは非常に簡単。yumコマンド1つでインストールすることができる。
[root@tkcent1 /]# yum install xen kernel-xen0 kernel-xenU Loading "installonlyn" plugin Setting up Install Process Setting up repositories extras 100% |=========================| 1.1 kB 00:00 updates 100% |=========================| 951 B 00:00 base 100% |=========================| 1.1 kB 00:00 addons 100% |=========================| 951 B 00:00 Reading repository metadata in from local files ################################################## 254/254 primary.xml.gz 100% |=========================| 149 kB 00:00 ################################################## 343/343 ################################################## 3131/3131 Parsing package install arguments Resolving Dependencies
-
- > Populating transaction set with selected packages. Please wait.
- > Downloading header for xen to pack into transaction set.
- > Populating transaction set with selected packages. Please wait.
-
- > Running transaction check
- > Processing Dependency: libxenstore.so.3.0()(64bit) for package: xen
- > Processing Dependency: libfsimage.so.1.0(libfsimage.so.1.0)(64bit) for package: xen
- > Processing Dependency: libSDL-1.2.so.0()(64bit) for package: xen
- > Processing Dependency: libfsimage.so.1.0()(64bit) for package: xen
- > Processing Dependency: libblktap.so.3.0()(64bit) for package: xen
- > Processing Dependency: libxenguest.so.3.0()(64bit) for package: xen
- > Processing Dependency: libxenctrl.so.3.0()(64bit) for package: xen
- > Processing Dependency: python-virtinst for package: xen
- > Processing Dependency: bridge-utils for package: xen
- > Processing Dependency: xen-hypervisor-abi = 3.1 for package: xen
- > Processing Dependency: xen-libs = 3.0.3-41.el5 for package: xen
- > Restarting Dependency Resolution with new changes.
- > Populating transaction set with selected packages. Please wait.
- > Downloading header for python-virtinst to pack into transaction set.
-
- > Running transaction check
- > Processing Dependency: libvirt-python >= 0.2.1 for package: python-virtinst
- > Restarting Dependency Resolution with new changes.
- > Populating transaction set with selected packages. Please wait.
-
- > Running transaction check
- > Processing Dependency: libvirt.so.0()(64bit) for package: libvirt-python
- > Processing Dependency: libvirt = 0.2.3 for package: libvirt-python
- > Restarting Dependency Resolution with new changes.
- > Populating transaction set with selected packages. Please wait.
- > Downloading header for libvirt to pack into transaction set.
-
- > Running transaction check
- > Processing Dependency: dnsmasq for package: libvirt
- > Restarting Dependency Resolution with new changes.
- > Populating transaction set with selected packages. Please wait.
- > Downloading header for dnsmasq to pack into transaction set.
-
-
- > Package dnsmasq.x86_64 0:2.39-2.el5 set to be updated
- > Running transaction check
-
なお、Xenを使用するためにはSELinuxが有効になっていると問題が発生するので向こうに設定しておく必要がある。SELinuxのステータスを確認するためには、getenforceコマンドか、"/selinux/enforce"のビットを確認する(1=有効/0=無効)。
[root@tkcent1 /]# /usr/sbin/getenforce Enforcing
[root@tkcent1 /]# cat /selinux/enforce 1
SELinuxのステータス変更も、同じように"setenforce"コマンドを実施することで可能。ただし、SELinuxが機能していないと"setenforce"コマンドを使用することも出来ないので、"setenforce"コマンドを使用してSELinuxを無効(Disable)にすることはできない。
以下、EnforcingからPermissiveに設定を変更する実施例。Enforcing=1, Permissive=0.
[root@tkcent1 /]# /usr/sbin/setenforce usage: /usr/sbin/setenforce [ Enforcing | Permissive | 1 | 0 ] [root@tkcent1 /]# /usr/sbin/setenforce 0 [root@tkcent1 /]# /usr/sbin/getenforce Permissive
SELinuxの有効/無効を設定し、起動時動作を設定するには、"/etc/selinux/config"ファイルを設定する。
[root@tkcent1 /]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0 [root@tkcent1 /]#
SELinuxを無効に設定したい場合は、"SELINUX=enforcing"となっている箇所を"SELINUX=disabled"に変更する。
/// ってですね、ここまで書いて別件で同時に検証していたら仮想マシンすっとばしちゃいましたよ(^_^;)。合掌…。あー、CentOSのインストールイメージ取っておいてない…。Bittorrentで落とさねば…。そんなわけで、なんか中途半端ですが第1回はここまで。