[SOLVED] Host OS unable to connect to Guest OS (virtual machines) in VMware
Linux - Virtualization and CloudThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Host OS unable to connect to Guest OS (virtual machines) in VMware
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.
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.
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
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
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
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
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),
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.
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
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.