在本例中我们安装的是 Fedora13,其中主要步骤内容都是按照 Xen 官网中的安装步骤翻译来得,也是我实际安装过程中使用的步骤。需要注意的是,在进行的分区的时候,给 /boot 目录分配至少 2GB 大小,选择类型为 ext3。然后再创建一个 LVM PV( 物理卷 ),并且在其上创建 LVM Volume 组,之后在 LVM Volume Group 上创建根目录 /root,分配大小至少 40G,选择类型为 ext4,再创建一个 swap 分区。对于 LVM volume group 安装需要注意的是必须预留足够多的空余空间来安装客户的虚拟机。下面是一个 F13 安装过程中分区的一个截屏。
图 2. F13 安装过程中分区截屏
安装完成后我们需要进行一些相关的配置,当我们以 root 用户登陆的时候,我们可以通过以下命令让网络在系统启动的时候被自动 enable。
清单 1. 配置系统自动启动网络服务
# chkconfig network on
# /etc/init.d/network start
|
当你的网络已经启动好了,你就可以用 ssh 来远程设置网络环境,例如通过使用 ifconfig 来设置相关 ip 地址等等。网络配置完成后,我们就可以在线安装一些常用的工具。
清单 2. 安装常用工具
# yum install screen vim wget tcpdump ntp ntpdate man smartmontools ethtool
|
编辑“/boot/grub/grub.conf”和修改“timeout=10”,注释掉 hiddenmenu 这一行,修改后大概就如下所示:
清单 3. 修改后的 grub.conf 信息
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_f13-lvroot
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.33.3-85.fc13.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.33.3-85.fc13.x86_64 ro
root=/dev/mapper/vg_f13-lvroot rd_LVM_
LV=vg_f13/lvroot rd_LVM_LV=vg_f13/lvswap rd_NO_LUKS rd_NO_MD rd_NO_DM
LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=fi rhgb quiet
initrd /initramfs-2.6.33.3-85.fc13.x86_64.img
|
修改过后,我们就可以选择相关内核进行启动了,再这之前我们先把 selinux 关掉,因为这个过于严格了。编辑“/etc/selinux/config” disable 掉这个选项。
清单 4. 修改过的 selinux 配置文件
# 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 - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
|
[责任编辑:admin] |