LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 01-20-2012, 11:33 AM   #1
mmajidi
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
KVM Virtual network


I have done all of the necessary set up on my KVM virtual network using Centos 6.2 as host and Centos 6.2.

I have defined a network bridge on the host machine.

Here is what I have on the host machine
ifconfig -a
br0 Link encap:Ethernet HWaddr 00:24:81:A9:BF:84
inet addr:192.168.2.249 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::224:81ff:fea9:bf84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:270021 errors:0 dropped:0 overruns:0 frame:0
TX packets:129622 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17402797 (16.5 MiB) TX bytes:469214669 (447.4 MiB)

eth0 Link encap:Ethernet HWaddr 00:24:81:A9:BF:84
inet6 addr: fe80::224:81ff:fea9:bf84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:270287 errors:0 dropped:0 overruns:0 frame:0
TX packets:378486 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22280387 (21.2 MiB) TX bytes:484320429 (461.8 MiB)
Interrupt:16

eth1 Link encap:Ethernet HWaddr 00:24:81:A9:BF:85
BROADCAST 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17

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:259997 errors:0 dropped:0 overruns:0 frame:0
TX packets:259997 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:473368575 (451.4 MiB) TX bytes:473368575 (451.4 MiB)

macvtap0 Link encap:Ethernet HWaddr 52:54:00:5B:6C:B3
inet6 addr: fe80::5054:ff:fe5b:6cb3/64 Scope:Link
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:6 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap0 Link encap:Ethernet HWaddr 8A:2D:7F:26:42:EB
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap1 Link encap:Ethernet HWaddr 5E:AF:32:B2:AF:A9
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

virbr0 Link encap:Ethernet HWaddr 52:54:00:E9:F5:F6
inet addr:192.168.100.1 Bcast:192.168.100.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:269 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:15831 (15.4 KiB)

virbr0-nic Link encap:Ethernet HWaddr 52:54:00:E9:F5:F6
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
 
Old 01-20-2012, 11:35 AM   #2
mmajidi
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
KVM Virtual Network

Please help... thank you

[/U]
Quote:
Originally Posted by mmajidi View Post
I have done all of the necessary set up on my KVM virtual network using Centos 6.2 as host and Centos 6.2.

I have defined a network bridge on the host machine.

Here is what I have on the host machine
ifconfig -a
br0 Link encap:Ethernet HWaddr 00:24:81:A9:BF:84
inet addr:192.168.2.249 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::224:81ff:fea9:bf84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:270021 errors:0 dropped:0 overruns:0 frame:0
TX packets:129622 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17402797 (16.5 MiB) TX bytes:469214669 (447.4 MiB)

eth0 Link encap:Ethernet HWaddr 00:24:81:A9:BF:84
inet6 addr: fe80::224:81ff:fea9:bf84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:270287 errors:0 dropped:0 overruns:0 frame:0
TX packets:378486 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22280387 (21.2 MiB) TX bytes:484320429 (461.8 MiB)
Interrupt:16

eth1 Link encap:Ethernet HWaddr 00:24:81:A9:BF:85
BROADCAST 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17

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:259997 errors:0 dropped:0 overruns:0 frame:0
TX packets:259997 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:473368575 (451.4 MiB) TX bytes:473368575 (451.4 MiB)

macvtap0 Link encap:Ethernet HWaddr 52:54:00:5B:6C:B3
inet6 addr: fe80::5054:ff:fe5b:6cb3/64 Scope:Link
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:6 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap0 Link encap:Ethernet HWaddr 8A:2D:7F:26:42:EB
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap1 Link encap:Ethernet HWaddr 5E:AF:32:B2:AF:A9
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

virbr0 Link encap:Ethernet HWaddr 52:54:00:E9:F5:F6
inet addr:192.168.100.1 Bcast:192.168.100.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:269 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:15831 (15.4 KiB)

virbr0-nic Link encap:Ethernet HWaddr 52:54:00:E9:F5:F6
BROADCAST 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:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
 
Old 01-20-2012, 01:31 PM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
What help do you want ?

Specify the trouble you have :
- you can not connect to KVM machine
- you can not ping / reach it
- you can not 'browse' something you have installed in KVM ?

what
what
what ...

Define your problem, provide / write the steps or link what have you done (you followed a how to or something)
then write where is your problem for which you want help.

Good luck
 
Old 01-20-2012, 02:15 PM   #4
mmajidi
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
network problem on guest

My guest OS has static IP address and I can ping it with no issue. However when I ping the host IP address, I get the unreachable message stating that the IP address cannot be reached. I get the same error when I ping the gateway.

When I ping www.yahoo.com, I get the unknown host name.

I have seup a bridge and my guest os has a static IP address assigned to it.

Is there anyone who can help me?
 
Old 01-22-2012, 11:05 AM   #5
mmajidi
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
got it resolved

I ended up reinstalling the KVM and the guest OS again. I went to virt-manager (I am using kvm and cents as host os), deleted the guest OS (my guest OS is Centos 6.2), remove the KVM, libvirt and then reinstall it the whole thing again.

