FlorianLR’s Blog

Comments about life

fixing VMWare NAT problems on Windows 7

Posted by langbogen on July 9, 2009

The current version of VMWare (Workstation 6.5.1, 6.5.2, Server 2.0.1, Player) doesn’t support NAT on Windows 7 (RC1). Typically you can ping servers and do nslookups but not use your Internet Browser or ssh/telnet etc.
But you can use the Internet Connection Sharing (ICS).

A more complex solution by removing all virtual adapters can be found in this VMWare Forum thread but this made some troubles on my PC so I simplified these instructions.

First Step: change virtual IP

  1. Run “Manage Virtual Networks” (VMWare Player: start vmnetcfg.exe from installation directory) with administrave rights
  2. go to “Host Virtual Network Mapping” tab, select the “>” next to VMnet1 and (if necessary) change the subnet to something different than 192.168.137.0 (for example 192.168.50.0) and click apply
  3. go to “Host Virtual Network Mapping” tab, select the “>” next to VMnet8 and change the subnet to 192.168.137.0 and click apply
  4. go to “NAT” tab, click edit and change gateway IP adress to 192.168.137.1 and click apply

It is not necessary to restart the NAT service.

Second Step: enable ICS

  1. open the “Network and Sharing Center” and click “Change adapter settings”
  2. open the properties of your LAN-Connection, go to the “sharing” tab and enable “allow other network users to connet through this computer’s internet connection” and select to connect through VMnet8
  3. windows tells you that it will assign IP 192.168.137.1, click OK

Third Step: check VMs

If you have configured a fixed IP inside your VM you must change the IP4 Gateway and DNS1 to 192.168.137.1

Note 1: Port forwarding has to be configured using the ICS Settings button, not the VMWare NAT-Dialog.

Note 2: Windows 7 Beta seems to use 192.168.37.1 as IP für ICS.

Note 3: no Windows Firewall changes are necessary

 

[Update Sep 2011] Take also a look at this comment on how to use the vmnat.exe fromVMWare Player to fix the Problem.

About these ads

