一,安装内核及图形管理器
yum -y install xen kernel-xen virt-manager
vim /boot/grub/grub.conf //修改第一启动
#boot=/dev/sda
default=0
timeout=5
splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-194.el5
module /vmlinuz-2.6.18-194.el5xen ro root=LABEL=/ rhgb quiet
module /initrd-2.6.18-194.el5xen.img
远程需要安装vnc
yum -y install vnc*
在终端shell中运行命令vncpasswd,添加客户端访问时使用的密码。
service vncserver start
在终端shell中运行命令vncserver, 此时会在$HOME/生成一个隐藏文件夹.vnc
进入cd 进入.vnc目录,编辑xstartup文件
取消这两行注释
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
注释掉#twm &
在最后一行添加gnome-session &
service vncserver restart
重启计算机,uname -r 查看是否已经支持
[root@localhost network-scripts]# uname -r
2.6.18-194.el5xen
二,图形安装
新建名字
类型
iso位置(这里我们通过http安装的,只需把iso挂载到/var/www/html/centos下,启动httpd服务即可)
磁盘位置,大小
设置网络
确认信息,安装
注:如果内存给的过小会使用文本模式安装。
三、命令安装
例:virt-install -n vm03 -f /data/vm02.img -s 4 -r 128 nographics -l http://192.168.152.129/centos
具体参数可以通过 virt-install -h 查看
转载于:https://blog.51cto.com/wujingfeng/1070821