-3

I'm trying to set up an Ubuntu server on a virtual machine hosted on a windows OS. When I set it to the default DHCP the internet works fine. When I attempt to setup a static IP I get TX but no RX.

The following is my /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# Primary network interface
auto enp0s3
iface enp0s3 inet static
    address 192.168.1.151
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4

I got the address from my host machine when I did an ipconfig /all

Most of the solutions ive seen to similar problems have to do with not having a DNS server named but I do have one so I'm not sure what else to do.

Any help is greatly appreciated. Thanks!

Justin
  • 1
  • 1
  • 1
    Hello and welcome to Server Fault! If I undestood correctly, you gave the _same_ IP address of your Windows Host to the Ubuntu VM (which obviously run simultaneously to the host)? – Daniele Santi Sep 20 '18 at 13:30
  • Some other answer I found told me to do that. I just set it to 150 (which is actually what I had it to before) and it's still not working. – Justin Sep 20 '18 at 13:35

1 Answers1

1

Since ipconfig /all is a windows command I assume you ran it on the host. Your virtualization software will use a different subnet for the internal network.

If you have configured your virtual network with NAT you can either look up in the documentation of whatever software you are using which IP subnet is used, or switch back to DHCP and check inside the VM which IP settings are used. Then configure your static IP accordingly.

A second possibility would be to configure bridged networking, then you can use IP addresses in the same IP range as your host.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
  • 1
    *"A second possibility would be to configure bridged networking, then you can use IP addresses in the same IP range as your host."* --> Yes, but not the exact same ip-address as used by the host. – HBruijn Sep 20 '18 at 13:32
  • So I actually tried with an arbitrary IP address like 150 and it didnt work. I set it to 151 from a different question I found that was answered that basically said to do that. So I just set it now to 150 and its still not working. – Justin Sep 20 '18 at 13:33