78 Responses to “fixing VMWare NAT problems on Windows 7”

  1. tom jack said

    but i cant find the VMnet8 at properties of LAN-Connection
    how to fix it?

    • James said

      Open the Network and Sharing center, then click on ‘Change Adapter Settings’. Right click on your Local Area Connection, and select ‘Properties’. Click on the ‘Sharing’ tab at the top of the Local Area Connections Properties windows that opened and check the box for ‘Allow other network users…’. In the drop down menu below labelled ‘Home networking connection select ‘VMware Network Adapter VMnet8′.

      If you have problems with the VMware Network Adapters triggering the public profile for networking then use the powershell script given here http://www.nivot.org/2008/09/05/VMWareVMNETAdaptersTriggeringPublicProfileForWindowsFirewall.aspx to turn off endpoint detection for the VMware virtual networking adapters. You will need to run the script with elevated permissions and have to reconfigure (temporarily) your powershell execution policy (SetExecution-Policy unrestricted) for it to work.

    • langbogen said

      Do you want to know which adapter is which? Open the Network and Sharing center, then click on ‘Change Adapter Settings’. By default they are often named ‘LAN Connection 2′ and ‘LAN Connection 3′. Right click on the connection and select ‘Properties’. In the ‘Connect using:’ Field you can see if it’s VMNet 8 or another one.
      Personally I recommend to rename them (right click + ‘Rename’) to ‘VMnet1′ and ‘VMnet8′.

  2. Jacky said

    Thank you, simple and works like a charm!

  3. rjm said

    Thank you for this elegant solution.

  4. Sorin said

    Thanks! Worked great! I wish I found your blog a few hours earlier though :)

  5. Dave O. said

    Thanks for the tip. I wasnt even aware of this until a friend of mine forwarded it to me.

    Just to confirm, this is still an issue in Win7 RTM. I am running it currently and have had to implement the above workaround to make NAT work.

    To change the subnet, I tweaked a reg setting to the IP of the VMnet8 NIC. This allowed me to keep my desired subnet. (I use Wkst for testing PXE booting and other things where IPs and DHCP scopes and other things need to be consistent between re-installs…for most people the actual subnet is a moot point and 192.68.137.0 will work fine for them.)

    Here is the key:
    HKEY_LOCAL_MACHINE\system\currentcontrolset\services\sharedaccess\parameters
    ScopeAddress REG_SZ 192.168.88.254

    It is 192.168.137.0 by default. I changed it to 192.168.88.254 to match my needs. I dont think the host octet of the IP address matters…windows just figures in the /24 of the IP address.

    Also, some other things I found and added to my “to do” list for Wkst on Win7:

    * Create a firewall rule to allow all traffic from your VMnet8 Subnet to access the VMnet8 interface. I run FTP and TFTP (for PXE) off of that interface, so the NAT’ed VMs actually do interact directly with my Win7 host.

    * I actually remove the VMnet1 interface (host only), as I have never used it. That may help with trying to figure all this out. It’s one less interface and one less route in the routing table to have to deal with. :) (Edit –> Virtual Network Editor… –> Host Virtual Adapters Tab. Click on VMnet1 and click Remove button)

    * I disable VMware NAT completely from within VMware Wkst (Edit –> Virtual Network Editor… –> NAT tab; set pull down menu to “Disable”). It still leaves my VMnet8 interface intact, but it disables the NAT service. (the VMware NAT service doesnt work anyways…why have it running?) But this also removes the default gateway from the VMware DHCP service. You can add that back in by modifying c:\programdata\vmware\vmnetdhcp.conf. Just add the following line in the block that specifies DNS servers, domain name, etc:
    option routers 192.168.88.201;

    Thanks for the tip. This was a huge issue for me when I finally realized it existed.

    Hope my additional tips help!

    Dave O.

  6. [...] Using VMWare 6.5.2 and NAT does not work out of the box, using the steps on https://florianlr.wordpress.com/2009/07/09/5/ solved the problem. Share and [...]

  7. Sncboom2k said

    I have the same issue, but I’m not able to install a driver for the VMNET host adapters…. Very frustrating. My windows 7 x64 is the RTM version and when I install or repair my VMWare 6.5.2 – it does not install the drivers for the net adapters and both 1 & 8 show up as “Unknown device” in my Device Manager. (My host PC is the Win 7 x64).

    Can anyone shed some light on this for me so I can use the great fix listed above?

    Thanks in advance for any help.

  8. Nikkor said

    Thank you VERY MUCH for posting this. I spent a day trying to figure out the broken networking w/ Windows 7 x64 Host & VMWare 6.5.2. This worked very well. One note to help others, the IP address Dave O mentioned setting in the registry is the IP address of the VMs it is not the IP address of the network you are connecting to.

    Thanks again!

  9. Carlos said

    Worked great with Win7 RTM… after a reboot. Thanks!

  10. Swzmaster said

    thanks for this tip, working for me

  11. thanks a ton. worked like a charm.

  12. tinba said

    followed your instructions, but didn’t work for me.

    Win7 32-bit host. Win2003 guest. ICS on, VMnet8 changed. Have no idea what I’m doing wrong.

    • langbogen said

      Hi tinba, did you try to give your guest a fixed IP? In some (seldom) cases this was necessary to fix the problem.

  13. Magrat Garlick said

    Brilliant!

    I’m running Win RC1 64bit, vmWare Server 2 and a virtual WinXP. I’ve been going round and round in circles these last two night trying to get both folder sharing and internet together. Bridge gave me Internet, NAT gave me sharing. Now, thanks to you, I have both.

    TTFN
    Magrat.

  14. Mike said

    Worked like a charm on vmware server 2
    However you must reboot after making the changes.
    Thanks,
    Mike

  15. Ricky said

    Darn, I also followed the instructions,

    got win7 x64 running as host and a red-hat as vmclient

    ICS is running on local area connection (IP=192.168.1.67) with vmnet8(NAT) 192.168.137.1

    Got ICS forwarding with telnet, ftpserver on

    192.168.137.1 is also the gateway, vmclient ip = fixed 192.168.137.4

    I can telnet from the client to the internet everywhere,
    I can telnet from the host to the client without any problems…
    but if I try to telnet from a machine (192.168.1.71) to the vmclient it wont respond. :-(

    Any help would be very much appreciated!

    Thanx,

    Ricky

    • langbogen said

      Port forwarding has to be configured using the ICS Settings button. You must configure, which external Port should be mapped to which internal IP+Port.
      So for Telnet configure a forwarding from external Port 23 to internal address 192.168.137.4 Port 23.
      On my machine this runs without problems.

      • Ricky said

        I actually tried that both with vmware server 2 and workstation 7.

        The major problem was that the firewall integrated in windows 7 didn’t let anything through.

        After setting the rules correct it works like a charm!

        But thanks very much for the reply!

  16. Mike H. said

    It worked perfectly! Thanks!

  17. Paulo Dani said

    Worked with Windows 7 professional as host, ubuntu 9.10 server as guest. Port forwarding via ICS also worked.

    Thanks.

  18. shanon said

    THANK YOU SO MUCH.

    I was looking everywhere for a fix. Honestly, I was almost going to revert back to an older OS.

    You’re the man.

  19. Dara Harb said

    This does not seem to work if the host’s network (first two octets) is different from the VMNet’s (for example a /16 for the host network and 192.168.x.x for the vmnet).

    I’d really like an eta from VMware on when they plan to fix this.

  20. Ramon said

    Thank you, langbogen. Worked fine for me.

  21. Bernardo said

    Thanks for the tip.

    For some strange reason, while this fixes internet access, it seems to screw up pinging in return in my case. Took me a while to realize that internet was actually working while ping was not.

    • Bernardo said

      To follow up my last comment, started running into “drop out” problems with your version, in addition to the not working pings.

      Disabling the VMware NAT service from the Services panel in Windows 7 (not through VMware) seems to have fixed both issues. I’d guess that perhaps the NAT from Windows’ ICS was conflicting with the VMware’s own NAT or something.

  22. hacene15 said

    I m running Win7 as host with vmware 7.0.1, I Have Installed Windows server 2008 server entreprise as virtual machine, But when I try to setup static IP adress for the server there is no connectivity between the Workstation and server W2k8 (Win7 and w2k8) I thought it is NAT problem, I spent an entire day find out the problem. I find some clues but its only on vmware 6.5 not same interface with Vmware 7.0.1. Please help.
    Thank you.
    I just repost this, I have corrected some error ;-)

    • langbogen said

      Hi, I am using VMWare Player 3 which has no NAT Problems with Win7 anymore. It has been released side-by-side with WMare Workstation 7.x so I think NAT Problem won’t effect Workstation 7.
      Did you check the static settings for IP, Gateway and DNS? The IP should be on the same network (e.g. VMNet8 is 192.168.137.x, then use e.g. 192.168.137.128 as IP and 192.168.137.2 as Gateway and DNS. The “137″-Subnet is a random Number and depends on your installation, if you did’nt make changes “.2″ is the default Gateway/DNS). If this does not resove the Problem I recommend to post a message to the vmware.com Forum.

  23. Brian said

    Thanks! It worked for me!

  24. Scott said

    Thanks; enabling ICS does work for me in Windows 7.

    However, ICS is not compatible with many or all Cisco VPNs. e.g. my VPN AnyConnect client cannot establish a VPN if ICS is enabled on the public interface.

    If your VM needs to contact a server on the other side of the VPN… sorry.

  25. [...] All Thanks a lot!! I managed to fix the problem by following the instructions at https://florianlr.wordpress.com/2009/07/09/5/ . It is the problem with Windows7 and VMware. Had got nothing to do with Linux as such. Best [...]

  26. [...] a lot Yas for looking into the problem. I finally got it fixed by following the instructions at https://florianlr.wordpress.com/2009/07/09/5/ . The problem is with Windows7 and VMware and not with Linux. @John – If you do not know the [...]

  27. DY said

    Well, it’s June 2010 and I can say a fresh download of VMware server 2 has the same issue and this fixed it. Wow, as if I have enough problems with ESX licensing for our organization now this? VMware: if you’re listening, this isn’t how you release products.

  28. BTR Naidu said

    After following the instruction, my VMnet8 shows bellow configuration –

    Ethernet adapter VMnet8:

    Connection-specific DNS Suffix . :
    Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
    Physical Address. . . . . . . . . : 00-50-56-C0-00-08
    DHCP Enabled. . . . . . . . . . . : No
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::9851:8d6d:3a08:482%30(Preferred)
    IPv4 Address. . . . . . . . . . . : 192.168.137.1(Preferred)
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :
    DHCPv6 IAID . . . . . . . . . . . : 855658582
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-BE-2C-22-00-23-14-C8-B7-7C
    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%2
    fec0:0:0:ffff::2%2
    fec0:0:0:ffff::3%2
    NetBIOS over Tcpip. . . . . . . . : Enabled

    And the guest running XP shows below

    Ethernet adapter Local Area Connection:

    Connection-specific DNS Suffix . : localdomain
    Description . . . . . . . . . . . : VMware Accelerated AMD PCNet Adapter
    Physical Address. . . . . . . . . : 00-0C-29-BC-0D-63
    Dhcp Enabled. . . . . . . . . . . : Yes
    Autoconfiguration Enabled . . . . : Yes
    IP Address. . . . . . . . . . . . : 192.168.137.128
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 192.168.137.1
    DHCP Server . . . . . . . . . . . : 192.168.137.254
    DNS Servers . . . . . . . . . . . : 192.168.137.1
    Primary WINS Server . . . . . . . : 192.168.137.1
    Lease Obtained. . . . . . . . . . : Thursday, July 15, 2010 4:05:33 PM
    Lease Expires . . . . . . . . . . : Thursday, July 15, 2010 4:35:33 PM

    Problem is with DNS. My guest does not resolve any domain (google.com / yahoo.com). If I try to brows with IP, it works fine. Any ideas how to resolve this?

    • BTR Naidu said

      BTW: I have a working solution by adding DNS manually on the guest (xp) adaptor. But this has to be done every time I connect to a new network which is bit painful. I am looking for some automatic solution.

      • langbogen said

        In your first post this line looks good and should work:
        DNS Servers . . . . . . . . . . . : 192.168.137.1

        Have you tried to turn off DHCP in your guest network adapter settings and configure IP/Subnet/Gateway and DNS manually? Windows should remember these settings always.

  29. Me said

    ICS is disabled by my administrator. So I cannot enable it. Any help? Any workaround to fix this no internet access issue under win7? Thanks.

  30. Awesome | Awesome | Awesome…….
    Really too much happy because you have solved this problem in minutes and I had been wondering on search engines for last one week to find out the solution but of no use.

    Wew…Finally I found this thread…Thanks YOU “Langbogen” (Oscar for you)

    Thanks again!

  31. Charlie said

    Thanks Mmmmmillion,,

    It works right away and saved a time,

    CHarlie

  32. Alex said

    Perfect work.

    Thank you very much!

  33. Frank said

    Was stuck on a networking lab assignment for school requiring NAT but this fixed all of my problems.

    Thank you!

  34. Denisio said

    Works Fine with Windows Server 2008 R2 too :D

  35. This was a great help, the only comment is that I couldn’t get it to work *with* a fixed IP within the guest OS (Windows Server 2008 R2 on a Windows 7 Pro 64 host) or *without* 192.168.137.1 as the preferred DNS.

  36. Sunu said

    Thanks for this article.

    I had an issue with NAT (Vmnet8) on Win7 x64 whereby it could not access Internet.

    Your steps above fixed my problem straight away.

    Cheers!

  37. Augusto Alonso said

    Just another quick sollution:

    Install OpenVpn (inside the Virtual Machine) and connect It.

    NAT works with UDP packets, the same as ICMP packets (ping).

    Or you can find some apps for hiding your IP that are based on OpenVpn, and will do the trick…

    Cheers

  38. Anita said

    Hi,
    Thank you for posting these instructions. However, I’m still having network problems from my guest OS (SuSE linux).
    My host is Windows 7 professional. I have a couple of questions:
    Do I set the Network adapter in the virtual machine settings to NAT or Host-Only?
    How do I find out if I have a fixed IP and how do I change this within Linux?
    Many thanks,
    Anita

    • langbogen said

      Hi,
      the virtual network adapter has to be set to NAT. For Linux take a look e.g. at this page: http://www.cyberciti.biz/faq/linux-change-ip-address/

      • Anita said

        Thank you for your reply.

        I also have a problem with First Step, number 4:
        When I go to the NAT tab and change the gateway IP address to 192.168.137.1 I get an error message
        “Gateway IP does not match the subnet IP address”. I have the NMnet host option set to VMnet 1 in the drop down menu.

        I also tried this with VNnet 8 selected in the NAT tab but get an error code (183). I also tried restarting my computer, but no luck there.

        Do you have any advice on what I’m doing wrong?

        Many thanks,

        Anita

  39. Zahir said

    Thanks, yap still checking vmware-v6.5.1 and windows7 as host.

  40. Amit Mirchandani said

    Thank you. It worked for me.
    just fyi i had to restart host’s internet connection.
    thanks again.

  41. Maria said

    I COULD NOT figure this out to save my freakin life. THANK YOU for the workaround.

    My situation was:
    Win7 64bit machine running Centos55 guest.
    I set the guest nic to nat, and config’d the guest with a static IP. I got port forwarding to work like a champ using the vmware network editor, but from the guest os i then could not access webpages, telnet servers out on the net, yet i could ping things on the net no problem. Presuming it was a nat issue, not a routing issue, I googled “vmware server nat transversal” and got to this site.

    I followed the ICS solution above, using my own ips, and it didnt work right away. I had to disable the VMWare NAT networking service in services.msc in Win7. Once that service was disabled, all was well. I didnt have to reboot/restart anything.

    Thank you!

  42. Dennis Teixeira said

    Thanks for this post! You save many lifes…. :-)
    One question: running Windows 2008 x64, this configuration of ICS do not work, but, in Windows 2003 x64 work normally.
    Somebody have any tips for this?

    Thanks for all!

  43. Thanks, It worked like a charm. I always got ‘connected’ bit then ‘server time out’ . This trick done the magic. Thanks again.

  44. Nico said

    work fine ! reboot your VM and everything is OK.

    Thanks a lot

  45. [...] Step 1 – Follow the guidelines as mentioned here [...]

  46. ItsMe said

    I you don’t want to use ICS:, you can solve the problem this way:

    The problem is caused by the “vmnat.exe” shipped with VMware Server 2.0.2. To solve the problem, you have to use the new “vmnat.exe” in VMware player.

    1. First, install VMware Player on some other computer, or in a VM, and copy the entire directory “C:\Program Files (x86)\VMware Play\” to some where else (e.g. “D:\VMware Play\”).

    3. The last step is to change the “VMware NAT Service” service to make it invoke the new “vmnat.exe”.

    3.1 Open Services in Control Panel, and stop the service “VMware NAT Service”.

    3.2 Copy the new “vmnat.exe” to “C:\Windows\SysWOW64\” to replace the old “vmnat.exe”.

    3.3 Start the service “VMware NAT Service”.

    I’m currently working under such configuration, and the guest systems can access the Internet without problem.

    • langbogen said

      Thank you for your comment, thats a very interesting option!!!

    • Walt Wimer said

      Thank you for your post! Your technique worked for me! For others, here’s what I did:

      I presumed that since we’re talking about VMware Server 2.x here, it would be best to use the vmnat.exe from VMware Player 2.x. Unfortunately, as of the date that I am writing this, only VMware Player 3.x and 4.x are available on the VMware website. So, I chose the latest 3.x version, 3.1.6. Per your suggestion, I installed Player inside a VM in order to avoid any conflict with VMware Server 2.x. I happened to already have Microsoft’s XP Mode on my Windows 7 system, so I just booted up the XP Mode virtual machine, used Internet Explorer under XP to download VMware Player 3.1.6 from the VMware website, and installed it under XP. (I didn’t bother actually running it or anything.) I found Player’s copy of vmnet.exe and copied it over to home directory under Windows 7. I then ran Windows Explorer as Administrator under Win7. I renamed the original vmnat.exe files under Win7 to vmnat-2.0.exe. There was a copy in \Windows\System32 and a copy in \Program Files\VMware\VMware Server under Win7. I renamed both of them, and copied in the new vmnat.exe in both places. (Probably only the copy in \Windows\System32 actually matters…)

      I then shut everything down cleanly and restarted Windows 7.

      When Windows 7 came back up, I was able to launch my Fedora 17 virtual machine under Windows 7 and it successfully worked with NAT! Hurray!!!

      Thanks again!!!

      Walt

      • Walt Wimer said

        Any references above to “vmnet.exe” should say “vmnat.exe”… That was purely a typo on my part… The only file that matters is “vmnat.exe”.

    • Nisha said

      Steps from ItsMe have worked like magic… thanks a lot …so i basically added vmnat.exe from the latest VMPlayer (5.0.1) as on date to “C:\Windows\SysWOW64\” and “C:\Program Files (x86)\VMware\VMware Server” and followed the rest of the steps as is and it just worked fine ….

  47. mayurdotca said

    Thanks!!!! These instructions did the trick!

  48. Hi,

    For some reasons I am unable to connect to internet on my clinet machine (fedora 10). My host machine is windows 7.

    On fedora I am getting following configuration:

    IP Address: 192.168.137.1
    Broadcast Address: 192.168.137.255
    Subnet Mask: 255.255.255.0
    Default Route: 192.168.137.1
    Primsary DNS: 192.168.137.1

    I had manually put these values as I thought may beDefault gateway is not pointing to 192.168.137.1

    nslookup works fine.. but ping google.com does not yield any result..

    Regards,
    Ashootosh

  49. Alex said

    Following the instructions at the top of this thread and disabling Symantex Endpoint protection fixed the problem for me too :)

  50. Thanks a lot man :). Solution works like a dream. Keep up the good work. GOD Bless on u

  51. Julian. said

    Itsme’s solution fixed the problem for me too. Took a bit of prodding to get things working afterwards (network cable in the guest was unplugged). A few reboots and it came right. Guest on the NAT network can now browse the internet, where before it could only ping it.

  52. Julian. said

    I was going to use ICS, but changing subnet on the host was not an option.

  53. [...] 安装好系统后,取消了nat的dhcp服务,手动指定子网为192.168.1.0 ,Vnet8的IP地址自动设置为192.168.1.1网关采取默认的192.168.1.2 ,指定ubuntu使用静态ip 192.168.1.8 子网掩码255.255.255.0网关192.168.1.2,随即发现ubuntu不能上网!但是可以ping通网关,以及互联网上的主机,在主机是里ping 192.168.1.8也可以ping通,怪事,检查了几遍确实没有问题,google搜了半天vmware server nat不能上网也没有头绪,google能提供的信息不多,没办法,搜搜外国网站,终于找到一些线索:http://www.sevenforums.com/virtualization/3850-vmware-server-nat-problem.html和https://florianlr.wordpress.com/2009/07/09/5/,大约看了下,说是windows 7 beta版本下,vmware的各种版本均不支持nat上网,只能bridge或者Host only。我郁闷!看了解决办法,需要使用ICS共享本地连接,可惜我的 win2008 r2 跟win7虽然是一样的核心,但是没有ics共享这种低级的东西,算了,还是放弃吧! [...]

  54. Thanks man. Finally got the damn NAT to work.

  55. pnu said

    Tanks a lot ^_^

  56. Sourabh said

    u r damn grtttttttttttttttttttttttttttttttttttttttttttttt !! i did all permutations-n-combinations but with no success but now i am able to = all bcoz of yr superb blog… !!! :D

  57. al said

    Great info. Just what I was searching for. 2 steps it works.

  58. Mani said

    Thank you very much, this was very helpful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: