3>用xm list 命令查看Domain是否已经启动。 [root@localhost ~]# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 778 1 r----- 85.4 4>将cdrom挂载到FTP目录,将ftp匿名用户开启。 /etc/init.d/vsftpd start #启动ftp [root@localhost ~]# mount /dev/cdrom /var/ftp/pub/ #挂载光盘到ftp下 mount: block device /dev/cdrom is write-protected, mounting read-only 5>用xm命令行建立虚拟机 [root@localhost ~]# virt-install (新版本的xen需要加参数 --prompt,有设置硬盘大小参数,旧版本没有这个参数 What is the name of your virtual machine? vm1 #虚拟机的名字vm1 How much RAM should be allocated (in megabytes)? 400 #为虚拟机分配内存400M 最低256M What would you like to use as the disk (file path)? /dev/sdb1 #sdb为第二块硬盘 Would you like to enable graphics support? (yes or no) no #不启用图形化支持 What is the install location? ftp://192.168.1.237/pub/ #填上本机FTP地址,前提是CDROM已经挂载到这个FTP目录,并开启了匿名用户。 可以看到安装文件内核已经开始启动! Starting install... Retrieving file .treeinfo... 0 B 00:00 Retrieving file vmlinuz.. 100% |=========================| 2.0 MB 00:00 Retrieving file initrd.im 100% |=========================| 5.0 MB 00:00 接下来安装过程就不用我说了吧,TEXT模式的。 Welcome to CentOS +---------+ Choose a Language +---------+ | | | What language would you like to use | | during the installation process? | | | | Catalan ^ | | Chinese(Simplified) : | | Chinese(Traditional) # | | Croatian : | | Czech : | | Danish : | | Dutch : | | English v | | | | +----+ | | | OK | | | +----+ | | | | | +---------------------------------------+ <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen 6>安装完成后重新启动系统 7>管理xen虚拟机 查看当前系统中的虚拟机普通信息 xm list 查看虚拟机的负载情况 xm top Domain 0 与Domain n之间的控制台切换 xm console <domain id / domain name> Ctrl + ] 返回 Domian 0 关闭Domain N 切换到Domain n,使用其操作系统的关机命令 xm shutdown <domain id / domain name> xm destory <domain id / domain name> 启动 Domain n xm create <domain name>