Now the Xen guide on the wiki is wrong.
The following are correct and have been tested correctly:
1 Installation Xen
sudo apt-get install Ubuntu-xen-server
2 configuration Xen
sudo vim/etc/xen/xend-config.sxp
Modify rows
# (Vnc-listen ' 127.0.0.1 ')
For:
(Vnc-listen ' 0.0.0.0 ')
When you are finished, restart your computer.
3 Build virtual Machines
sudo mkdir/home/xen
sudo dd if=/dev/zero of=/home/xen/xp.img bs=1 count=0 seek=20g
#下载xp的iso文件
sudo wget ...-o/home/xen/xp.iso
#挂载iso设备到/dev/loop0
sudo losetup ' sudo losetup-f '/home/xen/xp.iso
#创建虚拟机配置文件:
sudo vim/etc/xen/xp.cfg
Input:Code:#-*-Mode:python; -*-
Import OS, re
Arch = Os.uname () [4]
If Re.search (' ', 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/xen/xp.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
The problem to note: ISO files need to use PHY: the way to mount, IMG files need to use Tap:aio: the way to mount, no longer support the original file: mode.
#启动虚拟机
sudo xm create/etc/xen/xp.cfg
#启动远程vnc
Vncviewer Xen Server IP
#重启虚拟机
sudo xm reboot XP
#关闭虚拟机
sudo xm shutdown xp
Note If you use the clone version of XP, First partition, select the active partition partition, after cloning, boot to DOS, use FDISK/MBR to repair the MBR, so you can boot from the hard drive.
#测试无误后, set the IP address of the installed XP, and turn on remote maintenance, plus the administrator password. Then modify the/etc/xen/xp.cfg file, set vnc = 0 to close VNC, and set boot = "C" to boot directly from the hard drive while turning off the optical drive line in disk =, then use the optical drive directly in XP to use the virtual CD-ROM drive.
Restart XM when Setup is complete
sudo xm shutdown xp
sudo xm create/etc/xen/xp.cfg
If you need a server automatic virtual machine, make a soft link in the Xen Auto directory:
sudo ln-s/etc/xen/xp.cfg/etc/xen/auto/
The following are correct and have been tested correctly:
1 Installation Xen
sudo apt-get install Ubuntu-xen-server
2 configuration Xen
sudo vim/etc/xen/xend-config.sxp
Modify rows
# (Vnc-listen ' 127.0.0.1 ')
For:
(Vnc-listen ' 0.0.0.0 ')
When you are finished, restart your computer.
3 Build virtual Machines
sudo mkdir/home/xen
sudo dd if=/dev/zero of=/home/xen/xp.img bs=1 count=0 seek=20g
#下载xp的iso文件
sudo wget ...-o/home/xen/xp.iso
#挂载iso设备到/dev/loop0
sudo losetup ' sudo losetup-f '/home/xen/xp.iso
#创建虚拟机配置文件:
sudo vim/etc/xen/xp.cfg
Input:Code:#-*-Mode:python; -*-
Import OS, re
Arch = Os.uname () [4]
If Re.search (' ', 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/xen/xp.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
The problem to note: ISO files need to use PHY: the way to mount, IMG files need to use Tap:aio: the way to mount, no longer support the original file: mode.
#启动虚拟机
sudo xm create/etc/xen/xp.cfg
#启动远程vnc
Vncviewer Xen Server IP
#重启虚拟机
sudo xm reboot XP
#关闭虚拟机
sudo xm shutdown xp
Note If you use the clone version of XP, First partition, select the active partition partition, after cloning, boot to DOS, use FDISK/MBR to repair the MBR, so you can boot from the hard drive.
#测试无误后, set the IP address of the installed XP, and turn on remote maintenance, plus the administrator password. Then modify the/etc/xen/xp.cfg file, set vnc = 0 to close VNC, and set boot = "C" to boot directly from the hard drive while turning off the optical drive line in disk =, then use the optical drive directly in XP to use the virtual CD-ROM drive.
Restart XM when Setup is complete
sudo xm shutdown xp
sudo xm create/etc/xen/xp.cfg
If you need a server automatic virtual machine, make a soft link in the Xen Auto directory:
sudo ln-s/etc/xen/xp.cfg/etc/xen/auto/