-2

I have VMware workstation environment on my laptop. Also there are 2 Wifi cards. The configuration of VMware virtual network editor is following vmnet8 and network setting for virtual machine network adapter is following virtual machine network adapter settings

Windows IP Configuration in Virtual Machine

Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . : localdomain
   Link-local IPv6 Address . . . . . : ffff::ffff:ffff:ffff:ffff
   IPv4 Address. . . . . . . . . . . : 192.168.152.128
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.152.2

IP Configuration of Host OS

Windows IP Configuration

Wireless LAN adapter Wi-Fi 2:

   Connection-specific DNS Suffix  . : domain.name
   Link-local IPv6 Address . . . . . : ffff::ffff:ffff:ffff:fffb%11
   IPv4 Address. . . . . . . . . . . : 192.168.1.14
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : ffff::ffff:ffff:ffff:fff5%11
                                       192.168.1.1

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : domain.name
   Link-local IPv6 Address . . . . . : ffff::ffff:ffff:ffff:fff4%13
   IPv4 Address. . . . . . . . . . . : 192.168.1.13
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : ffff::ffff:ffff:ffff:fff%13
                                       192.168.1.1

There are 2 Wifi Cards on this system Wireless Lan adapter Wifi: Realtek Wireless Lan Adapter WiFi 2:D Link USB Wifi Adapter

I do not have internet connectivity in VMs. The host has internet connectivity from both Wi-Fi cards. output of netsh wlan show interfaces is

  Name                   : Wi-Fi
  Description            : Realtek RTL8723DE 802.11b/g/n PCIe Adapter
  Name                   : Wi-Fi 2
  Description            : D-Link DWA-131 Wireless N Nano USB Adapter(rev.E)

I disabled first Wi-Fi 1 interface for Realtek Wifi
netsh interface set interface name="Wi-Fi" admin=disabled
rebooted virtual machine no internet in it. Re enabled the Wifi on this interface
netsh interface set interface name="Wi-Fi" admin=enabled
then on other Wi-Fi2 interface to disable D Link Wifi
netsh interface set interface name="Wi-Fi 2" admin=disabled
then rebooted virtual machine no internet connectivity. Again enabled this disabled interface
netsh interface set interface name="Wi-Fi 2" admin=enabled
no success here is a small video I made while doing ping to and from in VMs
https://youtu.be/9Y5RVykv_6U

from the guest OS I can ping to 8.8.8.8 see the screenshot [![guest can ping to 8.8.8.8][7]][7] nslookup to www.vmware.com fails
nslookup fails
This is VMware Workstation 15 Pro
15.1.0 build-13591040 From the host OS I can do not get a ping reply from virtual machine I do a ping from my host OS to virtual machine (which is running on my laptop)

C:\WINDOWS\system32>ping 192.168.152.128

Pinging 192.168.152.128 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

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

C:\WINDOWS\system32>

but if I do a ping from my Guest OS to host OS I get a reply.

C:\Users\Debian>ping 192.168.1.14

Pinging 192.168.1.14 with 32 bytes of data:
Reply from 192.168.1.14: bytes=32 time=1ms TTL=128
Reply from 192.168.1.14: bytes=32 time=1ms TTL=128
Reply from 192.168.1.14: bytes=32 time=1ms TTL=128
Reply from 192.168.1.14: bytes=32 time=1ms TTL=128

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

192.168.1.14 is my host OS (IP is given by ADSL router) 192.168.152.128 is IP of my virtual machine this IP is given by VMware DHCP service in vmnet8 in virtual network editor.

2 Answers2

0

In case of NAT, vmware creates new network inside your PC and it provides router and DHCP functions so your VM can connect to outside of your machine. In other words what your ADSL router provides to your LAN, wmvare virtual router provides to VMnet8. In your case 192.168.152.2 is the address of router vmware created for mentioned purpose. One of the drawbacks of NAT-ed connection is that VM machine can not act as a server without further configuration (ports).

In case of bridged connection vmware allows VM to connect directly to LAN and in that case VM looks just like any other host connected to your network. It will get address from DHCP server in your ADSL router and that router's address will become its default gateway. Now your VM can act as a server as well, which means it can receive connections from outside without first initiating it, just like your laptop. Some will say that is less secure than NAT connectivity and thay will be right too.


I can't really grasp what is happening with your laptop and why it is refusing to accept configuration. I guess you already did it, but in case you did not restart your laptop before proceeding. In case you rebooted, after starting vmware, configuration should look same as when you left it. To make sure it works I would test it only with working Ethernet (cabled) connection and only after I am sure it works I would look into wifi. I would apply that logic to both NAT and/or Bridged connections when testing.


Now I will assume that you rebooted and NAT connection is still not working. So time is to try bridged connection.

In Virtual Network Editor choose Bridged (first option instead of NAT) and be sure to choose Ehternet connection in Bridged to: field. Don't rely on automatic choice, make sure you choose an adapter. That adapter you choose will become your VM's interface. Both, your PC and your VM can without a problem use same physical interface. They will still get separate IP addresses. You have to be sure that your Ethernet connetion works in your PC.

Second step is equally simple. In Virtual Machine Settings under Network Adapter choose Bridged: connected directly to physical network. And you are done. If it still does not work last resort would be restarting vmware and then I am out of ideas.

If Bridged connection (or NAT connection) worked with functional Ethernet connection then you can start playing with wifi.

Following link might be helpfull to understand concepts invlolved.


https://rednectar.net/2011/07/20/vmware-interfaces-tutorial/

  • Right now I am in an environment where I can have a ethernet connection but after 30 days I will be back to where I can not use ethernet. Back in my institute I get internet only via WiFi interfaces not by ethernet. Lan wires simply don't exist at that place. Now coming to the problem why I posted here I have been facing this configuration problem from past 2 months look at this question https://superuser.com/questions/1495476/internet-disconnects-after-switching-on-virtual-machine-in-bridged-mode I posted in October in which I tried to do exactly what you say bridge the wifi and the answer – political science Dec 06 '19 at 22:00
  • in past 24 hours what I have been trying to figure out you can see the discussions here connecting virtual machines to desired vmnets https://superuser.com/questions/1507721/connecting-virtual-machines-in-workstation-to-desired-vmnet-out-of-3-vmnets?noredirect=1#comment2279005_1507721 virtual machines not having internet connectivity https://superuser.com/questions/1507968/virtual-machine-not-having-internet-connectivity also read how to know which vmet is connected to which virtual machine https://communities.vmware.com/thread/622735 – political science Dec 06 '19 at 22:02
  • this was something I could not check and my environment changed Configure vmware workstation so that virtual machine gets IP from wifi router https://communities.vmware.com/thread/618041 wifi router means access point which is at my institute and I get to login via captive portal to connect to internet and I have a limit of 3 devices to bring on in network in institute. One laptop one mobile phone and then if I try to connect 1 VM I am out of my options to run more VM which I need to run for educational purposes. I am having cloudera and Ubuntu VMs have to run Hadoop clusters but all fail – political science Dec 06 '19 at 22:05
  • Right now I am at my home and I can have any kind of configuration tested on wifi or ethernet but when I will be back to institute then I have all kind of problems there if VM does not connect to internet here in this scenario in NAT it wont work there in institute. Unfortunately the people there don't understand my problem and since I could not give assignments on time I have suffered a lot in my grades in assignments and projects which need these virtual machine each assignment I have is a new circus all together. One of my account got blocked on stack overflow because some one thought it is – political science Dec 06 '19 at 22:07
  • a very silly question that I asked. Which probably looks foolish to person who knows every thing but when one look at other side of the world then there is a clear knowledge gap. If you think you have any answer for scenarios I mentioned in above links then do comment here I will check. I am facing a tough time.10 years ago under same situation with what I am trying to achieve on VMware I was doing all this on Xen and I could not deliver that and that experience was catastrophic for me. I faced a lot of troubles in Xen in same situation and those troubles were getting a set back in career. – political science Dec 06 '19 at 22:11
  • As far as first link, it is sad truth that you can't use Bridged connection in VM with wifi. I was asking you to setup that one through cable just to see if it works at all. If you are forced to use wifi in foreign environment you must use some sort of NATed network and in that case you should concentrate on NATed connection. Maybe your vmware internal configuration is messed up. Since you are in windows, removing vmware, restarting pc and installing vmware again might solve that, if that was the case. – Зоран Пантић Dec 06 '19 at 22:53
  • In your original question you provided 2 jpg files for NAT connection and they look correct to me. You've chosen NAT in both Virtual Network Editor and Virtual Machine Settings. In VNE you connected a host virtual adapter to network and enabled DHCP. That is what is usually enough to get you a connection. I guess that in (VNE) DHCP settings starting address is 192.168.152.128 and NAT settings does not have any port forwarding configured. I haven't used vmware for ages. Maybe, just maybe you can try VirtualBox(https://www.virtualbox.org/). But take it easy, don't jump on that one right away. – Зоран Пантић Dec 06 '19 at 22:54
  • Again, try reinstalling vmware if you haven't tried that before. Also, did you try this on more than a single machine? If you only tried this on your laptop maybe there is some setup in BIOS relating to virtualization that prevents your pc from accepting vmware configuration. – Зоран Пантић Dec 06 '19 at 22:55
  • here in this thread https://communities.vmware.com/message/2903730#2903730 some one suggested me to ping 8.8.8.8 from guest OS and I am getting a reply inside the VM here is a screenshot https://drive.google.com/file/d/1KRW3R0lgMAL4MkkSmPl4puP9TwG8v6W5/view?usp=sharing but if I do a nslookup `C:\Users\Debian>nslookup www.vmware.com Server: UnKnown Address: 192.168.152.2 *** UnKnown can't find www.vmware.com: Query refused ` any more ideas here – political science Dec 07 '19 at 13:50
  • Try traceroute 8.8.8.8 from inside your VM. (maybe it is tracert on windows) First address returned should be 192.168.152.2 when you do it from VM. – Зоран Пантић Dec 07 '19 at 14:17
  • yes that is happening here is a screenshot https://drive.google.com/open?id=1kVhO0XG8KKiU9UeeFC6fHpfWWJM8FRbo – political science Dec 07 '19 at 14:23
  • Try ipconfig /all Are your DNS and DHCP server 192.168.152.2 Try it from your VM – Зоран Пантић Dec 07 '19 at 14:34
  • here is the output of `ipconfig /all` from vm https://drive.google.com/open?id=15E9idbtf_4ryv2WXhUeZ0Fnk1Cp7mRne DHCP and DNS are same which is given by Vmnet8 in virtual network editor. – political science Dec 07 '19 at 14:39
  • route PRINT Show me Interface list and ipv4 routing table output. Again run it from VM – Зоран Пантић Dec 07 '19 at 14:42
  • I have slightly changed vmnet0 configuration it was initially host only I had messed up with default and in original question state it was like this https://drive.google.com/open?id=1u9m2R5JZEbKCRwFrHXcMwwdH8WERFmR3 the one after changing vmnet0 looks like this https://drive.google.com/file/d/1YW8_V7nSwG77vRTgNRLRgB6f4WE-2agQ/view?usp=sharing only change in Vmnet0 is it was previously ticked Host Only now I did Bridged Automatic rebooted the virtual machine and then these are output of commands – political science Dec 07 '19 at 15:00
  • route print https://drive.google.com/file/d/1jgkfQziGWSNzGJYw_PmurlLL9UuUruVn/view?usp=sharing `ipconfig /all` https://drive.google.com/file/d/12EAvDgKVFToSKfi686e8DMzGA0CWuE0P/view?usp=sharing – political science Dec 07 '19 at 15:00
  • Don't use autobridging. Choose outgoing interface. If you are trying bridging, you should choose your GE interface in Bridged to field in VMEditor – Зоран Пантић Dec 07 '19 at 15:23
  • Ok I disabled auto bridging the outgoing interface which I am having connected is WiFi 2 (DLink interface ) output of `C:\WINDOWS\system32>netsh interface ipv4 show interfaces` https://drive.google.com/open?id=1QThWE3aNZxln4Du8hFXyMg4t9_qrkS3W and enable this in vmnet0 it looks now like this https://drive.google.com/open?id=1jruR3ovIxVwne12hwL4Cr59lS5j1PPcP this vmnet0 is temporary arrangement for the time being, I will use vmnet8 in NAT only I have to go back to institute after 23 days and there I will have to use NAT on Virtual machines. I thoroughly read your blog link. – political science Dec 07 '19 at 15:35
  • I could not understand `you should choose your GE interface in Bridged to field in VMEditor` what is a GE interface? – political science Dec 07 '19 at 15:36
  • Bridging will not work with wifi interface. It could work only with GE (Gigabit Ethernet or FE-Fast Ethernet) cable interface and I was under impression that you are trying to connect with cable. You told me yesterday that you will be forced to use wifi interface. If so, **you should concentrate your efforts on NAT** only (VMnet8) – Зоран Пантић Dec 07 '19 at 15:46
  • yes what I told you is correct I will have to use Wifi only. I read a document here https://kb.vmware.com/s/article/1008367 in point number 8 `To restore the networking defaults, click Edit > Virtual Network Editor and then click Restore defaults.` so I did restore defaults . Rebooted the virtual machines. Now every thing I am doing fresh. But still the problem is same. – political science Dec 07 '19 at 16:41
  • I guess congiguration is same as in first two .jpg you posted in your oroginal question. Can you still ping 8.8.8.8 and in case you can, how does your tracert looks like? – Зоран Пантић Dec 07 '19 at 17:02
  • Also let me know what model is your laptop. – Зоран Пантић Dec 07 '19 at 17:39
  • yes I can ping 8.8.8.8 from the VM here is output of tracert from vm https://drive.google.com/file/d/1ijDJlBsrZmhhrJU0YQzmx00xKicNkXni/view?usp=sharing and laptop system information https://drive.google.com/open?id=1pA8ouvAGqUHV94YniWH8Nob0xf5cn0-8 this link is for extra information about my laptop https://browser.geekbench.com/v4/cpu/compare/3421869?baseline=3421869 the model number is HP 15-bs0xx – political science Dec 07 '19 at 21:43
  • Here is a screenshot of ADSL router DNS settings page which is installed and I get internet access from this one, the model is Dlink Product Page: DSL-2750U screenshot of router accessible at 192.168.1.1 https://drive.google.com/open?id=1818cN4eYpT0rr9wu7R0T-pthRxmV1MlV this is my DHCP and DNS both for all laptops which I access currently. These DNS settings are probably given by telephone company itself so I don't want to touch them. I do not have the expertise to edit them. – political science Dec 07 '19 at 21:54
  • There is one more thing you can do. Restart your laptop and enter BIOS configuration. FInd VT (Virtualization techology) entry in System Configuration menu and make sure it is on or write what you see in it and send it to me. If there is only one entry, something like turn VT on, than you can freely do it. – Зоран Пантић Dec 07 '19 at 22:28
  • this is admitedly wild guess but since your laptop behaves strangely, maybe you get lucky. – Зоран Пантић Dec 07 '19 at 22:29
  • I understand you want to see if Virtualization is enabled in my BIOS or not here from this screenshot of task manager you can see I encircled in red https://drive.google.com/open?id=1G5NpjcVE3TYXZbN_weeyWGpLLdMEgQHP virtualization technology is enabled. https://drive.google.com/open?id=1UKn-mvd38JFRlAjrslxoeu0kwCzlqhtM following google search helps to know this is correct way without reboot https://www.google.com/search?q=command+to+check+vt+windows+10&oq=command+to+check+vt+windows+10&aqs=chrome..69i57j0.18797j0j7&sourceid=chrome&ie=UTF-8 in case you still need BIOS screenshot let me know. – political science Dec 07 '19 at 22:37
  • My last suggestion is that you try vmeware on some other pc, if you have chance. At least you will see if it is up to your pc or up to your config. I am out of ideas. – Зоран Пантић Dec 08 '19 at 11:38
  • I discussed this here https://serverfault.com/questions/994722/nslookup-failures-unknown-cant-find-www-vmware-com-query-refused?noredirect=1#comment1293939_994722 I will try on other pc as you suggest I will arrange one more laptop to try all this. – political science Dec 08 '19 at 17:45
  • This is solved. I needed to give IP of DNS my ADSL router in this case in DNS settings in vmnet8 here are screenshots ns look up in vm after dns change https://drive.google.com/file/d/1ZO2VioostBNYulgn6BT4aqf0C4lQ6yp0/view?usp=sharing dns settings in virtual network editor changed in vmnet8 to my ADSL router https://drive.google.com/file/d/1laKbiMZAKnNxGS8mFuySZAmyKTin3Yds/view?usp=sharing previous DNS setting was automatic which can be seen in this screenshot https://drive.google.com/file/d/1I-kCJTD463yyCReH74PJL_acPQvEzF2k/view – political science Dec 08 '19 at 22:01
  • ipconfig on host OS https://drive.google.com/file/d/153QZmFm3hv9rNTrUouQ6RWrZ2nRhMUv8/view?usp=sharing google in virtual machine https://drive.google.com/file/d/1SI2rhflir47II2DYk4g4sNvqjUXwLSDn/view?usp=sharing and you see I have working internet connection in virtual machine. The comment on serverfault link I mentioned above helped to solve this. Thanks for your suggestions and help because with your questions I was able to frame the question in a way which gave result. – political science Dec 08 '19 at 22:02
0

I was using an ADSL router so I need to give DNS server IP in virtual network editor settings. Here is previous setting of vmnet8 adapter.
dns setting in vmnet8 NAT now the changed DNS setting in virtual network editor--->vmnet8--->NAT--->DNS setting section as 192.168.1.1 is my ADSL router IP
dns server set to ADSL in virtual machine nslookup in virtual machine still failed nslookup in virtual machine still failed
so I checked ipconfig output on host OS
ipconfig output on host OS

now I see checked the google.com URL in browser in virtual machine and I get to see internet working.
google accessible in virtual machine

So now you see virtual machine gets internet connectivity and the problem is solved.

Lesson learned: DNS name resolution was not happening properly. In my previous environment where I used VMware DHCP server was configured to broadcast DNS IP so previously virtual machines used to get DNS IP automatically which was very much in sync with networks DNS servers. Here at home I did not had this kind of setup. So manual entry of DNS server was required in vmnet8-->NAT->DNS settings section.