CentOS6.5下制作CentOS镜像文件 在控制节点或者带有桌面环境的机器中安装以下命令: 1. 安装基础环境yum -ygroupinstall Virtualization* service libvirtdstart 2. 在桌面环境中启动virt-manage应用或者在命令行中输入: virt–manager,进入如下页面 file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.jpg 3. 创建虚拟机file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png 点击创建虚拟机按钮打开创建虚拟机对话框,如下图所示:
file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image004.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png 整个虚拟机的创建过程跟在其他虚拟机软件中的创建过程基本一致,需要注意的是: 1.网络选择,选择:NAT; 2.硬盘存储的选择时选择IMG格式的硬盘(qcow2格式)。 3.磁盘位置:/var/lib/libvirt/images/* 4.网络设置时,设置网络为自动获取IP,也就是HDCP的方式,网路设置为自动连接。 5.root用户的密码为:rootpass 6.分区时只设置一个“/”分区 7.服务器选择选择:basicServer 8.安装完成后重启。
|
| file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image007.png |
file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image008.png 4. 相关配置1.修改启动文件Vi /boot/grub/grub.conf中加入selinux=0enforcing=0 2.为了使控制台起作用: Vi /boot/grub/menu.lst serial --unit=0 --speed=115200 terminal --timeout=10 console serial # Edit the kernel line to add the console entries kernel ... console=tty0console=ttyS0,115200n8 3.Vi /etc/ssh/ssd_config 修改UseDNS=no, GSSAPIAuthentication no 4.修改/etc/ssh/sshd_config的PasswordAuthentication项为yes//否则远程ssh报错。 5.进入虚拟机后,安装colud-init包 yum installcloud-init cloud-utils parted git cd /tmp cdlinux-rootfs-resize ./install 6.Edit /etc/cloud/cloud.cfg and under cloud_init_modules add: - resolv-conf 可以去掉:- ssh 7. 设置网卡,去掉MAC地址 Vi/etc/sysconfig/network-scripts/ifcfg-eth0 8. 去掉路由文件(非常重要) rm -rf/etc/udev/rules.d/70-persistent-net.rules 9. 关闭防火墙 sed -is/^SELINUX=.*/SELINUX=disabled/g /etc/selinux/config service iptablesstop && chkconfig iptables off service ip6tablesstop && chkconfig ip6tables off 10. 在网路设置的配置文件/etc/sysconfig/network中加入配置:NOZEROCONF=yes 11. 一定通过shutdown –h now来关机 图文详情请查看附件。
openstack-CentOS镜像制作.pdf
(666.56 KB, 下载次数: 8)
|