VIRTUALISASI XEN

Jumat, 07 Agustus 2009 · Posted in

setting mirror di : deb http://kambing.ui.ac.id/debian/ lenny main contrib non-free
deb-src http://kambing.ui.ac.id/debian/ lenny main contrib non-free

apt-get update
apt-get upgrade
apt-cache search headers | grep linux
apt-get install linux-headers-2.6.26-xen-686
apt-cache search headers | grep linux
apt-get install linux-modules-2.6.26-xen-686
apt-cache search image | grep linux
apt-get install linux-image-2.6.26.2-xen-686
apt-cache search utils | grep xen
apt-get install xen-utils-3.2-1
apt-cache search tools | grep xen
apt-get install xen-tools
apt-get install xen-utils-common
apt-get install sysfsutils
apt-cache search xen | grep libc6
apt-get install libc6-xen
apt-get install xen-linux-system-2.6.26-2-xen-686
apt-get install xen-hypervisor-3.2-1-i386
apt-get install xen-hypervisor-3.2-1-686 xen-linux-system-2.6.26-2-xen-686 xen-utils-3.2-1 xenstore-utils xenwatch xen-shell xen-tools
vi /etc/modules
-------> ditulis " loop max_loop=64 "
vim /etc/xen/xend-config.sxp
-----> diubah
####################################################################
[...]
(network-script network-bridge)
[...]
#(network-script network-dummy)
[...]
(vif-script vif-bridge)
[...]
####################################################################

vim /etc/xen-tools/xen-tools.conf
-----> diubah

####################################################################

##
# /etc/xen-tools/xen-tools.conf
##
#
# This is the global configuration file for the scripts included
# within the xen-tools package.
#
# For more details please see:
#
# http://xen-tools.org/
#
##


##
#
# File Format
# -----------
#
# Anything following a '#' character is ignored as a comment.
#
# Otherwise the format of this file "key = value". The value of
# any keys in this file may be constructed via the output of a command.
#
# For example:
#
# kernel = /boot/vmlinuz-`uname -r`
#
##



#
##
# Output directory for storing loopback images.
#
# If you choose to use loopback images, which are simple to manage but
# slower than LVM partitions, then specify a directory here and uncomment
# the line.
#
# New instances will be stored in subdirectories named after their
# hostnames.
#
##
dir = /home/xen3
#

#
##
#
# If you don't wish to use loopback images then you may specify an
# LVM volume group here instead
#
##
# lvm = skx-vg


#
##
#
# Installation method.
#
# There are four distinct methods which you may to install a new copy
# of Linux to use in your Xen guest domain:
#
# - Installation via the debootstrap command.
# - Installation via the rpmstrap command.
# - Installation via the rinse command.
# - Installation by copying a directory containing a previous installation.
# - Installation by untarring a previously archived image.
#
# NOTE That if you use the "untar", or "copy" options you should ensure
# that the image you're left with matches the 'dist' setting later in
# this file.
#
#
##
#
#
# install-method = [ debootstrap | rinse | rpmstrap | copy | tar ]
#
#
install-method = debootstrap

#
# If you're using the "copy", or "tar" installation methods you must
# need to specify the source location to copy from, or the source
# .tar file to unpack.
#
# You may specify that with a line such as:
#
# install-source = /path/to/copy
# install-source = /some/path/img.tar
#
#

#
##
# Command definitions.
##
#
# The "rinse", and "rpmstrap" commands are hardwired into
# the script, but if you wish to modify the commands which are executed
# when installing new systems by a "copy", "debootstrap", or "tar" method
# you can do so here:
#
# (This allows you to install from a .tar.bz file, rather than a plain
# tar file, use cdebootstrap, etc.)
#
# install-method=copy:
# copy-cmd = /bin/cp -a $src/* $dest
#
# install-method=debootstrap:
# debootstrap-cmd=/usr/sbin/debootstrap
#
# install-method=tar:
# tar-cmd = /bin/tar --numeric-owner -xvf $src
#
#



#
##
# Disk and Sizing options.
##
#
size = 4Gb # Disk image size.
memory = 128Mb # Memory size
swap = 128Mb # Swap size
# noswap = 1 # Don't use swap at all for the new system.
fs = ext3 # use the EXT3 filesystem for the disk image.
dist = lenny # Default distribution to install.
image = sparse # Specify sparse vs. full disk images.

#
# Currently supported and tested distributions include:
#
# via Debootstrap:
#
# Debian:
# sid, sarge, etch, lenny.
#
# Ubuntu:
# edgy, feisty, dapper.
#
# via Rinse:
# centos-4, centos-5.
# fedora-core-4, fedora-core-5, fedora-core-6, fedora-core-7
#
#



##
# Networking setup values.
##

#
# Uncomment and adjust these network settings if you wish to give your
# new instances static IP addresses.
#
gateway = 192.168.1.1
netmask = 255.255.255.0
broadcast = 192.168.1.255
#
# Uncomment this if you wish the images to use DHCP
#
# dhcp = 1


