LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2013, 03:08 AM   #1
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Rep: Reputation: Disabled
How do i establish connection between host and guest in KVM


Hi Guys,

How do i establish connection between host and guest in KVM?
 
Old 10-19-2013, 03:43 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by Jerico91 View Post
How do i establish connection between host and guest in KVM?
Do you have a specific problem you run into?

If KVM is set up correctly you should be able to reach the guest from the host by using the guest's ip number and vice versa.

Example:
Code:
# guest IP -> 172.16.122.60
# host ip -> 10.0.100.12

# from host to guest:
ssh username@172.16.122.60

# from guest to host:
ssh username@10.0.100.12
If this doesn't work then have a look at your firewall to see what is and isn't allowed.
 
Old 10-19-2013, 04:48 AM   #3
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
i have configured bridge network on my host and i've selected my guest to use that bridge network but when i switch to guest i cant see and network device except the loopback.
 
Old 10-19-2013, 05:02 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by Jerico91 View Post
i have configured bridge network on my host and i've selected my guest to use that bridge network but when i switch to guest i cant see and network device except the loopback.
Did you set up (or activate) a valid network configuration on the guest?

If you run ifconfig on the guest and you only see the loopback device then there's no way you can connect from or to the guest.

How to set this up correctly depends on the distro that's being run as guest.
 
Old 10-19-2013, 07:47 AM   #5
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
I see only loopback when i run ifconfig in guest
I'm using RHEL 6.0 and i've selected bridge network while installing guest machine.
 
Old 10-19-2013, 08:32 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by Jerico91 View Post
I see only loopback when i run ifconfig in guest
I'm using RHEL 6.0
It looks like you still need to set up your network in your guest.

Make sure your guest has a network interface (NIC) assigned to it (ifconfig -a should show an eth0 entry.

Then use the system-config-network tool. Or, if you prefer, you can set it up manually: RHEL/CentOS 6 Networking
 
1 members found this post helpful.
Old 10-19-2013, 01:41 PM   #7
Doug G
Member
 
Registered: Jul 2013
Posts: 595

Rep: Reputation: Disabled
Also you may need to set up a network bridge on host and use the bridge as your network in the kvm vm. By default a new vm will use it's own NAT subnet that's not accessible from the host subnet.
 
Old 10-20-2013, 03:59 AM   #8
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
@druuna

when i did ifconfig -a i can see eth0 and i configured it to dhcp
now i'm able to communicate between host and guest, but its getting ip from mu ISP's dhcp server like my host

When i setup static ip on host and guest I'm not able to access host from guest or vice versa
i need static ip to be configured as when I'm configuring anything the ip would be changed every time.
 
Old 10-20-2013, 05:50 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by Jerico91 View Post
when i did ifconfig -a i can see eth0 and i configured it to dhcp
now i'm able to communicate between host and guest, but its getting ip from mu ISP's dhcp server like my host

When i setup static ip on host and guest I'm not able to access host from guest or vice versa
i need static ip to be configured as when I'm configuring anything the ip would be changed every time.
Is there a specific reason why you choose to use BRIDGED/ROUTED instead of the default and easier to set up NAT?
 
Old 10-20-2013, 12:24 PM   #10
Jerico91
LQ Newbie
 
Registered: Sep 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
initially it was not working with NAT not sure why
now i removed the machine and reinstalled and selected NAT its working fine with static ip now

Thnx
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to establish network between host and guest in KVM Jerico91 Linux - Newbie 2 10-18-2013 05:06 PM
Redirect logs from KVM guest to KVM host essential1 Linux - Virtualization and Cloud 2 10-08-2013 04:29 PM
accessing a KVM guest from outside the host rootaccess Linux - General 2 04-28-2013 12:29 AM
KVM guest cannot access host thehemi Linux - Virtualization and Cloud 8 03-28-2012 05:36 AM
Share between Qemu-Kvm host and guest Alexvader General 1 06-13-2010 04:07 PM


All times are GMT -5. The time now is 09:04 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration