+-------------------------------------------------------------------------------------------------------------------------------
ATTENTION: Befor taking the following steps, make sure you have followed the xen-install.txt to install xen & vnc parts correctly.
+-------------------------------------------------------------------------------------------------------------------------------
1. 建立虚拟机路径
就是你的虚拟机文件在宿主机中存放的地方,先要建立出来
[iyunv@server201 /]# mkdir /opt/xen/kcwin2k3_2
[iyunv@server201 /]# cd /opt/xen/kcwin2k3_2
按照我的习惯就是建立虚拟机在 /opt/xen/xxxx 下建立
2.建立Windows2003虚拟机
[iyunv@server201 kcwin2k3_2]# virt-install -n kcwin2k3_2 --file=disk1.img --file=disk2.img --vnc -v -c /iso/win2k3.iso -r 512 --vcpus=1
How large would you like the disk (disk1.img) to be (in gigabytes)? 8
How large would you like the disk (disk2.img) to be (in gigabytes)? 1
这里就是用 virt-install 命令来安装虚拟机,其中的参数我再解释一下
--------------------------------------------------------------------
virt-install 建立虚拟机的命令
-n 虚拟机的命名
--file 虚拟机的磁盘文件
--vnc 使用VNC终端连接方式
-r 虚拟机的内存容量
--vcpus 虚拟机的CPU数量
-v 可视
-c 安装镜像的路径
之后出现以下提示信息:
Starting install...
Unable to connect to graphical console; DISPLAY is not set. Please connect to localhost:5900
Domain installation still in progress. You can reconnect to the console to complete the installation process.
这里其实已经开始安装了,但是由于文字终端不支持图象,所以希望用户通过5900端口连接图形终端,并且这个虚拟机的安装并没有终止,仍然再继续。
问题是,这里,虚拟机已经初始化形成了,目前的工作只是在安装这个虚拟机的系统而已。可以先关闭掉这台虚拟机,以后再启动继续安装系统,这里我们还有很多工作要做。