0

So I was trying to access a website through my browser but I couldn't. So I issued the ifconfig command to see if there was something wrong with the IP address
enter image description here

I noticed that the interface enp0s3 does not have an IP address. So I issued this command in vain:
enter image description here

Still nothing changed. So I decided to check the /etc/network/interfaces file to check the configuration of the interfaces. I was surprised to find this:
enter image description here

Does anyone know what might be the problem and how I can solve it?


I forgot to precise I am running ubuntu on virtual box. And it is unable to connect to my home router. (Other Pcs can) sorry.

  • 4
    Your screenshot shows dhclient broadcasting a DHCPDISCOVER, but not receiving any response. Without response, it can't assign a address. Is there a DHCP server running in the network connected to enp0s3? E.g., is it connected to a home router? If yes, which brand and model, and have you tried to configure this router to enable DHCP? – dirkt Oct 10 '18 at 12:18
  • I forgot to precise I am running ubuntu on virtual box. And it is unable to connect to my home router. (Other Pcs can) sorry. – Ahmed Ghrib Oct 10 '18 at 18:36
  • Thank you I have just solved the issue by starting a new virtual machine. Sometimes, life is simple :p – Ahmed Ghrib Oct 10 '18 at 18:50
0

You can set it up in /etc/network/interfaces:

auto enp0s3
iface enp0s3 inet dhcp
  • Nothing changed and it gives me this after saving the edited interfaces file. – Ahmed Ghrib Oct 10 '18 at 18:29
  • ** (gedit:2125): WARNING **: Set document metadata failed: Setting attribute metadata:: gedit-encoding not supported. – Ahmed Ghrib Oct 10 '18 at 18:31
  • 1
    Thank you I have just solved the issue by starting a new virtual machine. Sometimes, life is simple :p – Ahmed Ghrib Oct 10 '18 at 18:50
0

This might be because you are running ubuntu on virtualbox. Could you go to the VM settings and check that the network mode is bridged, nat, or nats (giving it direct access to your external network, DON'T run anything malicious on this box)? This might resolve the issue as it seems like you might have internal or host-only networking on preventing the OS's access to your router's DHCP server

  • Thank you I have just solved the issue by starting a new virtual machine. Sometimes, life is simple :p – Ahmed Ghrib Oct 10 '18 at 18:49
  • Sometimes, it's way too simple to even comprehend. Glad you got it sorted out! – jkan5855 Oct 10 '18 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.