正在加载...

Xen 下安装 Linux

[ 2010/03/01 18:29 | by selboo ]

用户手册 Xen v3.0 http://selboo.com.cn/book/Xen3man/
官网手册 http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/zh-CN/Virtualization/index.html

重建一个10G 硬盘
[root@localhost ~]# dd if=/dev/zero of=/home/xenlinux/centos-xen bs=1M count=10240

开始安装
[root@localhost boot]# virt-install
What is the name of your virtual machine? centos    // 名称
How much RAM should be allocated (in megabytes)? 512  // 内存
What would you like to use as the disk (file path)? /home/xenlinux/centos-xen  // 使用上面建立的文件
Would you like to enable graphics support? (yes or no) no    // 是否启动图形
What is the install location? /iso/CentOS-5.3-x86_64-bin-DVD.iso  // 安装镜像

或着
virt-install --name=centos --ram=512 --file=/home/xenlinux/centos-xen --file-size=10 --location=/iso/CentOS-5.3-x86_64-bin-DVD.iso

在下一步就像平常安装linux 一样...
安装完成之后会生成一个配置文件 /etc/xen/centos

[root@localhost ~]# xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0     1228     8 r-----     47.2
centos                                     1      511     1 -b----      5.5

简单一些调整

增加内存
[root@localhost ~]# xm mem-set centos 512

重启 关机 开机
[root@localhost ~]# xm reboot centos
[root@localhost ~]# xm shutdown centos
[root@localhost ~]# xm create centos

或着修改配置文件
[root@localhost ~]# cat /etc/xen/centos
name = "centos"
uuid = "eba2a894-1c3f-e5f8-7da5-67148135076f"
# 设置内存
maxmem = 512
memory = 512
# 设置CPU
vcpus = 2
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [  ]
disk = [ "tap:aio:/home/xenlinux/centos.img,xvda,w" ]
vif = [ "mac=00:16:3e:30:5c:f8,bridge=xenbr0" ]

更多命令请查看帮助
最后编辑: selboo 编辑于2011/09/03 02:00
Tags: , ,
,
发表评论
表情
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]