Creating a Hardware Virtualized Guest Manually
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64' else:
arch_libdir = 'lib'
#Kernel for hvm domain will be hvmloader kernel="/usr/lib/xen/boot/hvmloader" builder='hvm'
#Memory in MB for HVM guest domU memory=3000
#Name of domain
#No of virtual cpus vcpus=4
#Mac address and corresponding bridge
vif=[ 'mac=00:50:56:1e:34:b5 , bridge=xenbr0' ]
#Disk in which Guest OS is installed disk=[ 'phy:/dev/cciss/c0d1,hda,w' ]
#Here /dev/cciss/c0d1 is the disk onwhich OS is installed. device_model='/usr/' + arch_libdir +
#Enable vnc library
sdl=0
vnc=1
#Vncviewer no is 1 vncviewer=1
#Password to access the vnc for this guest vncpasswd="welcome" vnclisten="0.0.0.0"
ne2000=1
serial='pty'
#Enable USB
usb=1
usbdevice='mouse'
See Appendix C, "Guest Configuration Files" for a more configuration file examples.
3.Mount the guest root file system to /mnt to enable you to modify the configuration files.
4.Edit /mnt/etc/sysconfig/network to specify the host name. GATEWAY is same as dom0.
Hostname is the name of the virtual machine, for example, mycomputer.example.com. Make sure the name you use is unique and not being used by another computer.
NETWORKING=yes
HOSTNAME=mycomputer.example.com
GATEWAY=10.1.1.1
5.Edit the /mnt/etc/hosts file to include the hostname and IP address. Make sure that the IP address you use is unique and not being used by another machine.
127.0.0.1 localhost.localdomain localhost
10.1.1.1 mycomputer.example.com hostname