Page 1 of 1

Internet access in VM via NAT

Posted: 1. Sep 2014, 07:47
by thyag
Hi I am running a Linux VM on a 64-bit Windows host machine. I would like to get internet access in the guest via NAT. But because of reasons which I havent been able to figure out till now, I am unable to get internet access in the VM via NAT.

Note: I tried bridging one of the VirtualBox adapters to the host machine's internet port and I was successfully able to get internet access in the VM but I want internet via NAT only.

These are the adapter settings I am using:
Untitled(1).png
Untitled(1).png (23.07 KiB) Viewed 787 times
These are the LAN settings on my Windows host machine:
Untitled.png
Untitled.png (27.46 KiB) Viewed 787 times
I am setting a static mac address for my NAT adaptor and using udev rules, I am giving a static interface name("inteth") in the guest machine. These are my internet settings in my guest machine which is Linux:
Untitled1.png
Untitled1.png (53.22 KiB) Viewed 787 times
What could be the possible solution to this problem ? Please let me know if you need additional info on my VM or host settings. I'll be glad to provide them.

Thanks in advance

Re: Internet access in VM via NAT

Posted: 1. Sep 2014, 09:29
by dlharper
NAT usually works "out of the box" with no problems, certainly if you use DHCP rather than static addresses.

If you have to use static addresses, try the standard NAT ones rather than those you have chosen:
  • IP address: 10.0.2.15
    Gateway: 10.0.2.2
    DNS: as host

Re: Internet access in VM via NAT

Posted: 3. Sep 2014, 11:20
by thyag
Thanks for the reply. I tried what you suggested but it did not work.

I am not using static IP address for my internet adapter in the VM. I am just setting a static MAC Id so that the interface name remains stable across reboots. For further clarity, these are the contents of my "/etc/network/interfaces" file:
Untitled.png
Untitled.png (13.6 KiB) Viewed 743 times
I am trying to create a .ova VM image with some pre-installed packages that can be used by many people for further development. Even I though I do have internet access via bridging currently, the problem is if more than one person starts using the .ova file, then they will all have the same MAC id on the same network. Therefore I want internet access via NAT.