博文目录:
1. Xen的安装编译
2. 创建半虚拟化Guest OS
3. 创建全虚拟化Windows Guest OS
4. 创建全虚拟化Linux Guest OS
创建全虚拟化GuestOS
创建hvm虚拟机方式与创建pv虚拟机类似,差别在于配置文件的编写上。如果开始不知道怎么入手写配置文件,可以查看/etc/xen下的xlexample.Hvm文件。具体配置文件的编写可参照如下:
# =====================================================================
# Example HVM guest configuration
# =====================================================================
#
# This is a fairly minimal example of what is required for an
# HVM guest. For a more complete guide see xl.cfg(5)
# This configures an HVM rather than PV guest
builder = "hvm"
# Guest name
name = "ubuntu1.hvm"
# 128-bit UUID for the domain as a hexadecimal number.
# Use "uuidgen" to generate one if required.
# The default behavior is to generate a new UUID each time the guest is started.
#uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
# Enable Microsoft Hyper-V compatibile paravirtualisation /
# enlightenment interfaces. Turning this on can improve Windows guest
# performance and is therefore recommended
#viridian = 1
# Initial memory allocation (MB)
memory = 800
(根据个人内存分配)
# Maximum memory (MB)
# If this is greater than `memory' then the slack will start ballooned
# (this assumes guest kernel support for ballooning)
#maxmem = 256
minmem = 128
# Number of VCPUS
vcpus = 1
# Network devices
# A list of 'vifspec' entries as described in
# docs/misc/xl-network-configuration.markdown
vif = [ '' ]
#pci=['00:19.0']
#pci_permissive=1
# Disk Devices
# A list of `diskspec' entries as described in
# docs/misc/xl-disk-configuration.txt
disk=['file:/home/Image/ubuntu1404_hvm.img,hda,w','file:/home/zxm/Desktop/wang/ubuntu-14.04.3-desktop-amd64.iso,hdc:cdrom,r']
(很重要)
#disk = [ '/dev/nbd0,,hda,rw', ',hdc:cdrom,r' ]
boot="c"
#xen_platform_pci=0
# Guest VGA console configuration, either SDL or VNC
#sdl = 1
usb=1
usbdevice='tablet'
vnc = 1
vfb=['type=vnc,vncdisplay=6']
vnc用来设置图形化界面,也可以使用SPice,关于spice的配置如下,可参考使用
#Spice Graphics Support
spice=1
spicehost='0.0.0.0'
spiceport=6000
spicedisable_ticketing=1
spiceagent_mouse=1
spicevdagent=1
spice_clipboard_sharing=1
配置文件创建完成之后就可以使用Xl命令创建虚拟机了:
Xl create example.Hvm(此处参照自己设置的配置文件名)
之后执行 vncviewer 127.0.0.1 进入虚拟机界面
或执行 spice -h 127.0.0.1 -p 6000查看
最后特别推荐一篇博客:http://blog.csdn.net/ctbinzi/article/details/6157932 关于hvm虚拟机配置文件的相关选项,作者写的很详细,可以用来做参考文档了,非常感谢!