Difference between revisions of "Xen-test-debian"

From VNUML-WIKI
Jump to: navigation, search
(Work on progress)
(Create the first virtual machine)
Line 33: Line 33:
 
Edit the /etc/xen-tools/xen-tools.conf file. The gateway= value used here could be not appropiated for you.
 
Edit the /etc/xen-tools/xen-tools.conf file. The gateway= value used here could be not appropiated for you.
  
   dir = /root/xen-test
+
   dir   = /root/xen-test
 
   size  = 1Gb
 
   size  = 1Gb
 
   memory = 32Mb
 
   memory = 32Mb
Line 42: Line 42:
 
   gateway = 192.168.247.2
 
   gateway = 192.168.247.2
 
   netmask = 255.255.255.0
 
   netmask = 255.255.255.0
   passwd = 1
+
   passwd = 1
   kernel = /boot/vmlinuz-2.6.18-3-xen-686
+
   kernel = /boot/vmlinuz-2.6.18-3-xen-686
   initrd = /boot/initrd.img-2.6.18-3-xen-686
+
   initrd = /boot/initrd.img-2.6.18-3-xen-686
   mirror = <nowiki>http://ftp.us.debian.org/debian/</nowiki>
+
   mirror = <nowiki>http://ftp.us.debian.org/debian/</nowiki>
  
 
Create the first virtual machine (it will take a LONG time). Use a proper IP for you.
 
Create the first virtual machine (it will take a LONG time). Use a proper IP for you.
  
 
   xen-create-image --hostname=test --ip=192.268.247.140 --passwd --debootstrap
 
   xen-create-image --hostname=test --ip=192.268.247.140 --passwd --debootstrap
 +
 +
This creates the necesary files under /root/xen-test. However, the key file descring the virtual machine is /etc/xen/test.cfg. What xen-create-image has put in test.cfg is the following:
 +
 +
kernel  = '/boot/vmlinuz-2.6.18-3-xen-686'
 +
ramdisk = '/boot/initrd.img-2.6.18-3-xen-686'
 +
memory  = '32'
 +
root    = '/dev/sda1 ro'
 +
disk    = [ 'file:/root/xen-test/domains/test/disk.img,sda1,w', 'file:/root/xen-test/domains/test/swap.img,sda2,w' ]
 +
name    = 'test'
 +
vif    = [ 'ip=192.268.247.140' ]
 +
on_poweroff = 'destroy'
 +
on_reboot  = 'restart'
 +
on_crash    = 'restart'
 +
 +
 +
In order to boot the machine:
  
 
== Uselful references ==
 
== Uselful references ==
  
 
http://www.debian-administration.org/articles/396
 
http://www.debian-administration.org/articles/396

Revision as of 17:13, 21 February 2007

Installing Xen basic packages in Debian

Udpate the APT repository

 apt-get update

Install the Xen hypervisor. Note that the version may have changed: search for the current one using 'apt-get search xen-hypervisor'. Default hypervisor supports up to 4GB of physical RAM, the -pae version up to 64GB of physical RAM (we are considering the former here).

 apt-get install xen-hypervisor-3.0.3-1-i386

Install the Xen kernel:

 apt-get install linux-image-xen-686

Install Xen tools:

 apt-get install xen-tools

Install the libc6-xen (I'm not sure what it's for or even if this installation could be omitted):

 apt-get install libc6-xen

All packages in the same command:

 apt-get install xen-hypervisor-3.0.3-1-i386 linux-image-xen-686 xen-tools libc6-xen

Create the first virtual machine

Create a working directory (e.g., /root/xen.test)

 mkdir /root/xen-test

Edit the /etc/xen-tools/xen-tools.conf file. The gateway= value used here could be not appropiated for you.

 dir    = /root/xen-test
 size   = 1Gb
 memory = 32Mb
 swap   = 128Mb
 fs     = ext3
 dist   = sarge
 image  = sparse
 gateway = 192.168.247.2
 netmask = 255.255.255.0
 passwd  = 1
 kernel  = /boot/vmlinuz-2.6.18-3-xen-686
 initrd  = /boot/initrd.img-2.6.18-3-xen-686
 mirror  = http://ftp.us.debian.org/debian/

Create the first virtual machine (it will take a LONG time). Use a proper IP for you.

 xen-create-image --hostname=test --ip=192.268.247.140 --passwd --debootstrap

This creates the necesary files under /root/xen-test. However, the key file descring the virtual machine is /etc/xen/test.cfg. What xen-create-image has put in test.cfg is the following:

kernel = '/boot/vmlinuz-2.6.18-3-xen-686' ramdisk = '/boot/initrd.img-2.6.18-3-xen-686' memory = '32' root = '/dev/sda1 ro' disk = [ 'file:/root/xen-test/domains/test/disk.img,sda1,w', 'file:/root/xen-test/domains/test/swap.img,sda2,w' ] name = 'test' vif = [ 'ip=192.268.247.140' ] on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart'


In order to boot the machine:

Uselful references

http://www.debian-administration.org/articles/396