LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2010, 01:24 PM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
Interaction between a Host OS and a Guest OS


Hi,


I have installed Red Hat Eterprise Linux as a Guest OS using VirtualBox on the Host OS Windows XP SP 2 on my PC.

I want to access my local / intranet web site from this Guest OS which is running on the top of on Windows XP, the Host OS.

I am not sure as to what IP Settings I need to do.

Though I am able to access Internet from both the OSes.

The IP of this Guest OS is:

Code:
[root@localhost ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:30:E9:72  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe30:e972/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1871 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1926 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1427538 (1.3 MiB)  TX bytes:415769 (406.0 KiB)
          Interrupt:11 Base address:0xd020 

[root@localhost ~]#
I have installed Microsoft Self Loop Adapter (Autoconfiguration IP Address: 169.254.25.129) on the Host OS Windows XP. There is another adapter: VirtualBox Host-Only Network whose IP Address is: 192.168.56.1


So, how can we access intranet web site from the Host OS to Guest OS and vice versa.

Please note that I also want to access this virtual Red Hat machine /console from within windows XP using PUTTY application.


From Windows XP the Red Hat machine is pinging. But when I use the IP to access the machine through PUTTY it doesn't work.

Thanks!

Last edited by Hi_This_is_Dev; 08-28-2010 at 01:34 PM.
 
Old 08-28-2010, 01:57 PM   #2
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
Not really sure what exactly you're asking for with the first part. But for the SSH issue, try stopping iptables on the Red Hat install and seeing if thats it. If it is you can allow SSH through iptables or leave it off(not really recommended, but thats a different discussion(


Quote:
service iptables stop
 
Old 08-28-2010, 02:04 PM   #3
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by ncsuapex View Post
Not really sure what exactly you're asking for with the first part. But for the SSH issue, try stopping iptables on the Red Hat install and seeing if thats it. If it is you can allow SSH through iptables or leave it off(not really recommended, but thats a different discussion(
I did this:
Code:
service iptables stop
But the Host OS is still unreachable.

To say in a few words, what I want to do:

Host OS: Windows XP
Virtual / Guest OS: Red Hat Linux

I want to ping the Guest / Virtual OS from the Host OS and vice versa.
 
Old 08-28-2010, 05:07 PM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
What IP/hostname are you using to SSH?

What output do you get when you run this command from a command prompt on your windows machine?

Quote:
ipconfig
Whats the output when you run this command from the command line on your linux virtual machine?

Quote:
ifconfig
or if youre not root

Quote:
/sbin/ifconfig
 
Old 08-28-2010, 06:31 PM   #5
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by ncsuapex View Post
What IP/hostname are you using to SSH?

What output do you get when you run this command from a command prompt on your windows machine?



Whats the output when you run this command from the command line on your linux virtual machine?



or if youre not root


Please note: I made some changes to the IP Address on the network connections of my Windows machine. But it is not working yet. Here is the output of ipconfig on my Windows machine:


Code:
C:\>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 1.23.144.27
        Subnet Mask . . . . . . . . . . . : 255.255.224.0
        Default Gateway . . . . . . . . . : 1.23.128.1

Ethernet adapter VirtualBox Host-Only Network:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.56.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection 2:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.56.2
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

C:\>



The first one is being used for connecting to the Internet and the IP address, etc. is being taken from the ISP via its DHCP as you would know.

Code:
Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 1.23.144.27
        Subnet Mask . . . . . . . . . . . : 255.255.224.0
        Default Gateway . . . . . . . . . : 1.23.128.1
So, I can't make changes for the above network connection / ethernet adapter.



And here is the output of ifconfig on my virtual machine (Linux):
Code:
[root@devarishi ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:30:E9:72  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe30:e972/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:656 errors:0 dropped:0 overruns:0 frame:0
          TX packets:714 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:451041 (440.4 KiB)  TX bytes:122810 (119.9 KiB)
          Interrupt:11 Base address:0xd020 

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

[root@devarishi ~]#


I am using the same IP address as displayed in the above output, to log-in through ssh on the virtual machine (Linux).

Last edited by Hi_This_is_Dev; 08-28-2010 at 06:36 PM.
 
Old 08-28-2010, 07:18 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
What gateway is being used on your virtual machine?
 
Old 08-28-2010, 07:43 PM   #7
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by corp769 View Post
What gateway is being used on your virtual machine?

No Default Gateway value is present there. I have not done any configurations on the Virtual Machine.

I just did this:

Code:
system-config-network
and found that the network adapter eth0 is taking the IP address automatically and all the fields are not filled in, that is they are blanks.
 
Old 08-29-2010, 11:32 AM   #8
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
Post the output of the route command.

Quote:
route -n
on the linux vm
 
Old 08-30-2010, 06:51 AM   #9
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by ncsuapex View Post
Post the output of the route command.



on the linux vm
Hi,

Thanks for the command. I will check it on my PC and tomorrow I will post the output here.

By the way, what does the Destination field denote in the output of

Code:
route -n
I just checked on a Linux Machine I am accessing from my office.
 
Old 08-30-2010, 07:48 AM   #10
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Using VMWare, change the network adapter on the guest from NAT to Bridged. Then, from your host (windows XP) set your internet interface to 'Shared' from network connections.

Last edited by SuperJediWombat!; 08-30-2010 at 07:50 AM.
 
Old 08-31-2010, 05:11 PM   #11
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by ncsuapex View Post
Post the output of the route command.



on the linux vm


Hi,

Here is the output of the following two commands:
Code:
[root@devarishi ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         10.0.2.2        0.0.0.0         UG    0      0        0 eth0




[root@devarishi ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:30:E9:72  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe30:e972/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4567 (4.4 KiB)  TX bytes:11525 (11.2 KiB)
          Interrupt:11 Base address:0xd020 

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

[root@devarishi ~]#
 
Old 08-31-2010, 05:15 PM   #12
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by SuperJediWombat! View Post
Using VMWare, change the network adapter on the guest from NAT to Bridged. Then, from your host (windows XP) set your internet interface to 'Shared' from network connections.
Hi,


I am using Sun VirtualBox. In the Network section it is mentioned NAT. I am going to shutdown this VM so that I can edit its settings.

The Network guys in my company also suggested me to make it Bridged. So, let me try it now. Thanks!
 
Old 08-31-2010, 07:40 PM   #13
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Accessing VirtualBox - Virtual Linux from Host OS

Quote:
Originally Posted by SuperJediWombat! View Post
Using VMWare, change the network adapter on the guest from NAT to Bridged. Then, from your host (windows XP) set your internet interface to 'Shared' from network connections.
Hi,


The idea of Bridged has helped me.

I took these steps (I failed but finally succeeded by correcting my steps):


First, I selected two Adapters in Network Connections on Windows XP.

They are:

Microsoft Looback Adapter and VirtualBox Host-Only Adapter

I created a Bridged Network and created a third Adapter out of them.


Second, I changed Network settings to Bridged in the Settings of Virtual OS installed with VirtualBox. I selected the Bridge Network Adapter which I created by selecting the two Adapters.


Thirdly, I assigned an IP to this Bridged Adapter.

Fourth, I restarted the VM and... voil! It took the IP automatically in of the same range as the IP I assigned to the Bridged Adapter.

Finally, I started PUTTY and loged-in through ssh on the VM.

It worked!
 
Old 08-31-2010, 07:45 PM   #14
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Original Poster
Rep: Reputation: 18
Friends, now I can ping the VM (Linux) from Host OS (Windows XP). I can ssh to it.

But I am not able to ping the Host OS (Windows XP) from within the VM (Linux).

I am not sure what steps I need to take further.

Besides, my work is not complete yet. I need to do this:

I want to access the Website / Web Pages being hosted on the VM (Linux). It's working fine on the VM. But I can't access it from the Host OS.

Any ideas about it?
 
Old 09-01-2010, 02:15 AM   #15
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Is the firewall still off, or did you re-enable it? If anything, try disabling both firewalls in linux and windows, and see what it does. If it does nothing, it has to be a routing issue man. Does everything match up between both OS's for the network settings, besides the IP's?
 
  


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
Cannot ping host from guest cucolin@ Linux - Virtualization and Cloud 20 05-07-2010 11:25 PM
Networking - bridging - VM-guest/host jonaskellens Linux - Networking 1 06-29-2009 05:20 AM
networking between host and guest divyashree Linux - Networking 3 03-06-2009 09:04 AM
Ftp between Guest and Host using proftpd lindylex Linux - Networking 0 11-21-2008 10:13 AM
communication of guest OSes with host OS anant Linux - Newbie 1 12-21-2006 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:08 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