Once I installed everything again and installed my guest OS (Centos 6.2.), everything worked fine.

I will put my exact steps on the forum later.
 
Old 01-26-2012, 02:41 PM   #6
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 534
Blog Entries: 3

Rep: Reputation: 118Reputation: 118
Arrow

Quote:
Originally Posted by mmajidi View Post

I will put my exact steps on the forum later.
I would like to see that, and you might want to mark the thread as solved too when you post those steps here.

Kindest regards,

.
 
Old 01-27-2012, 11:44 PM   #7
mmajidi
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
[SOLVED]how I solved it

In summary, here are the issue that I run into and this how I solved.

My goal was to install KVM on top of Centos 6.0 and I wanted to install multiple Centos 6.0 guest OS. My configuration for host OS is Centos 6.0 and the guest OSs are Centos 6.0.

I am running KVM under root.

Do the following on the host machine

a) You need to have a later model processor, with virtualization support, for KVM to work properly. This can be checked by examining the /proc/cpuinfo file:

egrep '(vmx|svm)' --color=always /proc/cpuinfo
If you get back results with vmx, then you have an Intel processor. If you get back results with svm, then you have an AMD processor. If you receive a null return, then your processor is not built for hardware supported full virtualization. The xen approach, used in the CentOS 5 series, supports para virtualization.

b) The KVM package for CentOS is available in the extras repository for versions prior to CentOS 5.4. You may install KVM with:
yum install kvm kmod-kvm

c) You probably want to also install QEMU, which is available in the base CentOS repositories, because many of its provided commands can be useful in managing a VM.
yum install qemu

d) The next step is to modprobe the kvm module for your architecture. If it's an Intel processor:
modprobe kvm-intel
If it's an AMD processor:
modprobe kvm-amd
If all goes well, you should have a kvm module loaded on your system by now. You can verify this by running:
/sbin/lsmod | grep kvm

e) If you want the guest to appear as another host on the LAN, visible to the rest of the network, you will have to use bridged networking. There are many QEMU howtos around, but most are out of date, as it has changed since the 2.6.18 kernel.
Here we describe a simple method that works. Many howtos talk of making a qemu-ifup script that lives in /etc. Unfortunately, most of the howtos seem to be outdated, as none of the suggested scripts found in there worked. Below we will present a script that creates the bridge and tap interfaces with appropriate commands.
First you will need bridge-utils, available from the base repo:
yum install bridge-utils

You'll also need tunctl.
This is now available from the RPMForge repository, so, once the repo is enabled, can easily be installed with

yum install tunctl

You will also want to edit your /etc/udev/rules.d/90-kvm-rules. When you installed the rpm, the created file reads:

KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660" In theory, adding the line:

KERNEL=="tun", NAME="net/%k", GROUP="kvm", MODE="0660" should give /dev/net/tun proper permissions. In practice, this doesn't seem to be the case, and though it is a kludge, one can simply add lines like

make usre you logged on as root and issue the following command

brctl addbr br0

copy ifcfg-etho in (/etc/sysconfig/network-scripts) to br0-eth0 in (/etc/sysconfig/network-scripts)

this is a sample ifcfg-br0 file (this is just a sample, make sure that the setting matches your network configuration

DEVICE=br0
TYPE=Bridge
ONBOOT=yes
DELAY=0
BOOTPROTO=none
IPADDR=192.168.1.249
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=43.123.45.67
DNS2=43.123.89.21

this is a sample ifcfg-eth0
DEVICE=eth0
HWADDR=66:13:12:b9:xf:83
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
BRIDGE=br0

After setting the files, do service network restart

After the above command, enter ifconfig and you will see bro and etho in the output.

Now you created the bridge

f) Install virt-manager using yum install virt-manager

g) get the iso image for centos (this may take a long time to get).

The netinstall.iso does not work for me. I ended up using the full iso file for installation.

cd /tmp

You can get te right iso image for your system. This image is for Centos 64 bits.

wget mirror.net.cen.ct.gov/centos/6.2/isos/x86_64/CentOS-6.2-x86_64-bin-DVD1.iso


Now you are ready to install the guest OS. Start virt-manager & from the host OS. You will find instruction on how to use virt-manager. I am repeating the steps for the virt-manager.
However I will give some pointers.

-- When selecting the ISO image, make sure you point to the ISO file that you down load.
--- The network should be the bridge network
--- When you get to the time zone screen, just leave it as default
 
1 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM on Redhat 5.7: KVM can ping outside network, outside network can't ping KVM svandyk Linux - Networking 1 09-23-2011 06:45 AM
kvm only shows virtual cpu!? cosmonate Linux - Virtualization and Cloud 10 02-02-2011 09:38 AM
qemu-kvm, virtual network stalling under load cosmonate Linux - Virtualization and Cloud 4 03-10-2010 05:37 AM
qemu-kvm howto setup virtual network to access Internet garydale Linux - Virtualization and Cloud 5 03-06-2010 12:16 PM
KVM Virtual Machine CD CHANGE ashishverma1984 Fedora 2 12-12-2008 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration