LinuxQuestions.org
Help answer threads with 0 replies.
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 12-06-2012, 03:58 PM   #1
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Rep: Reputation: 0
CentOS 6.3 kvm Virtualization


I have a home server running on centOS 6.3
specs:
Intel(R)Core(TM)2 CPU 6600 @ 2.40GHz
4GB DDR2 ram
320GB hdd for OS only
2TB file storage
2TB backup storage

I'm interested in messing around with some virtualization. I have been debating what to use since I only have experience with Windows Virtual Machine and VMware both on windows.

I'm thinking of using KVM or VirtualBox.
I found this tutorial on setting up KVM on a CentOS 6.3 host.
http://www.howtoforge.com/virtualiza...tos-6.3-server

I want to run a virtual machine in a bridged network mode so these machines will be seen on my home network as actual hosts.
Does KVM/VirtualBox have built in virtual network adapters or would setting up a network bridge require 2 network cards ? or can it be done both ways ?


I'm open to any suggestion or useful insight on this.

Thanks.
 
Old 12-08-2012, 08:04 AM   #2
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 520
Blog Entries: 3

Rep: Reputation: 112Reputation: 112
Arrow

Quote:
Originally Posted by Equinoxx View Post
I have a home server running on centOS 6.3
specs:
Intel(R)Core(TM)2 CPU 6600 @ 2.40GHz
4GB DDR2 ram
320GB hdd for OS only
2TB file storage
2TB backup storage
Thanks for the info. so many people ask questions and provide nothing substantive to work with.

Quote:
I want to run a virtual machine in a bridged network mode so these machines will be seen on my home network as actual hosts.
Does KVM/VirtualBox have built in virtual network adapters or would setting up a network bridge require 2 network cards ?
Yes you have virtual network adapters. No it does not require having two NICs.

Quote:
or can it be done both ways ?
Yes it can be done both ways, But there's prolly no need for you to be concerned with that really.

Basically, you could configure your guests to use the *other* NIC, but that NIC would indeed need to be taken up by the machine (ifup'd and ifconfig'd w/a route - just like your first NIC).

Think of it like this. if you had an eth0 and an eth0:1, eth0:2, etc... Then you're host would have different IPs, on potentially different subnets w/their own routes/gateways, etc.

Bridging is much like that - so no, I wouldn't recommending that you bother with an eth1 and using that for your VMs - unless you know that you have a reason to do so

Quote:
I'm open to any suggestion or useful insight on this.
Okay then, why don't you simply install VirtualBox for starters. That should be exceedingly simple. Then, create a guest or two, each w/256 or 512MBytes RAM or so just to play.

You really can't hurt anything (Just don't give up more than 1GB of your system RAM to these VMS okay, you don't want to starve your host).

Make sure that in your BIOS you've enabled virtualization

And although you can configure your guest VMs to use your DVD drive, I recommend you install the guests from a virtual CD/DVD drive where you mount the iso files.

Here's a good iso file that is small enough to d/l and do an install with: http://cdimage.debian.org/debian-cd/...86-netinst.iso

Just place it somewhere on your HDD and tell VirtualBox that's the iso you want mounted as the CD.

You really can't blow anything up so have at it.

Once you've mastered that then move on to KVM and Xen. Your experience w/ESXi should carry you the rest of the way and I think you'll find VirtualBox exceedingly similar to what you see in your vSphere client

I hope that helps!

Kindest regards,

.
 
1 members found this post helpful.
Old 12-08-2012, 03:18 PM   #3
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks so much for the reply! I was starting to think no one was going to answer lol

I'll look into using virtualbox. Although setting up a network bridge is my main priority as I would like to be able to ssh into these guest VM's. Last night I attempted the tutorial I posted above setting up KVM on a centOS host. I installed KVM problem free but when it came to setting up the network bridge I ran into some problems.

First off I created the bridge config.

vi /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.1.250
PREFIX=24
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"

Next step was to modify ifcfg-eth0 in vi /etc/sysconfig/network-scripts/ifcfg-eth0

my problem was I didn't have ifcfg-eth0 config. So I simply created one with these credentials

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.1.250
#PREFIX=24
#GATEWAY=192.168.1.1
#DNS1=8.8.8.8
#DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0

/etc/init.d/network restart

After doing so my eth0 did not have any assigned IP addr and br0 was up with my assigned machine IP. I could not ping my gateway.
To resolve this I had to manually bring eth0 up and reassign it's IP as well as ifconfig br0 down.

Next attempt I will post my ifconfig -a after setting up the bridge for more info.

My current ifconfig (for any useful information):

eth0 Link encap:Ethernet HWaddr 00:16:E6:85:91:C3
inet addr:192.168.1.250 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:e6ff:fe85:91c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:714001 errors:0 dropped:390 overruns:0 frame:0
TX packets:494255 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:76595063 (73.0 MiB) TX bytes:841019342 (802.0 MiB)
Interrupt:16
(I'm not sure why this is leasing a ipv6 addr ?)

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

virbr0 Link encap:Ethernet HWaddr 52:54:00:39:2A:73
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:815 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:87804 (85.7 KiB)

virbr0-nic Link encap:Ethernet HWaddr 52:54:00:39:2A:73
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 12-08-2012, 03:54 PM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
1. get rid of NM - it's horrible at managing bridges
2. the IP belongs in the bridge, not the underlying NIC
3. in the bridge, use NETMASK instead of PREFIX
4. add DELAY=0 in the bridge config

Once this is in place, and the host works throught the bridge, simply attach the VM to the bridged network instead of the default one

and yes, virtualbox is not for production server virtualization IMO
 
1 members found this post helpful.
Old 12-08-2012, 04:13 PM   #5
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dyasny View Post
1. get rid of NM - it's horrible at managing bridges
2. the IP belongs in the bridge, not the underlying NIC
3. in the bridge, use NETMASK instead of PREFIX
4. add DELAY=0 in the bridge config

Once this is in place, and the host works throught the bridge, simply attach the VM to the bridged network instead of the default one

and yes, virtualbox is not for production server virtualization IMO

Thanks for the info!

So...

1. get rid of NM - it's horrible at managing bridges - So just service NetworkManager stop ?
2. the IP belongs in the bridge, not the underlying NIC - Could you go into more detail here ?Do you mean assign my machine IP (192.168.1.250)to br0 and bring down virbr0-nic ?
3. in the bridge, use NETMASK instead of PREFIX - noted.
4. add DELAY=0 in the bridge config - noted.

Last edited by Equinoxx; 12-08-2012 at 04:45 PM.
 
Old 12-08-2012, 04:50 PM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
Quote:
Originally Posted by Equinoxx View Post
1. get rid of NM - it's horrible at managing bridges. So just service NetworkManager stop ?
yum remove NetworkManager
service network start
chkconfig network on

Quote:
2. the IP belongs in the bridge, not the underlying NIC - Could you go into more detail here ?Do you mean assign my machine IP (192.168.1.250)to br0 and bring down virbr0-nic ?
no, I mean like this:

Code:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="none"
HWADDR="00:1A:64:7A:00:00"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
BRIDGE=br0

cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.1.250
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DELAY=0
ONBOOT=yes
DNS1=8.8.8.8
DNS2=4.2.2.2

service network restart
 
1 members found this post helpful.
Old 12-08-2012, 05:38 PM   #7
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Ok sounds good, I'll be giving this a try later on.

One thing that mainly confused me was the fact that I didn't have a ifcfg-eth0 config in the first place. But i do have a ifcfg-lo

Where is the config file for eth0 located ?
Here are the contents of /etc/sysconfig/network-scripts/

ifcfg-lo ifdown-ppp ifup-ippp ifup-sit
ifdown ifdown-routes ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-sit ifup-isdn ifup-wireless
ifdown-eth ifdown-tunnel ifup-plip init.ipv6-global
ifdown-ippp ifup ifup-plusb net.hotplug
ifdown-ipv6 ifup-aliases ifup-post network-functions
ifdown-isdn ifup-bnep ifup-ppp network-functions-ipv6
ifdown-post ifup-eth ifup-routes

so if ifcfg-eth0 is the config file for eth0, i don't have one by default ?
I also realized i could config eth0 though a gui with system-config-network command

Last edited by Equinoxx; 12-08-2012 at 05:45 PM.
 
Old 12-08-2012, 05:58 PM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
use system-config-network to generate the config for eth0, and then alter it for br0
 
1 members found this post helpful.
Old 12-08-2012, 07:07 PM   #9
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Alright so I've edited the config files exactly as told. I can ping my gateway but now I am limited to localhost only (ran into this same issue yesterday) It seems I can only assess the server locally now.
(Only thing I did differently was instead of removing NetworkManager I just ran chkconfig NetworkManager off )

Here is my ifconfig

[kevin@localhost /]$ ifconfig -a
br0 Link encap:Ethernet HWaddr 00:16:E6:85:91:C3
inet addr:192.168.1.250 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:e6ff:fe85:91c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:779 errors:0 dropped:0 overruns:0 frame:0
TX packets:584 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:76720 (74.9 KiB) TX bytes:71596 (69.9 KiB)

eth0 Link encap:Ethernet HWaddr 00:16:E6:85:91:C3
inet6 addr: fe80::216:e6ff:fe85:91c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:815 errors:0 dropped:0 overruns:0 frame:0
TX packets:585 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:99878 (97.5 KiB) TX bytes:71826 (70.1 KiB)
Interrupt:16

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:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)

virbr0 Link encap:Ethernet HWaddr 52:54:00:39:2A:73
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:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:8118 (7.9 KiB)

virbr0-nic Link encap:Ethernet HWaddr 52:54:00:39:2A:73
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)


This also seems to interfere with my WDLive TV. Although I can access my samba file on Windows via Run > \\192.168.1.250
My WDLive TV isn't connecting to my samba share. Maybe has something to do with the nmb service ?

Last edited by Equinoxx; 12-08-2012 at 07:19 PM.
 
Old 12-09-2012, 12:51 AM   #10
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
more details please, what do you mean by "limited to localhost"? You can't reach out from your host to the VM? Or from the host to the LAN/WAN? Or from the VM to the LAN/WAN?
 
Old 12-09-2012, 11:16 AM   #11
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dyasny View Post
more details please, what do you mean by "limited to localhost"? You can't reach out from your host to the VM? Or from the host to the LAN/WAN? Or from the VM to the LAN/WAN?
Nothing to do with the VM's. Once I have my network interfaces configured as shown above. My terminal goes from kevin@linux-zc7x to kevin@localhost and my server is not accessible though the WAN but can be accessed though my LAN only.
 
Old 12-09-2012, 11:23 AM   #12
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
sounds like a networking issue, can you post `brctl show`, `ip r l`, and the contents of all the ifcfg files you have?
 
Old 12-09-2012, 05:01 PM   #13
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Okay I just did my 3rd attempt and I believe it may be working correctly. However I will still post my config.

Only thing I did different this time was go to /etc/sysconfig/network and change the hostname from localhost.localhost to my actual domain

Code:
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centOSbox.MYDOMAIN.biz

Code:
[root@centOSbox ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="none"
HWADDR="00:16:E6:85:91:C3"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
BRIDGE=br0
Code:
[root@centOSbox ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.1.250
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DELAY=0
ONBOOT=yes
DNS1=8.8.8.8
DNS2=4.2.2.2
Code:
[root@centOSbox ~]# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.0016e68591c3       no              eth0
virbr0          8000.525400392a73       yes             virbr0-nic

Code:
[root@centOSbox ~]# ip r l
192.168.1.0/24 dev br0  proto kernel  scope link  src 192.168.1.250
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1
169.254.0.0/16 dev br0  scope link  metric 1003
default via 192.168.1.1 dev br0

Thanks for all the help, please let me know if all looks well.

note: NetworkManager is still running

Last edited by Equinoxx; 12-09-2012 at 05:05 PM.
 
Old 12-12-2012, 06:30 PM   #14
Equinoxx
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
So I'm back with further problems!

I now have a BackTack5 kvm up and running. And I believe my network bridge is configured successfully as I can see the BT machine on my LAN with an assigned IP.
I would like to be able to ssh into this VM.

For starters I'm just trying to connect locally. But would like to connect via WAN as well

I use putty, connect to my domain(CentOS host), then
Code:
ssh root@(local IP)
When doing this I'm getting
Code:
Read from socket failed: Connection reset by peer
for troubleshooting purpose:

Code:
[root@centOSbox ~]# ssh -v root@192.168.1.219
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.1.219 [192.168.1.219] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
Any advice would be much appreciated!

Last edited by Equinoxx; 12-12-2012 at 06:50 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Virtualization With KVM On A CentOS 6.2 Server LXer Syndicated Linux News 0 04-10-2012 06:20 AM
LXer: Virtualization With KVM On A CentOS 6.0 Server LXer Syndicated Linux News 1 09-15-2011 06:40 AM
KVM virtualization on centos linuxguy08 Linux - Server 1 09-14-2010 02:15 PM
CentOS 5 KVM virtualization danicg Linux - Newbie 1 08-19-2010 03:04 PM
LXer: Virtualization With KVM On A CentOS 5.2 Server LXer Syndicated Linux News 0 04-12-2009 04:00 PM


All times are GMT -5. The time now is 10:19 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration