Difference between revisions of "Dom0 Installation on Debian"

From Supercomputación y Cálculo Científico UIS
Line 36: Line 36:
 
4) Edit the /etc/xen/xend-config.sxp file and uncomment the follwing lines
 
4) Edit the /etc/xen/xend-config.sxp file and uncomment the follwing lines
  
 +
{{File|/etc/xen/xend-config.sxp|<pre><nowiki>
 
         (network-script 'network-bridge netdev=eth0')
 
         (network-script 'network-bridge netdev=eth0')
 
         (vif-script vif-bridge)
 
         (vif-script vif-bridge)
 +
</nowiki></pre>}}
  
 
NOTE: Reboot the daemon before doing any change on this file
 
NOTE: Reboot the daemon before doing any change on this file
Line 43: Line 45:
 
5) If you are using images on files, edit /etc/modules and change the "loop" module line in order to look like this
 
5) If you are using images on files, edit /etc/modules and change the "loop" module line in order to look like this
  
 +
{{File|/etc/modules|<pre><nowiki>
 
         loop max_loop=64
 
         loop max_loop=64
 +
</nowiki></pre>}}
  
 
CREATING IMAGES
 
CREATING IMAGES
Line 49: Line 53:
 
1) Edit the /etc/xen-tools/xen-tools.conf file and put the configuration you like to. Example:
 
1) Edit the /etc/xen-tools/xen-tools.conf file and put the configuration you like to. Example:
  
 +
{{File|/etc/xen-tools/xen-tools.conf|<pre><nowiki>
 
         dir = /home/xen
 
         dir = /home/xen
 
         install-method = debootstrap
 
         install-method = debootstrap
Line 65: Line 70:
 
         broadcast = 192.168.100.255
 
         broadcast = 192.168.100.255
 
         passwd = 1
 
         passwd = 1
 
+
</nowiki></pre>}}
  
 
2) Generate the image by using the following command.
 
2) Generate the image by using the following command.
  
{{Command|<nowiki> xen-create-image --hostname=vm1.platino.gov.ve  --ip=192.168.100.80 --arch=amd64 --role=udev </nowiki>}}
+
{{Command|<nowiki> xen-create-image --hostname=vm1.ve  --ip=192.168.100.80 --arch=amd64 --role=udev </nowiki>}}
  
 
NOTE: The last script does not take on count some details, is necessary to fix them
 
NOTE: The last script does not take on count some details, is necessary to fix them
  
3) Edit the /etc/xen/vm1.platino.gov.ve.cfg file and modify the following lines for looking like this
+
3) Edit the /etc/xen/vm1.cfg file and modify the following lines for looking like this
  
 +
{{File|/etc/xen/vm1.ve.cfg|<pre><nowiki>
 
         root = '/dev/sda2 ro console=/dev/hvc0'
 
         root = '/dev/sda2 ro console=/dev/hvc0'
 
         vif  = [ 'bridge=eth0' ]
 
         vif  = [ 'bridge=eth0' ]
 +
</nowiki></pre>}}
  
 
4) Mount the image
 
4) Mount the image
  
{{Command|<nowiki> mount -o loop /home/xen/domains/vm1.platino.gov.ve/disk.img /mnt </nowiki>}}
+
{{Command|<nowiki> mount -o loop /home/xen/domains/vm1.ve/disk.img /mnt </nowiki>}}
  
 
5) Edit the file /mnt/etc/inittab and change the line
 
5) Edit the file /mnt/etc/inittab and change the line
  
 +
{{File|/mnt/etc/inittab|<pre><nowiki>
 
         1:2345:respawn:/sbin/getty 38400 tty1
 
         1:2345:respawn:/sbin/getty 38400 tty1
 +
</nowiki></pre>}}
  
 
For it to look like this
 
For it to look like this
  
 +
{{File|/mnt/etc/inittab|<pre><nowiki>
 
         1:2345:respawn:/sbin/getty 38400 hvc0
 
         1:2345:respawn:/sbin/getty 38400 hvc0
 +
</nowiki></pre>}}
  
 
6) Edit the /mnt/etc/securetty file and add to the end of the line
 
6) Edit the /mnt/etc/securetty file and add to the end of the line
  
 +
{{File|/mnt/etc/securetty|<pre><nowiki>
 
         hvc0
 
         hvc0
 +
</nowiki></pre>}}
  
 
7) For booting the virtual machine run the following command:
 
7) For booting the virtual machine run the following command:

Revision as of 15:05, 20 August 2014

Es:Instalación del Dominio0 en Debian

Back to: Xen on Debian

This parameters were made for the Xen installation on Linux Debian over Intel machines or AMD 64 bits.


1) Install the adecuate software to enable it

apt-get install xen-hypervisor-4.1-amd64 xen-tools xen-utils-4.1 xen-linux-system-amd64


Debian autoconfigurates grub in order to use the Xen hypervisor for booting the next time

2) Reboot the machine

reboot


3) Check if the machine has the dom0 kernel of Xen

uname -srm


You have to see somethimg like this

Linux 3.2.0-4-amd64 x86_64

Also, you can see if dom0 is running by running the following command:

xm list


And the output will be

       Name                                        ID   Mem VCPUs      State   Time(s)
       Domain-0                                     0  7926     8     r-----     20.0

4) Edit the /etc/xen/xend-config.sxp file and uncomment the follwing lines

File: /etc/xen/xend-config.sxp
        (network-script 'network-bridge netdev=eth0')
        (vif-script vif-bridge)

NOTE: Reboot the daemon before doing any change on this file

5) If you are using images on files, edit /etc/modules and change the "loop" module line in order to look like this

File: /etc/modules
        loop max_loop=64

CREATING IMAGES

1) Edit the /etc/xen-tools/xen-tools.conf file and put the configuration you like to. Example:

File: /etc/xen-tools/xen-tools.conf
        dir = /home/xen
        install-method = debootstrap
        size   = 4Gb      # Disk image size.
        memory = 1024Mb    # Memory size
        swap   = 1024Mb    # Swap size
        fs     = ext3     # use the EXT3 filesystem for the disk image.
        dist   = lenny     # Default distribution to install.
        image  = sparse   # Specify sparse vs. full disk images.
        kernel      = /boot/vmlinuz-`uname -r`
        initrd      = /boot/initrd.img-`uname -r`
        mirror = http://ftp.us.debian.org/debian/
        ext3_options   = noatime,nodiratime,errors=remount-ro
        gateway   = 192.168.100.1
        netmask   = 255.255.255.0
        broadcast = 192.168.100.255
        passwd = 1

2) Generate the image by using the following command.

xen-create-image --hostname=vm1.ve --ip=192.168.100.80 --arch=amd64 --role=udev


NOTE: The last script does not take on count some details, is necessary to fix them

3) Edit the /etc/xen/vm1.cfg file and modify the following lines for looking like this

File: /etc/xen/vm1.ve.cfg
        root = '/dev/sda2 ro console=/dev/hvc0'
        vif  = [ 'bridge=eth0' ]

4) Mount the image

mount -o loop /home/xen/domains/vm1.ve/disk.img /mnt


5) Edit the file /mnt/etc/inittab and change the line

File: /mnt/etc/inittab
        1:2345:respawn:/sbin/getty 38400 tty1

For it to look like this

File: /mnt/etc/inittab
        1:2345:respawn:/sbin/getty 38400 hvc0

6) Edit the /mnt/etc/securetty file and add to the end of the line

File: /mnt/etc/securetty
        hvc0

7) For booting the virtual machine run the following command:

xm create -c /etc/xen/vm1.platino.gov.ve.cfg