Difference between revisions of "Creating Virtual Machines on Debian"

From Supercomputación y Cálculo Científico UIS
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>
+
Back to [[Xen on Debian]]
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[Xen on Debian]]</div></p>
+
=== Creating Virtual Machines on Debian ===
 
 
<div class="col-md-14">
 
    <div class="panel panel-darker-white-border">
 
        <div class="panel-heading">
 
            <h3 class="panel-title">LDAP </h3>
 
        </div>
 
        <div class="panel-body">
 
            <p>
 
 
 
            </p>
 
        </div>
 
    </div>
 
</div>
 
 
 
 
 
= Creating Images =
 
  
 
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:

Latest revision as of 21:25, 21 June 2016


Back to Xen on Debian

Creating Virtual Machines on Debian

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

And make 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