Xen 下安装 Linux



用户手册 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" ]

更多命令请查看帮助

标签: linux, 虚拟化

相关文章

评论已关闭