OS: LINUX ubuntu 9.10 server

step0: 將xpsp2.iso放在 /home/xeniso/裡

step1: apt-get install ubuntu-xen-server

step2: gedit /etc/xen/xend-config.sxp

將#(vnc-listen '127.0.0.1') 

改為(vnc-listen '0.0.0.0') 

step3: reboot

step4: dd if=/dev/zero of=/home/xeniso/xpsp2.img bs=1 count=0 seek=20G

step5: losetup -f /home/xeniso/xpsp2.iso

step6: gedit /etc/xen/xp.cfg

內容為

#  -*- mode: python; -*-

import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'

kernel = '/usr/'+ arch_libdir +'/xen/boot/hvmloader'
builder='hvm'
memory = 512
shadow_memory = 8
name = "xp"
vif = [ 'type=ioemu, bridge=eth0' ]
disk = [ 
   'tap:aio:/home/xeniso/xpsp2.img,hda,w', 
   'phy:/dev/loop0,hdc:cdrom,r'
]

boot = "dc"
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
vnc=1
vncpasswd=''
serial='pty'
sdl=1

#注意網卡是否為eth0 可用ifconfig查詢

step7: xm create /etc/xen/xp.cfg

指啟動虛擬器,但如出現以下的錯誤

 

ERROR Internal error: Could not obtain handle on privileged command interface (2 = No such file or directory)
Traceback (most recent call last):
  File "/usr/sbin/xm", line 8, in <module>
    from xen.xm import main
  File "/usr/lib/python2.6/dist-packages/xen/xm/main.py", line 61, in <module>
    xc = xen.lowlevel.xc.xc()
xen.lowlevel.xc.Error: (1, 'Internal error', 'Could not obtain handle on privileged command interface (2 = No such file or directory)')

使用gedit /proc/cpuinfo

查看CPU有無支援虛擬化

intel: flag欄位要有vmx 和 tm

amd: flag欄位要有svm 和 tm

如果沒有,很抱歉,此電腦不支援xen

step8: vncviewer xenIP

指啟動遠端vnc

step9:

xm reboot xp

xm shutdown xp

重開與關機

step10: ln -s /etc/xen/xp.cfg /etc/xen/auto/

開機啟動虛儗器

 

OS: LINUX CentOS 5.4

step1: install VMware tools

step2: yum install kernel

step3: yum update kernel

step4: yum install kernel-xen xen xen-libs python-virtinst virt-manager

step5: rum virt-manager

step6: new virtual machine and run http://ftp.twaren.net/Linux/CentOS/5.4/os/i386/

 

 

 

 

arrow
arrow
    全站熱搜

    caramels 發表在 痞客邦 留言(0) 人氣()