Go Back   Linux CentOS, Control Panel, Hot girl, TOP 10 GOOGLE, Server - System - Manager - CentOS, Operation System, SEO, VBB, HACKING and SECURITY - Rao vặt, tuyển dụng, Thiet ke website > CentOS Việt Nam - Viet Nam Linux CentOS Community > Cài đặt CentOS và ứng dụng > Virtual Server

Hack gunz.2it.in mới update ngày 2/3/2010 (test by Admin)
Hack map trong Dota - WarCraft 3 (da test ngay 27/01/2010)
Hack gg để chơi map dota cho war 1.23 va 1.24 - vẫn xài tốt
Hướng dẫn Hack gold member tại quán net để mang về nhà
hack map dota cho war3 ver 1.24c va 1.24d, co the chuyen tien
crack windows 7 all version (using activators)
hack cf 1052, hack cf 1053, hack cf 1054 ngay 15/02/2010

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-12-2009
Hackingart Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Paravirtualization With Xen On CentOS 5.4 (x86_64)

This tutorial provides step-by-step instructions on how to install Xen (version 3.0.3) on a CentOS 5.4 (x86_64) system.
Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called "virtual machines" or domUs, under a host operating system (dom0). Using Xen you can separate your applications into different virtual machines that are totally independent from each other (e.g. a virtual machine for a mail server, a virtual machine for a high-traffic web site, another virtual machine that serves your customers' web sites, a virtual machine for DNS, etc.), but still use the same hardware. This saves money, and what is even more important, it's more secure. If the virtual machine of your DNS server gets hacked, it has no effect on your other virtual machines. Plus, you can move virtual machines from one Xen server to the next one.
I will use CentOS 5.4 (x86_64) for both the host OS (dom0) and the guest OS (domU).
This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.
This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

1 Preliminary Note

This guide will explain how to set up image-based virtual machines and also LVM-based virtual machines.
Make sure that SELinux is disabled or permissive:


Quote:
vi /etc/sysconfig/selinux
Quote:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
If you had to modify /etc/sysconfig/selinux, please reboot the system:
Quote:
reboot



2 Installing Xen

To install Xen, we simply run
Quote:
yum install kernel-xen xen

his installs Xen and a Xen kernel on our CentOS system.
Before we can boot the system with the Xen kernel, please check your GRUB bootloader configuration. We open /boot/grub/menu.lst:


Quote:
vi /boot/grub/menu.lst

The first listed kernel should be the Xen kernel that you've just installed:

Quote:
[...]
title CentOS (2.6.18-164.6.1.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-164.6.1.el5
module /vmlinuz-2.6.18-164.6.1.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.18-164.6.1.el5xen.img
[...]
Change the value of default to 0 (so that the first kernel (the Xen kernel) will be booted by default):
Quote:
[...]
default=0
[...]
The complete /boot/grub/menu.lst should look something like this:

Quote:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.6.1.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-164.6.1.el5
module /vmlinuz-2.6.18-164.6.1.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.18-164.6.1.el5xen.img
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-164.el5.img
Afterwards, we reboot the system:
Quote:
reboot

The system should now automatically boot the new Xen kernel. After the system has booted, we can check that by running
Quote:
uname -r
Quote:
[root@server1 ~]# uname -r
2.6.18-164.6.1.el5xen
[root@server1 ~]#
So it's really using the new Xen kernel!
We can now run
Quote:
xm list
to check if Xen has started. It should list Domain-0 (dom0):
Quote:
[root@server1 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 3363 2 r----- 78.6
[root@server1 ~]#

(continue)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 25-12-2009
Hackingart Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default 3 Creating An Image-Based Virtual Machine

3 Creating An Image-Based Virtual Machine


I want to store the disk images of my image-based virtual machines in the directory /vm. Of course, you can use any other directory that has enough space left. If you use another directory, replace /vm with your own directory in this tutorial.
If you want to save your virtual machines in /vm, too, but haven't created a partition for it or if the directory /vm doesn't exist on your system, you can create it like this:
mkdir /vm
CentOS comes with a nice tool called virt-install with which we can create virtual machines for Xen. To start it, we simply run
virt-install
The tools asks a few questions before it creates a virtual machine. I want to call my first virtual machine vm01, with 256MB RAM and a disk size of 4GB. I want to store it in the file /vm/vm01.img:
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. <-- no
What is the name of your virtual machine? <-- vm01
How much RAM should be allocated (in megabytes)? <-- 256
What would you like to use as the disk (file path)? <-- /vm/vm01.img
How large would you like the disk (/vm/vm01.img) to be (in gigabytes)? <-- 4
Would you like to enable graphics support? (yes or no) <-- no
What is the virtual CD image, CD device or install location? <-- TU Chemnitz: URZ: Netzdienste: FTP-Archiv ftp.tu-chemnitz.de:
You should answer the first question about the fully virtualized guest with no because otherwise you will not see the CentOS installer - the installation of the guest system will seem to hang.
The question about the graphics support refers to the installer, not the virtual machine itself! It is possible to start a graphical installer, but you'd have to connect to it via VNC. It's easier to use the text installer - it offers the same options, so I choose the text installer.
As install location, you should specify your CD/DVD drive (/dev/cdrom) or a mirror close to you where the installer can download all files needed for the installation of CentOS 5.4 in our virtual machine. You can find a list of CentOS mirrors here: www.centos.org - centos.org content
After we have answered all questions, virt-install starts the normal CentOS 5.4 installer (in text mode) in our vm01 virtual machine. You already know the CentOS installer, so it should be no problem for you to finish the CentOS installation in vm01.
After the installation, we stay at the vm01 console. To leave it, type CTRL+] if you are at the console, or CTRL+5 if you're using PuTTY. You will then be back at the dom0 console.
virt-install has created the vm01 configuration file /etc/xen/vm01 for us (in dom0). It should look like this:
cat /etc/xen/vm01
name = "vm01"
uuid = "986d8b21-906f-8d64-bdc4-a6098e75cf23"
maxmem = 256
memory = 256
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ ]
disk = [ "tap:aio:/vm/vm01.img,xvda,w" ]
vif = [ "mac=00:16:3e:08:fc:38,bridge=xenbr0" ] Run


xm console vm01
to log in on that virtual machine again (type CTRL+] if you are at the console, or CTRL+5 if you're using PuTTY to go back to dom0), or use an SSH client to connect to it.
To get a list of running virtual machines, type
xm list
The output should look like this:
[root@server1 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 3102 2 r----- 78.6
vm01 1 255 1 -b---- 237.6
[root@server1 ~]#
To shut down vm01, do this:
xm shutdown vm01
To start vm01 again, run
xm create /etc/xen/vm01
If you want vm01 to start automatically at the next boot of the system, then do this:
ln -s /etc/xen/vm01 /etc/xen/auto
Here are the most important Xen commands:
xm create -c /path/to/config - Start a virtual machine.
xm shutdown <name> - Stop a virtual machine.
xm destroy <name> - Stop a virtual machine immediately without shutting it down. It's as if you switch off the power button.
xm list - List all running systems.
xm console <name> - Log in on a virtual machine.
xm help - List of all commands.

4 Creating An LVM-Based Virtual Machine

This chapter explains how you can set up LVM-based virtual machines instead of virtual machines that use disk images. Virtual machines that use disk images are very slow and heavy on disk IO.
In this example I'm using a CentOS 5.4 host with the LVM volume group /dev/VolGroup00 that has about 150GB of space. /dev/VolGroup00 contains two logical volumes, /dev/VolGroup00/LogVol00 and /dev/VolGroup00/LogVol01 that consume about 60GB of space - the rest is not allocated and can be used to create logical volumes for our virtual machines:
vgdisplay
[root@server1 ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 14
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 148.53 GB
PE Size 32.00 MB
Total PE 4753
Alloc PE / Size 1906 / 59.56 GB
Free PE / Size 2847 / 88.97 GB
VG UUID 5faE1k-DkMu-JUEk-K0JV-B9ta-Nyaf-n7tngf

[root@server1 ~]#
lvdisplay
[root@server1 ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID xA3e1Z-mEc9-rGT1-WcAu-TjF4-lbf3-6LvFaj
LV Write Access read/write
LV Status available
# open 1
LV Size 992.00 MB
Current LE 31
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID mUt9QZ-dluZ-a1ud-5RA7-gkVA-6Z0b-w0pvIa
LV Write Access read/write
LV Status available
# open 1
LV Size 58.59 GB
Current LE 1875
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

[root@server1 ~]#
I want to create the virtual machine vm02 now which uses the logical volume /dev/VolGroup00/vm02. I want the virtual machine to have a disk space of 10GB, so I create the logical volume /dev/VolGroup00/vm02 as follows:
lvcreate -L10G -n vm02 VolGroup00
Afterwards we can run
virt-install
again:
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. <-- no
What is the name of your virtual machine? <-- vm02
How much RAM should be allocated (in megabytes)? <-- 256
What would you like to use as the disk (file path)? <-- /dev/VolGroup00/vm02
Would you like to enable graphics support? (yes or no) <-- no
What is the install location? <-- TU Chemnitz: URZ: Netzdienste: FTP-Archiv ftp.tu-chemnitz.de:
As the disk file path, we specify our new volume group /dev/VolGroup00/vm02. Please note that virt-install doesn't ask for the disk space anymore because the disk space is determined by the size of the logical volume (10GB).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +8. The time now is 10:14 PM.


© Diễn đàn HackingArt (HA) được xây dựng và phát triển bởi các thành viên.
+ Diễn đàn HackingArt là nơi trao đổi của các webmaster chuyên nghiệp.