##
# Misc options
##

#
# Uncomment the following line if you wish to disable the caching
# of downloaded .deb files when using debootstrap to install images.
#
# cache = no
#

#
# Uncomment the following line if you wish to interactively setup
# a new root password for images.
#
passwd = 1

#
# If you'd like all accounts on your host system which are not present
# on the guest system to be copied over then uncomment the following line.
#
# accounts = 1
#

#
# Default kernel and ramdisk to use for the virtual servers
#
kernel = /boot/vmlinuz-`uname -r`
initrd = /boot/initrd.img-`uname -r`

#
# The architecture to use when using debootstrap, rinse, or rpmstrap.
#
# This is most useful on 64 bit host machines, for other systems it
# doesn't need to be used.
#
# arch=[i386|amd64]
#

#
# The default mirror for debootstrap to install Debian-derived distributions
#
#mirror = http://kambing.ui.edu/debian/

#
# A mirror suitable for use when installing the Dapper release of Ubuntu.
#
# mirror = http://gb.archive.ubuntu.com/ubuntu/
mirror=file:///cdrom/debian

#http://kambing.ui.edu/debian

#
# If you like you could use per-distribution mirrors, which will
# be more useful if you're working in an environment where you want
# to regularly use multiple distributions:
#
# mirror_sid=http://ftp.us.debian.org/debian
# mirror_sarge=http://ftp.us.debian.org/debian
# mirror_etch=http://ftp.us.debian.org/debian
# mirror_dapper=http://archive.ubuntu.com/ubuntu
# mirror_edgy=http://archive.ubuntu.com/ubuntu
# mirror_feisty=http://archive.ubuntu.com/ubuntu
# mirror_gutsy=http://archive.ubuntu.com/ubuntu


#
# Filesystem options for the different filesystems we support.
#
ext3_options = noatime,nodiratime,errors=remount-ro
ext2_options = noatime,nodiratime,errors=remount-ro
xfs_options = defaults
reiser_options = defaults

#
# Uncomment if you wish newly created images to boot once they've been
# created.
#
# boot = 1


#
# If you're using the lenny or later version of the Xen guest kernel you will
# need to make sure that you use 'hvc0' for the guest serial device,
# and 'xvdX' instead of 'sdX' for serial devices.
#
# You may specify the things to use here:
#
serial_device = hvc0 #default
# serial_device = tty1
#
disk_device = xvda #default
# disk_device = sda
#


#
# Here we specify the output directory which the Xen configuration
# files will be written to, and the suffix to give them.
#
# Historically xen-tools have created configuration files in /etc/xen,
# and given each file the name $hostname.cfg. If you want to change
# that behaviour you may do so here.
#
#
# output = /etc/xen
# extension = .cfg
#
####################################################################

vim /boot/grub/menu.lst
-------------> diubah
####################################################################
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-legacy-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/sda9 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,8)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(single-user mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Xen 3.2-1-i386 / Debian GNU/Linux, kernel 2.6.26-2-xen-686
root (hd0,8)
kernel /boot/xen-3.2-1-i386.gz nolapic acpi=off noapic dom0_mem=262144
module /boot/vmlinuz-2.6.26-2-xen-686 root=/dev/sda9 ro console=tty0 console=hvm0 3
module /boot/initrd.img-2.6.26-2-xen-686

title Debian GNU/Linux, kernel 2.6.26-2-xen-686
root (hd0,8)
kernel /boot/vmlinuz-2.6.26-2-xen-686 root=/dev/sda9 ro quiet
initrd /boot/initrd.img-2.6.26-2-xen-686

title Debian GNU/Linux, kernel 2.6.26-2-xen-686 (single-user mode)
root (hd0,8)
kernel /boot/vmlinuz-2.6.26-2-xen-686 root=/dev/sda9 ro single
initrd /boot/initrd.img-2.6.26-2-xen-686

title Debian GNU/Linux, kernel 2.6.26-1-686
root (hd0,8)
kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sda9 ro quiet
initrd /boot/initrd.img-2.6.26-1-686

title Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root (hd0,8)
kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sda9 ro single
initrd /boot/initrd.img-2.6.26-1-686

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda6
title Microsoft Windows XP Professional
root (hd0,5)
savedefault
makeactive
chainloader +1

####################################################################
reboot

masuk ke kernel xen kemudian create image <>

kita buat direktori untuk xen
mkdir /home/xen

xen-create-image --hostname=xen1.example.com --arch=i386 --ip=10.11.111.16 --role=udev --force --ide

xm create /etc/xen/xen1.example.com

xm console xen1.example.com


Untuk mematikan
xm shutdown xen1.example.com

NB : jika menggunakan mirror cdrom jangan lupa mount dulu cdromnya..

#cat /proc/partition
#/dev/sda/ /media/
atau
#mount /media/cdrom

Leave a Reply

Diberdayakan oleh Blogger.