Friday, November 29, 2013

Installing And Using OpenVZ On CentOS 5.7

In this HowTo I will describe how to prepare a CentOS 5.7 server for OpenVZ. With OpenVZ you can create multiple Virtual Private Servers (VPS) on the same hardware, similar to Xen and the Linux Vserver project. OpenVZ is the open-source branch of Virtuozzo, a commercial virtualization solution used by many providers that offer virtual servers. The OpenVZ kernel patch is licensed under the GPL license, and the user-level tools are under the QPL license.

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 Installing OpenVZ

In order to install OpenVZ, we need to add the OpenVZ repository to yum:
cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
 
Now open openvz.repo...
vi openvz.repo
... and disable the [openvz-kernel-rhel6] repository (enabled=0) and enable the [openvz-kernel-rhel5] repository instead (enabled=1):


[...]
# Stable branches

[openvz-kernel-rhel6]
name=OpenVZ RHEL6-based kernel
#baseurl=http://download.openvz.org/kernel/branches/rhel6-2.6.32/current/
mirrorlist=http://download.openvz.org/kernel/mirrors-rhel6-2.6.32
enabled=0
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ

[openvz-kernel-rhel5]
name=OpenVZ RHEL5-based kernel
#baseurl=http://download.openvz.org/kernel/branches/rhel5-2.6.18/current/
mirrorlist=http://download.openvz.org/kernel/mirrors-rhel5-2.6.18
enabled=1
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ

[openvz-kernel-rhel4]
name=OpenVZ RHEL4-based kernel
#baseurl=http://download.openvz.org/kernel/branches/rhel4-2.6.9/current/
mirrorlist=http://download.openvz.org/kernel/mirrors-rhel4-2.6.9
enabled=0
gpgcheck=1
gpgkey=http://download.openvz.org/RPM-GPG-Key-OpenVZ
[...] 
The repository contains a few different OpenVZ kernels (you can find more details about them here: http://wiki.openvz.org/Kernel_flavors). The command :
yum search ovzkernel

shows you the available kernels:
[root@server1 yum.repos.d]# yum search vzkernel
...
ovzkernel.i686 : Virtuozzo Linux kernel (the core of the Linux operating system)
ovzkernel.x86_64 : Virtuozzo Linux kernel (the core of the Linux operating system)
ovzkernel-PAE.i686 : The Linux kernel compiled for PAE capable machines.
ovzkernel-PAE-devel.i686 : Development package for building kernel modules to match the PAE kernel.
ovzkernel-devel.i686 : Development package for building kernel modules to match the kernel.
ovzkernel-devel.x86_64 : Development package for building kernel modules to match the kernel.
ovzkernel-ent.i686 : The Linux kernel compiled for huge mem capable machines.
ovzkernel-ent-devel.i686 : Development package for building kernel modules to match the ent kernel.
ovzkernel-xen.i686 : The Linux kernel compiled for Xen VM operations
ovzkernel-xen.x86_64 : The Linux kernel compiled for Xen VM operations
ovzkernel-xen-devel.i686 : Development package for building kernel modules to match the kernel.
ovzkernel-xen-devel.x86_64 : Development package for building kernel modules to match the kernel.
[root@server1 yum.repos.d]#

Pick one of them and install it as follows:
yum install ovzkernel

If the last command gives you errors like...
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol strcpy
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol add_memory
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol swiotlb
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol memory_add_physaddr_to_nid
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol remove_memory
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol strcmp
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/acpi/acpi_memhotplug.ko needs unknown symbol acpi_get_node
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/amd64_edac_mod.ko needs unknown symbol amd_unregister_ecc_decoder
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/amd64_edac_mod.ko needs unknown symbol amd_register_ecc_decoder
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/amd64_edac_mod.ko needs unknown symbol amd_report_gart_errors
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/amd64_edac_mod.ko needs unknown symbol amd_decode_nb_mce
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/cpufreq/freq_table.ko needs unknown symbol strcpy
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/cpufreq/freq_table.ko needs unknown symbol _cpu_pda
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/i7core_edac.ko needs unknown symbol edac_mce_register
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/i7core_edac.ko needs unknown symbol edac_mce_unregister
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/edac/i7core_edac.ko needs unknown symbol __memcpy
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol dma_ops
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol copy_from_user
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol bad_dma_address
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol find_first_bit
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol strcat
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol mem_section
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol copy_to_user
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol strncpy
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol __memcpy
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol strcmp
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/infiniband/hw/ipath/ib_ipath.ko needs unknown symbol alloc_pages_current
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/kernel/microcode.ko needs unknown symbol copy_from_user
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol cpu_to_node
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol copy_from_user
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol copy_user_generic
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol profile_pc
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol copy_to_user
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/oprofile/oprofile.ko needs unknown symbol strcmp
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/kernel/cpufreq/powernow-k8.ko needs unknown symbol strncmp
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/arch/x86_64/kernel/cpufreq/powernow-k8.ko needs unknown symbol _cpu_pda
WARNING: /lib/modules/2.6.18-274.el5.028stab093.2/kernel/drivers/pci/hotplug/shpchp.ko needs unknown symbol strcpy

... please remove ovzkernel...
yum remove ovzkernel 

... and install the ovzkernel package for your architecture:
On x86_64 systems:
yum install ovzkernel.x86_64 

On i686 systems:
yum install ovzkernel.i686 

This should automatically update the GRUB bootloader as well. Anyway, we should open /boot/grub/menu.lst; the first kernel stanza should now contain the new OpenVZ kernel. Make sure that the value of default is 0 so that the first kernel (the OpenVZ kernel) is booted automatically instead of the default CentOS kernel.
vi /boot/grub/menu.lst

# 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 OpenVZ (2.6.18-274.el5.028stab093.2)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-274.el5.028stab093.2 ro root=/dev/VolGroup00/LogVol00 selinux=0
        initrd /initrd-2.6.18-274.el5.028stab093.2.img
title CentOS (2.6.18-274.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-274.el5.img
Now we install some OpenVZ user tools:
yum install vzctl vzquota

Open /etc/sysctl.conf and make sure that you have the following settings in it:
vi /etc/sysctl.conf
[...]
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
[...]
If you need to modify /etc/sysctl.conf, run
sysctl -p
afterwards.

The following step is important if the IP addresses of your virtual machines are from a different subnet than the host system's IP address. If you don't do this, networking will not work in the virtual machines!

Open /etc/vz/vz.conf and set NEIGHBOUR_DEVS to all:
vi /etc/vz/vz.conf
[...]
NEIGHBOUR_DEVS=all
[...]
SELinux needs to be disabled if you want to use OpenVZ. Open /etc/sysconfig/selinux and set the value of SELINUX to disabled:
vi /etc/sysconfig/selinux
# 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
Finally, reboot the system:
reboot

If your system reboots without problems, then everything is fine!
Run
uname -r

and your new OpenVZ kernel should show up:
[root@server1 ~]# uname -r
2.6.18-274.el5.028stab093.2
[root@server1 ~]#

2 Using OpenVZ

Before we can create virtual machines with OpenVZ, we need to have a template for the distribution that we want to use in the virtual machines in the /vz/template/cache directory. The virtual machines will be created from that template. You can find a list of precreated templates on http://wiki.openvz.org/Download/template/precreated.
I want to use CentOS 5 in my virtual machines, so I download a CentOS 5 template:
cd /vz/template/cache
wget http://download.openvz.org/template/precreated/centos-5-x86.tar.gz

I will now show you the basic commands for using OpenVZ.
To set up a VPS from the default CentOS 5 template, run:
vzctl create 101 --ostemplate centos-5-x86 --config basic

The 101 must be a uniqe ID - each virtual machine must have its own unique ID. You can use the last part of the virtual machine's IP address for it. For example, if the virtual machine's IP address is 192.168.0.101, you use 101 as the ID.
If you want to have the vm started at boot, run
vzctl set 101 --onboot yes --save

To set a hostname and IP address for the vm, run:
vzctl set 101 --hostname test.example.com --save
vzctl set 101 --ipadd 192.168.0.101 --save

Next we set the number of sockets to 120 and assign a few nameservers to the vm:
vzctl set 101 --numothersock 120 --save
vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --nameserver 145.253.2.75 --save

(Instead of using the vzctl set commands, you can as well directly edit the vm's configuration file which is stored in the /etc/vz/conf directory. If the ID of the vm is 101, then the configuration file is /etc/vz/conf/101.conf.)

To start the vm, run
vzctl start 101

To set a root password for the vm, execute
vzctl exec 101 passwd

You can now either connect to the vm via SSH (e.g. with PuTTY), or you enter it as follows:
vzctl enter 101

To leave the vm's console, type
exit

To stop a vm, run
vzctl stop 101

To restart a vm, run
vzctl restart 101

To delete a vm from the hard drive (it must be stopped before you can do this), run
vzctl destroy 101

To get a list of your vms and their statuses, run
vzlist -a


To find out about the resources allocated to a vm, run
vzctl exec 101 cat /proc/user_beancounters 

The failcnt column is very important, it should contain only zeros; if it doesn't, this means that the vm needs more resources than are currently allocated to the vm. Open the vm's configuration file in /etc/vz/conf and raise the appropriate resource, then restart the vm.
To find out more about the vzctl command, run
man vzctl 

Source : http://www.howtoforge.com/installing-and-using-openvz-on-centos-5.7-p2

Tuesday, November 26, 2013

How to install and configure smokeping on CentOS 6 or CentOS 5?

Smokeping is a very useful network monitoring tool but it’s also very complicated to install and configure.
Here are the steps for installing smokeping on CentOS 6 or CentOS 5.
To make it easier to deploy we recommend to temporarily disable selinux with this command:
setenforce 0

1 – Install rpmforge
# yum install wget
* For CentOS 6 please use this repository:
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
* For CentOS 5 please use this repository:
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

2 – Install required packages
# yum install mod_fcgid httpd httpd-devel rrdtool fping wget curl bind-utils gcc make

3 – Install more packages
# yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-RRD-Simple perl-CGI-SpeedCGI perl-ExtUtils-MakeMaker

4 – Install smokeping
# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
* You should check on smokeping website for the latest version.
# tar -zxvf smokeping-2.6.8.tar.gz -C /opt/
# mkdir /opt/smokeping
# cd /opt/smokeping-2.6.8/setup
# ./build-perl-modules.sh
# cp -r ../thirdparty /opt/smokeping/
# cd ..
# ./configure –prefix=/opt/smokeping
* There are twice – before the prefix so it is –prefix. # make install

5 – Create missing folders
# cd /opt/smokeping
# mkdir data var cache

6 – Add smokeping start/stop script
# wget http://new.wedebugyou.com/static/smokeping_start_stop.txt
# mv smokeping_start_stop.txt /etc/init.d/smokeping
# chmod 755 /etc/init.d/smokeping

Here are the steps for configuring smokeping.

1 – Rename config files and change security
# cd /opt/smokeping/etc/
# for foo in *.dist; do cp $foo `basename $foo .dist`; done
# chmod 600 /opt/smokeping/etc/smokeping_secrets.dist

2 – Change the default config files
# vi config
Change the values in bold to something that fit your needs.
owner    = Peter Random
contact  = some@address.nowhere
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is not
# good for images.
imgcache = /opt/smokeping/cache
imgurl   = cache
datadir  = /opt/smokeping/data
piddir  = /opt/smokeping/var
cgiurl   = http://some.url/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail.dist
tmail = /opt/smokeping/etc/tmail.dist

Here is an example:
owner    = Jean Debogue
contact  = noc@jeandebogue.com
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is not
# good for images.
imgcache = /opt/smokeping/cache
imgurl   = cache
datadir  = /opt/smokeping/data
piddir  = /opt/smokeping/var
cgiurl   = http://graph.mydomain.com/smokeping/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail.dist
tmail = /opt/smokeping/etc/tmail.dist

3 – Configure smokeping into the webserver
# cd /opt/smokeping
# ln -s /opt/smokeping/cache /opt/smokeping/htdocs/cache
# chown -R apache cache
# chown -R apache data
Add these lines into the file /etc/httpd/conf.d/smokeping.conf
ScriptAlias /smokeping/smokeping.cgi /opt/smokeping/htdocs/smokeping.fcgi.dist
Alias /smokeping /opt/smokeping/htdocs
<Directory “/opt/smokeping/htdocs”>
Options FollowSymLinks
</Directory>

4 – Start smokeping
# /etc/init.d/smokeping start
# /etc/init.d/httpd start

 5 – Expect the worst hope for the best
If there are no error message you are in a very good position. You can now browse to the webpage you configure in the config file cgiurl = http://graph.mydomain.com/smokeping/smokeping.cgi.
1 – Add your own host in the config file
It’s quite complicated to explain all the details of smokeping configuration file. The best is to read their documentation or check the many examples available online. You can also use our example config file. Just paste this file under the line *** Probes *** in your config file. Our example contains an icmp probe, a dns check, a check on port 80 and a full fetch of the default webpage of www.google.com.

2 – Restart smokeping
After changing the config file, it is important to restart smokeping with this command:
# /etc/init.d/smokeping restart

3 – Clean installation files
# rm -rf /opt/smokeping-2.6.8

4 – Enable smokeping to start automatically on reboot
# chkconfig –add smokeping
* There are twice – before the add so it is –add.
# chkconfig httpd on
# chkconfig smokeping on
smokeping graph
You can now also use smokeping. Do you also use smokeping? Do you monitor routers, servers, websites? Do you use it into a master/slave mode? We would like to hear from you how you use smokeping in your day to day life.

Source :  http://www.wedebugyou.com/2012/11/how-to-install-and-configure-smokeping-on-centos-6/

Httpd.conf | RewriteEngine

<Directory "/var/www/html/lg">
                Options +Indexes FollowSymLinks +ExecCGI
                AllowOverride AuthConfig FileInfo
                Order deny,allow
#               Deny from all
#               Allow from 202.65.113.0/24 202.65.112.0/24
                Allow from all
</Directory>

<VirtualHost 202.65.114.204:80>
                Options FollowSymLinks
                ServerAdmin support@jogja.citra.net.id
                DocumentRoot /var/www/html/lg
                ServerName lg.jogja.citra.net.id
                        RewriteEngine On
                        RewriteCond %{REMOTE_ADDR} ^202\.65\.11[2-3]\.
                        RewriteRule ^(/|/lg2)$ /lg [R]
                        RewriteCond %{REMOTE_ADDR} !^202\.65\.11[2-3]\.
                        RewriteRule ^(/|/lg)$ /lg2 [R]
</VirtualHost>

Alias /lg/favicon.ico "/var/www/html/lg/favicon.ico"
ScriptAlias /lg "/var/www/html/lg/lg.cgi"
ScriptAlias /lg2 "/var/www/html/lg2/lg.cgi"

Monday, November 18, 2013

CARA MENGATASI GUITAR RIG TIDAK BERSUARA

Tentang postingan kali ini,…mungkin udah banyak diantara temen temen yang tau ya,….n mungkin juga ini bukan masalah yang baru,…tentang apa,….???????….tentang guitar rig yang nggak bersuara
lah kalo udah banyak yang tau,..kenapa di posting lagi,…hehehe,…ternyata temen temen ane disini juga banyak yang masih beloom tau,…jadi nya ane mau share lagi di sini.
kali ini ane akan share tentang cara ngatasin guitar rig yang nggak ngeluarin suara.tapi sebelumnya,…di sini ane bukan bermaksud untuk menggurui ato sok ngajarin ya,…tapi ane cuman mau berbagi pengalaman ama temen temen yang mungkin kebetulan ngebaca postingan ane yang berantakann ini,…hehehehe,…
kembali kepokok bahasan,kenapa guitar rig nggak ngluarin suara,….mungkin itu terjadi karena beberapa hal,…n di bawah ini beberapa cara yang bisa temen temen lakukan untuk mengatasi maslah tersebut.
CEK GITAR
sbelum temen temen melakukan settingan pada sound di komputer,…..sebaiknya temen temen pastiin dulu kalo gitar beserta jack n perangkat lainnya dalam keadaan baik,..coba di periksa dulu siapa tau jacknya yang putus,…..
cara memeriksanya,….mungkin bisa menggunakan tester,atau temn temen bisa mencobanya di speaker lain dulu,…
kalo ternyata nggak ada masalah pada gitar ato jack nya,….mari kita coba untuk melakukan sedikit pengaturan pada komputer,…..
SETTING KOMPUTER
sbelumnnya,..pastiin dulu kalo komputer temen temen nggak dalam keadaan mute,….karena kalo dalam keadaan mute,,……sama aja boong,….
kalo komputernya nggak dalam keadaan mute,…n guitar rignya masih nggak bersuara,….coba lakukan langkah langkah brikut.
ane harapkan disini,….temen temen udah install guitar rig serta asio4all nya,…..klao belum punya ,..silahkan kesini,…..
- tutup guitar rig,n cabut gitar dari komputer.
- colokkan lagi guitarnya.( guitar rig nya jangan di jalankan dulu )
- klik start>ketik realtek>pilih realtek HD audio manager.
Gambar
- klik device advance setting.
Gambar
- klik sparate all input jacks,..bla bla bla,….( lihat gambar )
Gambar
- dengan memilih opsi ini,…biasanya akan muncul device baru dengan nama mic in at front panel ( black )
- klik ok.
langkah brikutnya,…….
- klik start> tulis sound> pilih sound.
Gambar
- kli pada tab recording.
Gambar
- disable semua device yang ada disana kecuali device yang baru muncul tadi ( mic in at ……….)
Gambar
- klik aply> ok.
sekarang,….sebelum temen temen menjalankan guitar rignya,……coba cek asionya terlebih dahulu.ini bertujuan supaya nggak ada program laen yang make soun device kita.
- dowble klik pada icon asio.
- lihat,ada device yang di silang ato nggak.
- kalo ada,berarti ada program laen yang make sound device temen temen,(kaya winamp,aimp,wmp,dll)
- cek n tutup program tsb terlebih dahulu.
Gambar
kalo udah nggak ada program laen yang menggunakan sound device,…..coba jalankan lagi guitar rignya,…jangan buru buru,…hehehe,…coba ikuti lagkah langkah berikut.
- cabut dulu gitarnya dari laptop / komputer.
- jalankn guitar rig.
- baru colokkkan lagi guitarnya,…
gimana,…udah ada suarannya apa beloom,….
emang agak susah sih,….tapi dari hasil pengalaman ane ,….setelah menempuh beberapa cara diatas,..ini sangat berhasil untuk mengatasi guitar rig yang nggak bersuara,….tapi walaupun pada judul postingan ini sekias di tujukan untuk guitar rig,….cara ini kayanya juga berlaku untuk temen temen yang menggunakan overloud,ato amplitube.
tapi kalo ternyata cara cara diatas masih belum berhasil,…..mungkin noise nya yang terlalu tinggi,..klik disiniuntuk cara mengurangi noise pada guitar rig.
ughh,…akhirnya,…selesai juga,….kalo masih ada dian tara temen temen yang kurang jelas,atau kurang mmahami bahasa ane yang berantakan ini….silahkan berkomentar,…n tentu nantinya ane akan membantu semampu ane,…
sekian dulu postingan ane kali ini,…semoga bermanfaat,n terimakasih buat yang udah mampir.

Install WineAsio 0.9.0 on Ubuntu 11.04 (deb file included)

If you really need VST or any ASIO related application on linux the solution i simple:
“WineASIO provides an ASIO to JACK driver for WINE. ASIO is the most common Windows low-latency driver, so is commonly used in audio workstation programs.”
I created a little guide to install via deb file.
Install Wine and Jack:
sudo apt-get install wine jackd qjackctl
Install WineAsio
A) deb file:
Download  and install this package
wget http://www.lucamazzilli.it/downloads/wineasio_0.9.0-1_i386.deb
sudo dpkg -i wineasio_0.9.0-1_i386.deb
B) from source:
Install dependencies
- if you are using jack 1
sudo apt-get install libjack-dev
- if you are using jack2
sudo apt-get install libjack-jackd2-dev
Download and extract
wget http://leaseweb.dl.sourceforge.net/project/wineasio/wineasio-0.9.0.tar.gz
tar -zxvf wineasio-*
cd wineasio
search google for asio.h (file:asio.h) than copy to your source folder and:
make
sudo make install
if you get an error like this:
luca@pc:~/wineasio$ sudo make install
if [ -d /usr/lib32/wine ]; then cp wineasio.dll.so /usr/lib32/wine; else cp wineasio.dll.so /usr/lib/wine; fi
just copy wineasio.dll.so on the correct folder in old fashioned way:
- 64bit
sudo cp wineasio.dll.so /usr/lib32/wine
- 32bit
sudo cp wineasio.dll.so /usr/lib/wine
register wine library
regsvr32 wineasio.dll
Configure Wine to use alsa and jack
winecfg
select audio tab, than pick Jack Driver and Alsa Driver
Install some cool stuff like EnergyXT or Reaper.

Making Music on Linux; It’s A Thing

I was never a great, or even good, guitar player, but it’s something I really enjoyed doing for a decent chunk of my life. But as life and work grew more complex, it kind of fell by the wayside, a casualty of the demands of adulthood.

But recently, I’ve been actively trying to carve out time to mess around with my guitar. Because I live in an apartment, I became intrigued by the idea of amp and pedal modeling, where instead of playing through a physical amp or guitar pedal, one plays into a computer, with the amp and pedal sound created by software.
I was intrigued for a few reasons. I liked that I could get an amp sound without having to disturb anyone. But I also loved the access to different kinds of amps and pedals modeling provided. I could enhance my sound without having to invest money or space in equipment.
There are lots of ways to model amps and pedals. Apple’s GarageBand is probably one of the most popular consumer avenues. But I wanted to try and implement something on Linux, despite the near constant refrain that Linux doesn’t do audio production well.
I decided to repurpose my T43 ThinkPad for music and downloaded Ubuntu Studio 11.04 (the Ubuntu Studio people very candidly recommend against 11.10). Ubuntu Studio is a fairly standard Ubuntu with a bunch of multimedia packages pre-installed. I liked that aspect since it let me play with a lot of software without having to figure out what I should be playing with.
In order to play into my laptop mic jack, I got a cheap 1/4”-1/8” converter for my guitar cable at RadioShack and then I was ready to go.
I share my experiences as a production amateur. My previous recording setups were a cheap cassette four-track and prior to that, a tape recorder from the early 1990s. Digital recording had, up to a few weeks ago, completely passed me by.
For instance, I quickly learned that anyone working with instrument recording in Linux needs to work with JACK. JACK serves as virtual jacks, allowing you to connect sounds to each other. For instance, if you’re playing through an amp modeler, you need JACK running to connect your guitar output to the amp modelling software. If you’re recording, you need JACK to connect the output to the recorder. It’s very logical but until you know that JACK is what moves sound around, it can be a bit frustrating to hear nothing but your unprocessed guitar coming through your headphones. It also seems that sound is always going to come through your headphones and not your laptop speakers. I was happy with the sound in my headphones, so I never investigated getting sound out of my built-in speakers.
JACK screesnshot
Linux has some very nice modeling options. Rakarrack is a great processor, with lots of interesting options. It’s incredibly customizable, in a paralyzingly intimidating way, but it has some nice presets to get you started carving out the right sound. It’s a truly amazing piece of software.
Rakarrack screenshot
I had also heard some good things about AmpliTube, a Windows/OS X product. AmpliTube comes with a few pedals, amps, and cabinets, with users able to buy more. It’s an intriguing model, but I mostly just wanted to mess around with the free pedals, of which there is a nice variety. I couldn’t get it running via Wine in Ubuntu Studio, and the old GNOME interface was killing me, so, having figured out which music software I wanted, I just installed Xubuntu 11.10 and grabbed everything from the repositories (I’m still madly in love with OpenSUSE but you really can’t beat the Ubuntu repositories for scope and convenience).
Amplitube screenshot
AmpliTube works perfectly in Xubuntu via Wine. It did require WineAsio, which isn’t in any repositories. I couldn’t get it to run off of the project download page, but I found this guide and it got everything working for me.
AmpliTube has a snazzier interface than Rakarrack and Guitarix, but I found it harder to manipulate the sound variables in AmpliTube. AmpliTube tries to preserve the pedal/rack/dial metaphor and that doesn’t always translate to a mouse and computer screen interface. AmpliTube has some great sounds, though. Plus, it lets you demo pedals, although when I tried to record with a pedal I was trialing, I got random static bursts every few seconds. But it’s still nice to get a sense of if a pedal is worth “purchasing.”
Guitarix is a Linux product. It’s an amp simulator, but it also has some pedal-like effects in its virtual rack. The big trick for me was figuring out to tell Guitarix to show the racks so I could tweak the effects. But once I found that option, under the Plugins menu, I really got into playing with Guitarix. It had some very nice, organic-sounding tones.
Guitarix screenshot
Once I had some sounds down, I figured I should record. Ardour is a hardcore digital audio workstation, but it was way too much tool for me, so I’ve been using Audacity. Linux music people online seem very excited about Bitwig Studio, which isn’t available yet. Depending upon pricing, I might check that out once it’s available.
When recording, you need to tell the tool to pull the signal from JACK. And you need to make sure JACK is connecting your sound to the recording tool. Usually this involves starting to record and then making the connection.
Once I was able to record some guitar (and some bass — Rakarrack has a bass simulation that’s not bad), I figured I should put some drums on my tracks, too. Hydrogen is a neat little drum machine. The drum kit sounds are nice but there weren’t a lot of preset beats to work with. But programming Hydrogen isn’t too bad, once you know a few basic drum patterns. I poked around on YouTube and learned you have a snare on the 1 and the 3, bass drum on the 2 and the 4, and some sort of cymbal on each beat. The sad thing is, I’ve played with drummers a bit over the years, but really had no idea what they were doing on a theoretical level.
My Hydrogen beats aren’t horribly inventive, but they allow me to work on my rhythm and to give my tracks the vague impression that the music is played by humans. And playing with drums is helping me tremendously with my rhythm, or lack thereof. I did some very rough demos, just to give a sense of the various guitar sounds available, as well as a basic application of Hydrogen. You can hear them here.
In addition to the fun of playing guitar and of messing around with Linux, I’m actually learning a lot about music. Things I never thought about, like rhythm and time signatures and arranging, have suddenly become very visible to me. And while I can’t say I have a handle on any of those things, I do feel more aware of them than I was when I was just bashing away on a guitar without any of these audio tools.
Was this a lot of work to get going? It took some time to figure out how to do everything, but it was time I enjoyed.
Would this be easier on a Mac with GarageBand? Probably. But the results, now that everything is setup, are impressive. I’m able to relatively easily make music and flesh out ideas. Obviously, as someone who’s not a professional musician and not looking to release any music, my standards are different than someone with more serious goals. But for the casual home recorder, Linux is a perfectly viable option.
If you’re at all interested in home recording, give Linux a try. It’s a little work to get rolling, but once it’s up and running, you’ll find a lot of great tools to bring your ideas to life. It’s pretty amazing to think I can do all of this with a 2GB machine that’s over five years old and that creating this entire studio didn’t cost me anything out of pocket.

Virtualization With KVM On A CentOS 6.4 Server

This guide explains how you can install and use KVM for creating and running virtual machines on a CentOS 6.4 server. I will show how to create image-based virtual machines and also virtual machines that use a logical volume (LVM). KVM is short for Kernel-based Virtual Machine and makes use of hardware virtualization, i.e., you need a CPU that supports hardware virtualization, e.g. Intel VT or AMD-V.
I do not issue any guarantee that this will work for you!

1 Preliminary Note

I'm using a CentOS 6.4 server with the hostname server1.example.com and the IP address 192.168.0.100 here as my KVM host.
I had SELinux disabled on my CentOS 6.4 system. I didn't test with SELinux on; it might work, but if not, you better switch off SELinux as well:
vi /etc/selinux/config
Set SELINUX=disabled...

# 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 - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
... and reboot:
reboot
We also need a desktop system where we install virt-manager so that we can connect to the graphical console of the virtual machines that we install. I'm using a Fedora 17 desktop here.

2 Installing KVM

CentOS 6.4 KVM Host:
First check if your CPU supports hardware virtualization - if this is the case, the command
egrep '(vmx|svm)' --color=always /proc/cpuinfo
should display something, e.g. like this:
[root@server1 ~]# egrep '(vmx|svm)' --color=always /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
 nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy misalignsse
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
 nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy misalignsse
[root@server1 ~]#
If nothing is displayed, then your processor doesn't support hardware virtualization, and you must stop here.
Now we import the GPG keys for software packages:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
To install KVM and virtinst (a tool to create virtual machines), we run
yum install kvm libvirt python-virtinst qemu-kvm
Then start the libvirt daemon:
/etc/init.d/libvirtd start
To check if KVM has successfully been installed, run
virsh -c qemu:///system list
It should display something like this:
[root@server1 ~]# virsh -c qemu:///system list
 Id Name                 State
----------------------------------

[root@server1 ~]#
If it displays an error instead, then something went wrong.
Next we need to set up a network bridge on our server so that our virtual machines can be accessed from other hosts as if they were physical systems in the network.
To do this, we install the package bridge-utils...
yum install bridge-utils
... and configure a bridge. Create the file /etc/sysconfig/network-scripts/ifcfg-br0 (please use the IPADDRPREFIXGATEWAY, DNS1 and DNS2 values from the/etc/sysconfig/network-scripts/ifcfg-eth0 file); make sure you use TYPE=Bridge, not TYPE=Ethernet:
vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.0.100
PREFIX=24
GATEWAY=192.168.0.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"
Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows (comment out BOOTPROTOIPADDRPREFIXGATEWAYDNS1, and DNS2 and add BRIDGE=br0):
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
#BOOTPROTO=none
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE="Ethernet"
UUID="73cb0b12-1f42-49b0-ad69-731e888276ff"
HWADDR=00:1E:90:F3:F0:02
#IPADDR=192.168.0.100
#PREFIX=24
#GATEWAY=192.168.0.1
#DNS1=8.8.8.8
#DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0

Restart the network...
/etc/init.d/network restart
... and run
ifconfig
It should now show the network bridge (br0):
[root@server1 ~]# ifconfig
br0       Link encap:Ethernet  HWaddr 00:1E:90:F3:F0:02
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:90ff:fef3:f002/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:460 (460.0 b)  TX bytes:2298 (2.2 KiB)

eth0      Link encap:Ethernet  HWaddr 00:1E:90:F3:F0:02
          inet6 addr: fe80::21e:90ff:fef3:f002/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18455 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11861 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26163057 (24.9 MiB)  TX bytes:1100370 (1.0 MiB)
          Interrupt:25 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2456 (2.3 KiB)  TX bytes:2456 (2.3 KiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:AC:AC:8F
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[root@server1 ~]#

3 Installing virt-viewer Or virt-manager On Your Fedora 17 Desktop

Fedora 17 Desktop:
We need a means of connecting to the graphical console of our guests - we can use virt-manager for this. I'm assuming that you're using a Fedora 17 desktop.
Become root...
su
... and run...
yum install virt-manager libvirt qemu-system-x86 openssh-askpass
... to install virt-manager.
(If you're using an Ubuntu 12.04 desktop, you can install virt-manager as follows:
sudo apt-get install virt-manager
)

4 Creating A Debian Squeeze Guest (Image-Based) From The Command Line

CentOs 6.4 KVM Host:
Now let's go back to our CentOS 6.4 KVM host.
Take a look at
man virt-install
to learn how to use virt-install.
We will create our image-based virtual machines in the directory /var/lib/libvirt/images/ which was created automatically when we installed KVM in chapter two.
To create a Debian Squeeze guest (in bridging mode) with the name vm10, 512MB of RAM, two virtual CPUs, and the disk image /var/lib/libvirt/images/vm10.img (with a size of 12GB), insert the Debian Squeeze Netinstall CD into the CD drive and run
virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /dev/cdrom --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm
Of course, you can also create an ISO image of the Debian Squeeze Netinstall CD (please create it in the /var/lib/libvirt/images/ directory because later on I will show how to create virtual machines through virt-manager from your Fedora desktop, and virt-manager will look for ISO images in the /var/lib/libvirt/images/ directory)...
dd if=/dev/cdrom of=/var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso
... and use the ISO image in the virt-install command:
virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm
The output is as follows:
[root@server1 ~]# virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm


Starting install...
Allocating 'vm10.img'              |  12 GB     00:00
Creating domain...                 |    0 B     00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
[root@server1 ~]#

5 Connecting To The Guest

The KVM guest will now boot from the Debian Squeeze Netinstall CD and start the Debian installer - that's why we need to connect to the graphical console of the guest. You can do this with virt-manager on the Fedora 17 desktop.
Go to Applications > System Tools > Virtual Machine Manager to start virt-manager:


Type in your password:


When you start virt-manager for the first time, you will most likely see the message Unable to open a connection to the libvirt management daemon. You can ignore this because we don't want to connect to the local libvirt daemon, but to the one on our CentOS 6.4 KVM host. Click on Close and go to File > Add Connection... to connect to our CentOS 6.4 KVM host:



Select QEMU/KVM as Hypervisor, then check Connect to remote host, select SSH in the Method drop-down menu, type in root as the Username and the hostname (server1.example.com) or IP address (192.168.0.100) of the CentOS 6.4 KVM host in the Hostname field. Then click on Connect:


If this is the first connection to the remote KVM server, you must type in yes and click on OK:

Afterwards type in the root password of the CentOS 6.4 KVM host:

You should see vm10 as running. Mark that guest and click on the Open button to open the graphical console of the guest:

Type in the root password of the KVM host again:

You should now be connected to the graphical console of the guest and see the Debian installer:

Now install Debian as you would normally do on a physical system. Please note that at the end of the installation, the Debian guest needs a reboot. The guest will then stop, so you need to start it again, either with virt-manager or like this on our CentOS 6.4 KVM host command line:
CentOS 6.4 KVM Host:
virsh --connect qemu:///system
start vm10
quit
Afterwards, you can connect to the guest again with virt-manager and configure the guest. If you install OpenSSH (package openssh-server) in the guest, you can connect to it with an SSH client (such as PuTTY).

6 Creating A Debian Squeeze Guest (Image-Based) From The Desktop With virt-manager


Instead of creating a virtual machine from the command line (as shown in chapter 4), you can as well create it from the Fedora desktop using virt-manager (of course, the virtual machine will be created on the CentOS 6.4 KVM host - in case you ask yourself if virt-manager is able to create virtual machines on remote systems).
To do this, click on the following button:
The New VM dialogue comes up. Fill in a name for the VM (e.g. vm11), select Local install media (ISO image or CDROM), and click on Forward:

Next select Linux in the OS type drop-down menu and Debian Squeeze in the Version drop-down menu, then check Use ISO image and click on the Browse... button:

Select the debian-6.0.2.1-amd64-netinst.iso image that you created in chapter 4 and click on Choose Volume:

Now click on Forward:

Assign memory and the number of CPUs to the virtual machine and click on Forward:

Now we come to the storage. Check Enable storage for this virtual machine, select Create a disk image on the computer's hard drive, specify the size of the hard drive (e.g. 12GB), and check Allocate entire disk now. Then click on Forward:

Now we come to the last step of the New VM dialogue. Go to the Advanced options section. Select Host device vnet0 (Bridge 'br0'); that is the name of the bridge which we created in chapter 2. Click on Finish afterwards:

The disk image for the VM is now being created:

Afterwards, the VM will start. Type in the root password of the CentOS 6.4 KVM host:

You should now be connected to the graphical console of the guest and see the Debian installer:

Now install Debian as you would normally do on a physical system.

7 Managing A KVM Guest From The Command Line


KVM guests can be managed through virsh, the "virtual shell". To connect to the virtual shell, run
virsh --connect qemu:///system
This is how the virtual shell looks:
[root@server1 ~]# virsh --connect qemu:///system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh #
You can now type in commands on the virtual shell to manage your guests. Run
help
to get a list of available commands:
virsh # help
Grouped commands:

 Domain Management (help keyword 'domain'):
    attach-device                  attach device from an XML file
    attach-disk                    attach disk device
    attach-interface               attach network interface
    autostart                      autostart a domain
    blkiotune                      Get or set blkio parameters
    blockpull                      Populate a disk from its backing image.
    blockjob                       Manage active block operations.
    console                        connect to the guest console
    cpu-baseline                   compute baseline CPU
    cpu-compare                    compare host CPU with a CPU described by an XML file
    create                         create a domain from an XML file
    define                         define (but don't start) a domain from an XML file
    destroy                        destroy (stop) a domain
    detach-device                  detach device from an XML file
    detach-disk                    detach disk device
    detach-interface               detach network interface
    domid                          convert a domain name or UUID to domain id
    domjobabort                    abort active domain job
    domjobinfo                     domain job information
    domname                        convert a domain id or UUID to domain name
    domuuid                        convert a domain name or id to domain UUID
    domxml-from-native             Convert native config to domain XML
    domxml-to-native               Convert domain XML to native config
    dump                           dump the core of a domain to a file for analysis
    dumpxml                        domain information in XML
    edit                           edit XML configuration for a domain
    inject-nmi                     Inject NMI to the guest
    send-key                       Send keycodes to the guest
    managedsave                    managed save of a domain state
    managedsave-remove             Remove managed save of a domain
    maxvcpus                       connection vcpu maximum
    memtune                        Get or set memory parameters
    migrate                        migrate domain to another host
    migrate-setmaxdowntime         set maximum tolerable downtime
    migrate-setspeed               Set the maximum migration bandwidth
    reboot                         reboot a domain
    restore                        restore a domain from a saved state in a file
    resume                         resume a domain
    save                           save a domain state to a file
    save-image-define              redefine the XML for a domain's saved state file
    save-image-dumpxml             saved state domain information in XML
    save-image-edit                edit XML for a domain's saved state file
    schedinfo                      show/set scheduler parameters
    screenshot                     take a screenshot of a current domain console and store it into a file
    setmaxmem                      change maximum memory limit
    setmem                         change memory allocation
    setvcpus                       change number of virtual CPUs
    shutdown                       gracefully shutdown a domain
    start                          start a (previously defined) inactive domain
    suspend                        suspend a domain
    ttyconsole                     tty console
    undefine                       undefine an inactive domain
    update-device                  update device from an XML file
    vcpucount                      domain vcpu counts
    vcpuinfo                       detailed domain vcpu information
    vcpupin                        control or query domain vcpu affinity
    version                        show version
    vncdisplay                     vnc display

 Domain Monitoring (help keyword 'monitor'):
    domblkinfo                     domain block device size information
    domblklist                     list all domain blocks
    domblkstat                     get device block stats for a domain
    domcontrol                     domain control interface state
    domifstat                      get network interface stats for a domain
    dominfo                        domain information
    dommemstat                     get memory statistics for a domain
    domstate                       domain state
    list                           list domains

 Host and Hypervisor (help keyword 'host'):
    capabilities                   capabilities
    connect                        (re)connect to hypervisor
    freecell                       NUMA free memory
    hostname                       print the hypervisor hostname
    nodecpustats                   Prints cpu stats of the node.
    nodeinfo                       node information
    nodememstats                   Prints memory stats of the node.
    qemu-attach                    QEMU Attach
    qemu-monitor-command           QEMU Monitor Command
    sysinfo                        print the hypervisor sysinfo
    uri                            print the hypervisor canonical URI

 Interface (help keyword 'interface'):
    iface-begin                    create a snapshot of current interfaces settings, which can be later commited (iface-commit) or restored (iface-rollback)
    iface-commit                   commit changes made since iface-begin and free restore point
    iface-define                   define (but don't start) a physical host interface from an XML file
    iface-destroy                  destroy a physical host interface (disable it / "if-down")
    iface-dumpxml                  interface information in XML
    iface-edit                     edit XML configuration for a physical host interface
    iface-list                     list physical host interfaces
    iface-mac                      convert an interface name to interface MAC address
    iface-name                     convert an interface MAC address to interface name
    iface-rollback                 rollback to previous saved configuration created via iface-begin
    iface-start                    start a physical host interface (enable it / "if-up")
    iface-undefine                 undefine a physical host interface (remove it from configuration)

 Network Filter (help keyword 'filter'):
    nwfilter-define                define or update a network filter from an XML file
    nwfilter-dumpxml               network filter information in XML
    nwfilter-edit                  edit XML configuration for a network filter
    nwfilter-list                  list network filters
    nwfilter-undefine              undefine a network filter

 Networking (help keyword 'network'):
    net-autostart                  autostart a network
    net-create                     create a network from an XML file
    net-define                     define (but don't start) a network from an XML file
    net-destroy                    destroy (stop) a network
    net-dumpxml                    network information in XML
    net-edit                       edit XML configuration for a network
    net-info                       network information
    net-list                       list networks
    net-name                       convert a network UUID to network name
    net-start                      start a (previously defined) inactive network
    net-undefine                   undefine an inactive network
    net-uuid                       convert a network name to network UUID

 Node Device (help keyword 'nodedev'):
    nodedev-create                 create a device defined by an XML file on the node
    nodedev-destroy                destroy (stop) a device on the node
    nodedev-dettach                dettach node device from its device driver
    nodedev-dumpxml                node device details in XML
    nodedev-list                   enumerate devices on this host
    nodedev-reattach               reattach node device to its device driver
    nodedev-reset                  reset node device

 Secret (help keyword 'secret'):
    secret-define                  define or modify a secret from an XML file
    secret-dumpxml                 secret attributes in XML
    secret-get-value               Output a secret value
    secret-list                    list secrets
    secret-set-value               set a secret value
    secret-undefine                undefine a secret

 Snapshot (help keyword 'snapshot'):
    snapshot-create                Create a snapshot from XML
    snapshot-create-as             Create a snapshot from a set of args
    snapshot-current               Get or set the current snapshot
    snapshot-delete                Delete a domain snapshot
    snapshot-dumpxml               Dump XML for a domain snapshot
    snapshot-edit                  edit XML for a snapshot
    snapshot-list                  List snapshots for a domain
    snapshot-parent                Get the name of the parent of a snapshot
    snapshot-revert                Revert a domain to a snapshot

 Storage Pool (help keyword 'pool'):
    find-storage-pool-sources-as   find potential storage pool sources
    find-storage-pool-sources      discover potential storage pool sources
    pool-autostart                 autostart a pool
    pool-build                     build a pool
    pool-create-as                 create a pool from a set of args
    pool-create                    create a pool from an XML file
    pool-define-as                 define a pool from a set of args
    pool-define                    define (but don't start) a pool from an XML file
    pool-delete                    delete a pool
    pool-destroy                   destroy (stop) a pool
    pool-dumpxml                   pool information in XML
    pool-edit                      edit XML configuration for a storage pool
    pool-info                      storage pool information
    pool-list                      list pools
    pool-name                      convert a pool UUID to pool name
    pool-refresh                   refresh a pool
    pool-start                     start a (previously defined) inactive pool
    pool-undefine                  undefine an inactive pool
    pool-uuid                      convert a pool name to pool UUID

 Storage Volume (help keyword 'volume'):
    vol-clone                      clone a volume.
    vol-create-as                  create a volume from a set of args
    vol-create                     create a vol from an XML file
    vol-create-from                create a vol, using another volume as input
    vol-delete                     delete a vol
    vol-download                   Download a volume to a file
    vol-dumpxml                    vol information in XML
    vol-info                       storage vol information
    vol-key                        returns the volume key for a given volume name or path
    vol-list                       list vols
    vol-name                       returns the volume name for a given volume key or path
    vol-path                       returns the volume path for a given volume name or key
    vol-pool                       returns the storage pool for a given volume key or path
    vol-upload                     upload a file into a volume
    vol-wipe                       wipe a vol

 Virsh itself (help keyword 'virsh'):
    cd                             change the current directory
    echo                           echo arguments
    exit                           quit this interactive terminal
    help                           print help
    pwd                            print the current directory
    quit                           quit this interactive terminal


virsh #
list
shows all running guests;
list --all
shows all guests, running and inactive:
virsh # list --all
 Id Name                 State
----------------------------------
  3 vm11                 running
  - vm10                 shut off

virsh #
If you modify a guest's xml file (located in the /etc/libvirt/qemu/ directory), you must redefine the guest:
define /etc/libvirt/qemu/vm10.xml

Please note that whenever you modify the guest's xml file in /etc/libvirt/qemu/, you must run the define command again!
To start a stopped guest, run:
start vm10
To stop a guest, run
shutdown vm10
To immediately stop it (i.e., pull the power plug), run
destroy vm10
Suspend a guest:
suspend vm10
Resume a guest:
resume vm10
These are the most important commands.
Type
quit
to leave the virtual shell.

8 Creating An LVM-Based Guest From The Command Line

CentOS 6.4 KVM Host:
LVM-based guests have some advantages over image-based guests. They are not as heavy on hard disk IO, and they are easier to back up (using LVM snapshots).
To use LVM-based guests, you need a volume group that has some free space that is not allocated to any logical volume. In this example, I use the volume group /dev/vg_server1 with a size of approx. 465GB...
vgdisplay
[root@server1 ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_server1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.28 GiB
  PE Size               4.00 MiB
  Total PE              119112
  Alloc PE / Size       26500 / 103.52 GiB
  Free  PE / Size       92612 / 361.77 GiB
  VG UUID               ZXWn5k-oVkA-ibuC-ip8x-edLx-3DMw-UrYMXg

[root@server1 ~]#
... that contains the logical volumes /dev/vg_server1/LogVol00 with a size of approx. 100GB and /dev/vg_server1/LogVol01 (about 6GB) - the rest is not allocated and can be used for KVM guests:
lvdisplay
[root@server1 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_server1/LogVol01
  LV Name                LogVol01
  VG Name                vg_server1
  LV UUID                uUpXY3-yGfZ-X6bc-3D1u-gB4E-CfKE-vDcNfw
  LV Write Access        read/write
  LV Creation host, time server1.example.com, 2012-08-21 13:45:32 +0200
  LV Status              available
  # open                 1
  LV Size                5.86 GiB
  Current LE             1500
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_server1/LogVol00
  LV Name                LogVol00
  VG Name                vg_server1
  LV UUID                FN1404-Aczo-9dfA-CnNI-IKn0-L2hW-Aix0rV
  LV Write Access        read/write
  LV Creation host, time server1.example.com, 2012-08-21 13:45:33 +0200
  LV Status              available
  # open                 1
  LV Size                97.66 GiB
  Current LE             25000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

[root@server1 ~]#
I will now create the virtual machine vm12 as an LVM-based guest. I want vm12 to have 20GB of disk space, so I create the logical volume /dev/vg_server1/vm12 with a size of 20GB:
lvcreate -L20G -n vm12 vg_server1
Afterwards, we use the virt-install command again to create the guest:
virt-install --connect qemu:///system -n vm12 -r 512 --vcpus=2 --disk path=/dev/vg_server1/vm12 -c /var/lib/libvirt/images/debian-6.0.5-amd64-netinst.iso --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm
Please note that instead of --disk path=/var/lib/libvirt/images/vm12.img,size=20 I use --disk path=/dev/vg_server1/vm12, and I don't need to define the disk space anymore because the disk space is defined by the size of the logical volume vm12 (20GB).
Now follow chapter 5 to install that guest.

9 Converting Image-Based Guests To LVM-Based Guests

CentOS 6.4 KVM Host:
No let's assume we want to convert our image-based guest vm10 into an LVM-based guest. This is how we do it:
First make sure the guest is stopped:
virsh --connect qemu:///system
shutdown vm10
quit

Then create a logical volume (e.g. /dev/vg_server1/vm10) that has the same size as the image file. To find out the size of the image, type in ...
ls -l /var/lib/libvirt/images/
[root@server1 ~]# ls -l /var/lib/libvirt/images/
total 13819392
-rw-r--r-- 1 qemu qemu   177209344 May 12 22:41 debian-6.0.5-amd64-netinst.iso
-rw------- 1 root root 12884901888 Aug 21 15:37 vm10.img
-rw------- 1 qemu qemu 12884901888 Aug 21 15:51 vm11.img
[root@server1 ~]#
As you see, vm10.img has a size of exactly 12884901888 bytes. To create a logical volume of exactly the same size, we must specify -L 12884901888b (please don't forget the b at the end which tells lvcreate to use bytes - otherwise it would assume megabytes):
lvcreate -L 12884901888b -n vm10 vg_server1
Now we convert the image:
qemu-img convert /var/lib/libvirt/images/vm10.img -O raw /dev/vg_server1/vm10
Afterwards you can delete the disk image:
rm -f /var/lib/libvirt/images/vm10.img
Now we must open the guest's xml configuration file /etc/libvirt/qemu/vm10.xml...
vi /etc/libvirt/qemu/vm10.xml
... and change the following section...

[...]
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/vm10.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
[...]
... so that it looks as follows:
[...]
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/vg_server1/vm10'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
[...]

Afterwards we must redefine the guest:
virsh --connect qemu:///system
define /etc/libvirt/qemu/vm10.xml
Still on the virsh shell, we can start the guest...
start vm10
... and leave the virsh shell:
quit

10 Links


Source : http://www.howtoforge.com/virtualization-with-kvm-on-a-centos-6.4-server