Solved

Setting up host-only connection to Linux on Vmware

Posted on 2006-07-08
9
11,139 Views
Last Modified: 2013-12-06
I need to get my VMWare host machine (Win XP home) connect to a VMWare 5.5 client (Red Hat Enterprise Linux 4) in host-only mode. I'd be very happy if I could ping the machines from each other. The host is running the VMWare DHCP service. But whatever I try, the connection seems to fail.

Unfortunately I am neither a VMware nor a Linux specialist. So it's a bit of a challenge and I guess I can't even post a descriptive error message. I have tried too much, and lost control of what might be important and what is irrelevant. etc\hosts, vmnet8, xp firewall, ping, localhost, 10.10.10.0, 127.0.0.1. It's all a lot of confusion in my head at the moment.

Can anyone give some general recommendation on how to set this up? Or can you give me some hints on what I should test so that I can post some meaningful test resulsts here?
0
Comment
Question by:EwaldL
9 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 17066552
Best I explain the network options available first for your VMWare client:

1.    Bridged - This effectively means the the vmware client has it's own ethernet adaptor which co-exists with the ethernet adaptor of the vmware host. So if the VMWare host is 192.168.1.10, and the VMWare client is 192.168.1.11, then the vmware client can ping the host, and also access the outside world. The vmware client appears to the outside world and is accessible from the outside world as 192.168.1.11 - A few oddities occur here. If you ping the client 192.168.1.11, you get 2 ping responses!

2.    NAT. - Imagine VMWare host is 192.168.1.10, and VMWare client is 192.168.1.11 With this, the client can happily ping the host. It can also access the outside world provided it designates the host 192.168.1.10 as the gateway, and traffic from the client appears to come from the host, and the client is not directly accessible from outside the WMWare host server, unless the host forwards specific ports on to the client.

3.    Host Only - Communication can occur between the client and the host. Client is not visible to the outside world at all. To show what is going on, here is the ifconfig from the host(A linux host):

vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01
          inet addr:172.16.18.1  Bcast:172.16.18.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:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

What should have happened IMHO, but does not for some reason is that eth0 in the VMWare client should be started as 172.16.18.2 (or similar). Unfortunately, on my test setup it did not! - A bug? However, easily resolved on vmware client:

ifconfig eth0 172.16.18.2 netmask 255.255.255.0 up

This sets up the eth0 to be on the same subnet as the vmnet1 created on the host. You will probably need to run a similar command to this on your RHEL4 system in order to have eth0 functioning. Not that then subnets picked by VMWare appear to be fairly random.

4.    Custom - Not sure really what you'd need this for unless perhaps creating a dedicated firewall virtual appliance or something exotic. You probably don't want to use this anyway!

First check that the RHEL4 client has networking working:

At a command prompt on the RHEL4 system:

ifconfig

You should have localhost and eth0 as a minimum, and may have eth1,eth2 etc - If not present, try the ifconfig eth0 up command process detailed above. (in 3)

Try the client pinging itself?

Now try pinging the host.

Hopefully it all works now? ;)

If you have a problem, then please provide the 'ifconfig' output from the RHEL4 system, and the network configuration for the host (ifconfig if linux, and ipconfig if windows).

