Virtual Machine and My machine have different IP range

6,497

I recommend using bridged networking. That will put the VM on the same LAN as your host, which will make your VM accessible to any other PC or tablet on your LAN.

Share:
6,497

Related videos on Youtube

None
Author by

None

Updated on September 18, 2022

Comments

  • None
    None over 1 year

    I have an ubuntu virtual machine running on VirtualBox. I also want my Windows 10 machine to communicate to this VM. The VM network settings is NAT. When I try to ping the VM from my Windows machine, the ping fails. The Windows IP is: 10.188.132.xx and subnet: 255.255.255.0 while Windows machine IP: 10.188.132.xx and subnet: 255.255.240.0. I tried all VirtualBox network settings, none of them provided the VM with an IP in the same range as my machine. I do not control my DHCP and I connect through wireless but I also do not have access to its settings as it is not my own.

    How can I configure the ubuntu VM to have IP int he same range of my Windows machine so I can connect them together (ping and open the web page in the VM from my Windows machine)?

    EDIT: To clarify: the VM contains apache web server. I want to connect to the web server from my Windows machine. I can not access the web server nor ping it. There is not connectivity between the two machines.

    EDIT 2: For those who suggested Host-only configurations. It is disabled. This is the screen shot:

    enter image description here

    • shinjijai
      shinjijai over 6 years
      Change your network settings to Bridge.
    • Ramhound
      Ramhound over 6 years
      Both addresses you mention are in the same subnet (10.188.132.xxx). So what exactly is the problem? Your subnet mask is indeed different, but it is unclear, the reason you are concerned by the fact.
    • heavyd
      heavyd over 6 years
      I would recommend changing the network adapter type to "Host-only." This will allow your host and the VM to both be on the same network without you having to configure them on the same 10.188.132.xx network.
  • None
    None over 6 years
    With bridged network I do not get any ip. The only way to get an IP is by NAT with IPs that I posted earlier. But then can't connect to this machine.
  • shinjijai
    shinjijai over 6 years
    @None if that's the case, change your IP of your VM so it's not in the same range as your host computer's subnet, so you won't have routing issue.
  • Charles Burge
    Charles Burge over 6 years
    Servers should (generally) have static IP addresses. Manually assign an address that's in the same subnet as your host.
  • shinjijai
    shinjijai over 6 years
    @CharlesBurge he doesn't have control of the DHCP, so he might run into issues with duplicate IPs. He can ping all IPs in that subnet range, but he can save himself some headache by just keeping it in NAT, and assign that Ubuntu VM an IP on a different range.