LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Host OS unable to connect to Guest OS (virtual machines) in VMware (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/host-os-unable-to-connect-to-guest-os-virtual-machines-in-vmware-818077/)

vikas027 07-05-2010 07:38 AM

Host OS unable to connect to Guest OS (virtual machines) in VMware
 
3 Attachment(s)
Dear All,

I have two virtual machines (both CentOS) installed on my Win Vista Laptop.

Both of my Guest OS have bridged network connection, snapshot attached (Guest OS 1.jpg and Guest OS 2.jpg) and are able to ping/connect each other successfully.

I have given my physical network the same segment IP too, snapshot attached (Physical Network.jpg).

Now, I have this scenario.

Host OS (Vista) - 192.168.1.30
Guest OS 1 (CentOS) - 192.168.1.10
Guest OS 2 (CentOS) - 192.168.1.20


But, I also need to connect to my Guest OS (or Virtual Machines) from my Vista through putty.

Any idea people. This might not be the right forum to ask this, I apologize if it is not.

blue_print 07-05-2010 08:01 AM

Are you using the same gateway 192.168.1.1 in Host OS and in virtual machines?

vikas027 07-05-2010 08:05 AM

Quote:

Originally Posted by blue_print (Post 4024205)
Are you using the same gateway 192.168.1.1 in Host OS and in virtual machines?

Yes, thanks for the response.

taylorkh 07-05-2010 02:19 PM

Hi vikas027,

Do you have an ssh server running on the guest machines? When I use putty I generally make an ssh connection. If I attempt to connect to a guest or physical computer which is not running ssh I get a message "connection refused". Once I install and start the ssh server I can connect.

Are you attempting to connect by the guest IP address or the guest computer name? Try using the IP address if the computer name does not work.

Another thing to check - is there firewall software running on the Win 7 machine? Perhaps the firewall is blocking the connection.

When I try to connect to my Ubuntu host from a VMWare Win 7 guest for the first time putty prompts me to add the host' rsa fingerprint to the registry. After I click OK to add the fingerprint I am able to connect. Are or were you prompted to do this?

If none of this helps please tell us what error messages you are receiving or what is happening or not happening when you try to connect to the guests with putty.

Ken

jefro 07-05-2010 03:16 PM

Set VM nic setting as local and try to use the two VM's between each other.

vikas027 07-05-2010 08:26 PM

Quote:

Originally Posted by taylorkh (Post 4024515)
Hi vikas027,

Do you have an ssh server running on the guest machines? When I use putty I generally make an ssh connection. If I attempt to connect to a guest or physical computer which is not running ssh I get a message "connection refused". Once I install and start the ssh server I can connect.

Yes, I have ssh running over both machines.


Quote:

Originally Posted by taylorkh (Post 4024515)
Are you attempting to connect by the guest IP address or the guest computer name? Try using the IP address if the computer name does not work.

I am trying to connect through IP.


Quote:

Originally Posted by taylorkh (Post 4024515)
Another thing to check - is there firewall software running on the Win 7 machine? Perhaps the firewall is blocking the connection.

I have stopped all firewalls/antivirus.


Quote:

Originally Posted by taylorkh (Post 4024515)
When I try to connect to my Ubuntu host from a VMWare Win 7 guest for the first time putty prompts me to add the host' rsa fingerprint to the registry. After I click OK to add the fingerprint I am able to connect. Are or were you prompted to do this?

NO :(


Quote:

Originally Posted by taylorkh (Post 4024515)
If none of this helps please tell us what error messages you are receiving or what is happening or not happening when you try to connect to the guests with putty.

I am getting "Network error: Connection Timed out" when connecting through putty.
and below error when pinging the Guest OS.

Code:

C:\Users\vicky>ping 192.168.1.10

Pinging 192.168.1.10 with 32 bytes of data:

Request timed out.
Request timed out.

Ping statistics for 192.168.1.10:
    Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),


vikas027 07-05-2010 08:27 PM

Quote:

Originally Posted by jefro (Post 4024551)
Set VM nic setting as local and try to use the two VM's between each other.

How, to set it as local ?

and as of now, the VMs are able to ssh/ping each other.

jiml8 07-05-2010 08:34 PM

I guess I am not even sure what the question is. I don't get the talk about putty when it is not even clear the host can talk to the guests.

To sort this out, in each guest, in a shell window, type in the command "ifconfig -a" and copy the results here. You might need to be root in order to do this.

Then , for each guest, enter the command "route" (again you might have to be root) and copy the results here