(   (()
(`-' _\
 ''  ''


0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 17066555
You have set up a VMWare client with host-only network connection - is that right? Normally I use bridged networking, so I'm guessing a bit.
In the XP system, get a COMMAND window (or maybe CMD, one of them should work).
In that window, issue the command

  ipconfig

which should show you the VMWare simulated ethernet controller, including its IP address. Ping that IP address. (ping will be available in the same window)
If that gives no response, go to the guest system and try:

  ifconfig

Notice that Linux (and Unix generally) has ifconfig but windows has ipconfig. Both commands have an option to show controllers that don't have an IP address assigned: "ifconfig -a" and "ipconfig/all". These may show that Linux didn't receive its IP for instance.
If you're still having no luck, post output from those 2 and anything else you think might be useful.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17067115
> .. VMWare host machine (Win XP home)  ..
using an incomplete and unreliable OS as host, you seem to be courageous ;-)

Anyway, does this problem occour when you have your host plugged to a working network on the interface you configured as host-only? Otherwise M$ disables the NIC and its drivers and you cannot reach any other mashine connected to that NIC even your own virtual ones) for obvious reason.
If you have a network, then check your routing on both ends with:
  netstat -rn
they should have at least a route for your network
If so, you need to check your firewall on both ends. I'd start with Linux 'cause its simpler there:
  iptbales -L -n -t nat&&iptables -L-n -t mangle&&iptables -L -n
please post results
0
 
LVL 13

Author Comment

by:EwaldL
ID: 17067357
Thank you all for the help! It's still not working, so here's the test results.

I chose host-only because I thought it's the simplest option. Maybe I should continue in bridged mode? When going into bridged mode, the Linux system (VMware client) could actually get access to the internet through the hosts connection. So somehow a connection from the vmware client to the host must have existed? When going into bridge mode now however, the linux system cannot see the Internet. It has an Apache Tomcat installed, which used to work. But If I try to view it now (open firefox on linux and browse to localhost:8080), I am getting the message "The connection was refused when attempting to contact localhost:8080". When trying to view google in firefox I get "www.google.com could not be found". I wish I coulud tell what has changed so that I does not work now. When trying to get the results of the ifconfig to my host machine, I noticed that even teh VMWare shared folder that I had set up from host to client is not accessible anymore, even though it's enabled.

Anyway, ifconfig -a on the linux client returns :

eth0      Link encap:Ethernet HWaddr 00:0C:29:78:DO:FE
      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 frame:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
      Interrupt:10 Base address:0x1400

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:2660 errors: 0 dropped:0 overruns:0 frame:0
       TX packets:2660 errors: 0 dropped:0 overruns:0 frame:0
      collisions:0 txqueuelen:0
      RX bytes:3328976 *3.1 MiB) TX bytes:3328976 (3.1 MiB)

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 frame:0
      collisions:0 txqueuelen:0
      RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Can you advise what parameters I should pass into the "ifconfig eth0" command?

Ipconfig shows this:
C:\Documents and Settings\Forster>ipconfig

Windows IP Configuration

Ethernet adapter VMware Network Adapter VMnet8:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.232.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.117.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.1.33
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1

C:\Documents and Settings\Forster>

So if I try to ping VMWare's Ethernet adapter (192.168.232.1), I do actually get a response! Is this coming from the Linux system then?

The host computer is on an internet connection, that is active. Netstat -rn returns on linux
Destination    Gateway    Genmask
169.254.0.0  0.0.0.0       255.255.0.0

Netstat -rn returns on the windows host
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Forster>ping 169.254.0.0

Pinging 169.254.0.0 with 32 bytes of data:

Request timed out.
Reply from 193.95.131.41: Destination host unreachable.
Reply from 193.95.131.41: Destination host unreachable.
Request timed out.

Ping statistics for 169.254.0.0:
    Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\Forster>ping 169.254.0.0

Pinging 169.254.0.0 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

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

C:\Documents and Settings\Forster>ipconfig

Windows IP Configuration


Ethernet adapter VMware Network Adapter VMnet8:

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

Ethernet adapter VMware Network Adapter VMnet1:

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

Ethernet adapter Local Area Connection:

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

C:\Documents and Settings\Forster>ping 192.168.117.1

Pinging 192.168.117.1 with 32 bytes of data:

Reply from 192.168.117.1: bytes=32 time<1ms TTL=128
Reply from 192.168.117.1: bytes=32 time<1ms TTL=128
Reply from 192.168.117.1: bytes=32 time<1ms TTL=128
Reply from 192.168.117.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.117.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\Forster>ping 192.168.232.1

Pinging 192.168.232.1 with 32 bytes of data:

Reply from 192.168.232.1: bytes=32 time<1ms TTL=128
Reply from 192.168.232.1: bytes=32 time<1ms TTL=128
Reply from 192.168.232.1: bytes=32 time<1ms TTL=128
Reply from 192.168.232.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.232.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x4 ...00 11 43 78 b6 d7 ...... Broadcom 440x 10/100 Integrated Controller - Pac
ket Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1    192.168.1.33       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.1.0    255.255.255.0     192.168.1.33    192.168.1.33       20
     192.168.1.33  255.255.255.255        127.0.0.1       127.0.0.1       20
    192.168.1.255  255.255.255.255     192.168.1.33    192.168.1.33       20
    192.168.117.0    255.255.255.0    192.168.117.1   192.168.117.1       20
    192.168.117.1  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.117.255  255.255.255.255    192.168.117.1   192.168.117.1       20
    192.168.232.0    255.255.255.0    192.168.232.1   192.168.232.1       20
    192.168.232.1  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.232.255  255.255.255.255    192.168.232.1   192.168.232.1       20
        224.0.0.0        240.0.0.0     192.168.1.33    192.168.1.33       20
        224.0.0.0        240.0.0.0    192.168.117.1   192.168.117.1       20
        224.0.0.0        240.0.0.0    192.168.232.1   192.168.232.1       20
  255.255.255.255  255.255.255.255     192.168.1.33    192.168.1.33       1
  255.255.255.255  255.255.255.255    192.168.117.1   192.168.117.1       1
  255.255.255.255  255.255.255.255    192.168.232.1   192.168.232.1       1
Default Gateway:       192.168.1.1
===========================================================================
Persistent Routes:
  None

Oh, one thing that might be unusual is that I had to change the /etc/host file slightly. I had to change teh ip numger to
127.0.0.2   dhcppc2 localhost.localdomain localhost

Using 127.0.0.1 I would get the warning on startup: "could not look up internet address for dhcppc2. This will prevent GNOME from operating correctly. It may be possible to correct the problem by adding dhcppc2 to the file /etc/hosts.". What I did was that I installed linux on vmware, when it was working fine I made a backup of the vmware files so I keep a clean linux system if things get messed up. Currently I am working on the backup. So the "clean" linux is still there.

I just don't know what to make of those results. Have you got any ideas?
Thanks a bunch!
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 13

Author Comment

by:EwaldL
ID: 17067365
Sorry guys, please ignore the earlier post. I had a lot of command output of the windows system that I didn't want to post. It just blows up the above posting. Here's what I wanted to post. And I had also run this command on linux
iptables -L -n -t nat&&iptables -L-n -t mangle&&iptables -L -n

Thank you all for the help! It's still not working, so here's the test results.

I chose host-only because I thought it's the simplest option. Maybe I should continue in bridged mode? When going into bridged mode, the Linux system (VMware client) could actually get access to the internet through the hosts connection. So somehow a connection from the vmware client to the host must have existed? When going into bridge mode now however, the linux system cannot see the Internet. It has an Apache Tomcat installed, which used to work. But If I try to view it now (open firefox on linux and browse to localhost:8080), I am getting the message "The connection was refused when attempting to contact localhost:8080". When trying to view google in firefox I get "www.google.com could not be found". I wish I coulud tell what has changed so that I does not work now. When trying to get the results of the ifconfig to my host machine, I noticed that even teh VMWare shared folder that I had set up from host to client is not accessible anymore, even though it's enabled.

Anyway, ifconfig -a on the linux client returns :

eth0     Link encap:Ethernet HWaddr 00:0C:29:78:DO:FE
     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 frame:0
     collisions:0 txqueuelen:1000
     RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
     Interrupt:10 Base address:0x1400

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:2660 errors: 0 dropped:0 overruns:0 frame:0
      TX packets:2660 errors: 0 dropped:0 overruns:0 frame:0
     collisions:0 txqueuelen:0
     RX bytes:3328976 *3.1 MiB) TX bytes:3328976 (3.1 MiB)

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 frame:0
     collisions:0 txqueuelen:0
     RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Can you advise what parameters I should pass into the "ifconfig eth0" command?

Ipconfig shows this:
C:\Documents and Settings\Forster>ipconfig

Windows IP Configuration

Ethernet adapter VMware Network Adapter VMnet8:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.232.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.117.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.1.33
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1

C:\Documents and Settings\Forster>

So if I try to ping VMWare's Ethernet adapter (192.168.232.1), I do actually get a response! Is this coming from the Linux system then?

The host computer is on an internet connection, that is active. Netstat -rn returns on linux
Destination    Gateway    Genmask
169.254.0.0  0.0.0.0       255.255.0.0

Netstat -rn returns on the windows host

Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x4 ...00 11 43 78 b6 d7 ...... Broadcom 440x 10/100 Integrated Controller - Pac
ket Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1    192.168.1.33       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.1.0    255.255.255.0     192.168.1.33    192.168.1.33       20
     192.168.1.33  255.255.255.255        127.0.0.1       127.0.0.1       20
    192.168.1.255  255.255.255.255     192.168.1.33    192.168.1.33       20
    192.168.117.0    255.255.255.0    192.168.117.1   192.168.117.1       20
    192.168.117.1  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.117.255  255.255.255.255    192.168.117.1   192.168.117.1       20
    192.168.232.0    255.255.255.0    192.168.232.1   192.168.232.1       20
    192.168.232.1  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.232.255  255.255.255.255    192.168.232.1   192.168.232.1       20
        224.0.0.0        240.0.0.0     192.168.1.33    192.168.1.33       20
        224.0.0.0        240.0.0.0    192.168.117.1   192.168.117.1       20
        224.0.0.0        240.0.0.0    192.168.232.1   192.168.232.1       20
  255.255.255.255  255.255.255.255     192.168.1.33    192.168.1.33       1
  255.255.255.255  255.255.255.255    192.168.117.1   192.168.117.1       1
  255.255.255.255  255.255.255.255    192.168.232.1   192.168.232.1       1
Default Gateway:       192.168.1.1
===========================================================================
Persistent Routes:
  None

Oh, one thing that might be unusual is that I had to change the /etc/host file slightly. I had to change teh ip numger to
127.0.0.2   dhcppc2 localhost.localdomain localhost

Using 127.0.0.1 I would get the warning on startup: "could not look up internet address for dhcppc2. This will prevent GNOME from operating correctly. It may be possible to correct the problem by adding dhcppc2 to the file /etc/hosts.". What I did was that I installed linux on vmware, when it was working fine I made a backup of the vmware files so I keep a clean linux system if things get messed up. Currently I am working on the backup. So the "clean" linux is still there.

I just don't know what to make of those results. Have you got any ideas?
Thanks a bunch!
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 17067389
Yep:

eth0     Link encap:Ethernet HWaddr 00:0C:29:78:DO:FE
     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 frame:0
     collisions:0 txqueuelen:1000
     RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
     Interrupt:10 Base address:0x1400

on your Linux client has no ip address configured, therefore:

ifconfig eth0 192.168.117.2 netmask 255.255.255.0 up

Will allocate 192.168.117.2 to your linux eth0. You should then be able to ping 192.168.117.1 on the windows system:). It's exactly the same 'bug' that I noticed on my system.

(   (()
(`-' _\
 ''  ''



0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17067392
Alternatively (in order to make sure that the network configuration works for susequesnt startups, you need to run:

netconfig

(   (()
(`-' _\
 ''  ''

0
 
LVL 13

Author Comment

by:EwaldL
ID: 17067673
Fantastic, the ifconfig command got it working! Thanks a million!
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17067691
...but remember that the ifcommand only works for the current session. If you want it to work immediately after reboot, you need to configure eth0 with 'netconfig' or your favourite networg configuration process.

(   (()
(`-' _\
 ''  ''
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now