Then, in the host, open a cmd window and type in the command "ipconfig /all" and copy the results here.

Then, in the host, type in the command "route print" and copy the results here.

Once I see the output from those, I'll be able to tell you what is wrong.

vikas027 07-05-2010 10:23 PM

Quote:

Originally Posted by jiml8 (Post 4024700)
To sort this out, in each guest, in a shell window, type in the command "ifconfig -a" and copy the results here. You might need to be root in order to do this.

Then , for each guest, enter the command "route" (again you might have to be root) and copy the results here

Please find the below outputs from both the machines

Code:

FIRST VIRTUAL MACHINE
eth0      Link encap:Ethernet  HWaddr 00:0C:29:7C:DB:09 
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe7c:db09/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:5567 (5.4 KiB)
          Interrupt:67 Base address:0x2024

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:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2097 (2.0 KiB)  TX bytes:2097 (2.0 KiB)

sit0      Link encap:IPv6-in-IPv4 
          NOARP  MTU:1480  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)

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    *              255.255.255.0  U    0      0        0 eth0
169.254.0.0    *              255.255.0.0    U    0      0        0 eth0
default        192.168.1.1    0.0.0.0        UG    0      0        0 eth0




SECOND VIRTUAL MACHINE
eth0      Link encap:Ethernet  HWaddr 00:0C:29:AD:49:28 
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fead:4928/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:242 (242.0 b)  TX bytes:6837 (6.6 KiB)
          Interrupt:67 Base address:0x2024

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

sit0      Link encap:IPv6-in-IPv4 
          NOARP  MTU:1480  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)

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    *              255.255.255.0  U    0      0        0 eth0
169.254.0.0    *              255.255.0.0    U    0      0        0 eth0
default        192.168.1.1    0.0.0.0        UG    0      0        0 eth0







Quote:

Originally Posted by jiml8 (Post 4024700)
Then, in the host, open a cmd window and type in the command "ipconfig /all" and copy the results here.

Then, in the host, type in the command "route print" and copy the results here.

Once I see the output from those, I'll be able to tell you what is wrong.


Code:

IPCONFIG /ALL
C:\Users\vicky>ipconfig /all

Windows IP Configuration

  Host Name . . . . . . . . . . . . : GHAR
  Primary Dns Suffix  . . . . . . . :
  Node Type . . . . . . . . . . . . : Hybrid
  IP Routing Enabled. . . . . . . . : No
  WINS Proxy Enabled. . . . . . . . : No

PPP adapter TATA Indicom:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : TATA Indicom
  Physical Address. . . . . . . . . :
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  IPv4 Address. . . . . . . . . . . : 115.118.40.156(Preferred)
  Subnet Mask . . . . . . . . . . . : 255.255.255.255
  Default Gateway . . . . . . . . . : 0.0.0.0
  DNS Servers . . . . . . . . . . . : 202.54.15.30
                                      202.54.29.5
  NetBIOS over Tcpip. . . . . . . . : Disabled

Ethernet adapter Local Area Connection:

  Media State . . . . . . . . . . . : Media disconnected
  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet NIC
  Physical Address. . . . . . . . . : 00-02-3F-EC-80-CD
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes

Ethernet adapter VMware Network Adapter VMnet1:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
  Physical Address. . . . . . . . . : 00-50-56-C0-00-01
  DHCP Enabled. . . . . . . . . . . : Yes
  Autoconfiguration Enabled . . . . : Yes
  IPv4 Address. . . . . . . . . . . : 192.168.141.1(Preferred)
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Lease Obtained. . . . . . . . . . : Tuesday, July 06, 2010 6:24:55 AM
  Lease Expires . . . . . . . . . . : Tuesday, July 06, 2010 8:24:55 AM
  Default Gateway . . . . . . . . . :
  DHCP Server . . . . . . . . . . . : 192.168.141.254
  NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter VMware Network Adapter VMnet8:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
  Physical Address. . . . . . . . . : 00-50-56-C0-00-08
  DHCP Enabled. . . . . . . . . . . : Yes
  Autoconfiguration Enabled . . . . : Yes
  IPv4 Address. . . . . . . . . . . : 192.168.241.1(Preferred)
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Lease Obtained. . . . . . . . . . : Tuesday, July 06, 2010 6:24:09 AM
  Lease Expires . . . . . . . . . . : Tuesday, July 06, 2010 8:24:09 AM
  Default Gateway . . . . . . . . . :
  DHCP Server . . . . . . . . . . . : 192.168.241.254
  Primary WINS Server . . . . . . . : 192.168.241.2
  NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter Local Area Connection* 6:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : isatap.{1F27557F-8DAF-46EB-AD4A-A659E5FA3D5D}
  Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  Link-local IPv6 Address . . . . . : fe80::5efe:192.168.141.1%15(Preferred)
  Default Gateway . . . . . . . . . :
  NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Local Area Connection* 7:

  Media State . . . . . . . . . . . : Media disconnected
  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : isatap.{655CD020-8319-4605-8AD7-069177DDD251}
  Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Local Area Connection* 10:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : isatap.{7074D100-E642-431E-BF11-E3BF89C0AA5E}
  Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  Link-local IPv6 Address . . . . . : fe80::5efe:192.168.241.1%16(Preferred)
  Default Gateway . . . . . . . . . :
  NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Local Area Connection* 11:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
  Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  Link-local IPv6 Address . . . . . : fe80::200:5efe:115.118.40.156%24(Preferred)
  Default Gateway . . . . . . . . . :
  DNS Servers . . . . . . . . . . . : 202.54.15.30
                                      202.54.29.5
  NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Local Area Connection* 12:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : Microsoft 6to4 Adapter
  Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  Temporary IPv6 Address. . . . . . : 2002:7376:289c::7376:289c(Preferred)
  Default Gateway . . . . . . . . . : 2002:c058:6301::c058:6301
  DNS Servers . . . . . . . . . . . : 202.54.15.30
                                      202.54.29.5
  NetBIOS over Tcpip. . . . . . . . : Disabled


ROUTE
C:\Users\vicky>route PRINT
===========================================================================
Interface List
 23 ........................... TATA Indicom
  8 ...00 02 3f ec 80 cd ...... Realtek RTL8139/810x Family Fast Ethernet NIC
 12 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
 13 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
  1 ........................... Software Loopback Interface 1
 15 ...00 00 00 00 00 00 00 e0  isatap.{1F27557F-8DAF-46EB-AD4A-A659E5FA3D5D}
 14 ...00 00 00 00 00 00 00 e0  isatap.{655CD020-8319-4605-8AD7-069177DDD251}
 16 ...00 00 00 00 00 00 00 e0  isatap.{7074D100-E642-431E-BF11-E3BF89C0AA5E}
 24 ...00 00 00 00 00 00 00 e0  Microsoft ISATAP Adapter #4
 25 ...00 00 00 00 00 00 00 e0  Microsoft 6to4 Adapter
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway      Interface  Metric
          0.0.0.0          0.0.0.0        On-link    115.118.40.156    41
  115.118.40.156  255.255.255.255        On-link    115.118.40.156    296
        127.0.0.0        255.0.0.0        On-link        127.0.0.1  4531
        127.0.0.1  255.255.255.255        On-link        127.0.0.1  4531
  127.255.255.255  255.255.255.255        On-link        127.0.0.1  4531
  172.29.243.129  255.255.255.255  172.29.243.129  115.118.40.156    41
    192.168.141.0    255.255.255.0        On-link    192.168.141.1  4501
    192.168.141.1  255.255.255.255        On-link    192.168.141.1  4501
  192.168.141.255  255.255.255.255        On-link    192.168.141.1  4501
    192.168.241.0    255.255.255.0        On-link    192.168.241.1  4501
    192.168.241.1  255.255.255.255        On-link    192.168.241.1  4501
  192.168.241.255  255.255.255.255        On-link    192.168.241.1  4501
        224.0.0.0        240.0.0.0        On-link        127.0.0.1  4531
        224.0.0.0        240.0.0.0        On-link    192.168.241.1  4502
        224.0.0.0        240.0.0.0        On-link    192.168.141.1  4502
        224.0.0.0        240.0.0.0        On-link    115.118.40.156    41
  255.255.255.255  255.255.255.255        On-link        127.0.0.1  4531
  255.255.255.255  255.255.255.255        On-link    192.168.241.1  4501
  255.255.255.255  255.255.255.255        On-link    192.168.141.1  4501
  255.255.255.255  255.255.255.255        On-link    115.118.40.156    296
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0      192.168.1.1  Default
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
 25  1140 ::/0                    2002:c058:6301::c058:6301
  1    306 ::1/128                  On-link
 25  1040 2002::/16                On-link
 25    296 2002:7376:289c::7376:289c/128
                                    On-link
 15    281 fe80::5efe:192.168.141.1/128
                                    On-link
 16    281 fe80::5efe:192.168.241.1/128
                                    On-link
 24    296 fe80::200:5efe:115.118.40.156/128
                                    On-link
  1    306 ff00::/8                On-link
===========================================================================
Persistent Routes:
  None

Thanks in advance for your time and help.

jiml8 07-06-2010 01:45 AM

Your LAN is down on the vista host. You do not have a 192.168.1.* address specified anyplace, and you have no route specified for that IP range. Hence no communications between host and guests, though obviously from the correct routing tables on the guests they can talk to each other.

You have a lot of IP tunnels running on the host. I don't use Vista here, and I only recently deployed Windows 7 (as a VMWare virtual machine with a Linux host, as it happens), and I do recall vaguely something about problems with that tunneling feature and I turned it off on my Win 7 installation.

The one IPv4 address I see on your host is this one: 115.118.40.156. I infer from this that the Vista machine is directly facing the internet with no router between it and the internet. I do know that when I traceroute that address, it takes me to a location near Delhi, India; I presume this is your IP address.

If true, this is why you don't have a 192.168.1.* address for the host; that address range is non-routable and will only be provided for you if you have a LAN setup.

You have three choices. The one I would recommend is that you obtain a small router and place it between your Vista machine and the internet. This will greatly enhance your host computer's security, AND the router will provide a 192.168.x.x address, which you can set to be a 192.168.1.* address range. Thus your host and your guests will all be on the same LAN and will talk to each other.

Your second choice, which is less desirable for security reasons (Vista is vulnerable when exposed to the internet) is to switch from bridged networking in VMWare to host-only networking and make sure there is a route in the Vista host that points to the proper address range on the guests. In this way, your guests and your host will be able to talk with each other, though your guests will not be able to access the internet (they can't now anyway) unless you do IP forwarding or masquerading on the Vista host to allow them to reach the 'net.

As it happens, on my LAN, though I DO have a router in place, I also use host-only networking so that I can control my Windows guests' internet connections through my Linux host. I then masquerade the guests' IP addresses so that they can talk on the internet. This has proved useful for me since it makes it possible for me to control Windows 7's overwhelming desire to call microsoft all the time by using IPTables in Linux.

Your third choice is to use the NAT routing that VMWare provides, and manually set a route on your host that points to the interface (vmnet8, I think) so that you can talk to your guests. I haven't played with VMWare's NAT routing myself so I can't tell you in detail how to do it, and I don't know if it will set up the routing table in Vista or not, though I rather suspect it will.

vikas027 07-06-2010 02:52 AM

Quote:

Originally Posted by jiml8 (Post 4024855)
Your LAN is down on the vista host. You do not have a 192.168.1.* address specified anyplace, and you have no route specified for that IP range. Hence no communications between host and guests, though obviously from the correct routing tables on the guests they can talk to each other.

Your second choice, which is less desirable for security reasons (Vista is vulnerable when exposed to the internet) is to switch from bridged networking in VMWare to host-only networking and make sure there is a route in the Vista host that points to the proper address range on the guests.

Many thank Jim for such a detailed reply.

I would like to go with the second option.
Will the two VMs be able to interact with each other then ?
Also, could you please guide me, how to add a route in the Vista host to point the address range on the guests ?

My current range for the guest is configured in Cent OS are :-
Guest OS 1 (CentOS) - 192.168.1.10
Guest OS 2 (CentOS) - 192.168.1.20

jefro 07-06-2010 03:49 PM

jpeg 2 shows how to connect host only.

vikas027 07-06-2010 08:31 PM

Quote:

Originally Posted by jefro (Post 4025552)
jpeg 2 shows how to connect host only.

Thanks Jefro, but I do not know how to add a route in the Vista host to point the address range on the guests ?

I tried Host-Only, but then neither the machines could ping each other nor the host could connect it.

jefro 07-06-2010 09:16 PM

local only would mean the host can not connect.

Local only was for testing.

On local what is ifconfig? No need for gateway. If ping is unblocked then it should work.

jiml8 07-07-2010 09:17 AM

If you set up host only networking, I would expect Vista to handle all details of routing for you. The vmnet1 adapter should be enabled and assigned an IP address (using your current configuration, you probably would want vmnet1 to have 192.168.1.1 for its address).

You probably should just use DHCP, at least initially, for setup of host-only networking.

If Vista does not provide a route to the vmnet1 adapter, you would do it from a command line window using the ROUTE ADD command. Examples of syntax are automatically shown for you when you when you type in just the word ROUTE.


All times are GMT -5. The time now is 03:07 AM.