6

I upgraded Ubuntu 16.04 LTS to 17.04 last two days ago. Ever since, I've been trying to connect to the internet, tried to change the 'bridged adapter' under setting > network. left at "NAT" ( as default option ); still didn't work. I tried a few things that I saw on Youtube, but still is not connecting to internet.

At some point, I noticed under "VirtualBox Host-Only Network #2" IPv4 was set to some random IP address within my subnet mask (at least looked that way to me). I changed to DHCP hoping it would fix the issue. No luck.

At this point, I have feeling that if for some one who is familiar with VM than I am, it might be just a few clicks and fix the issue. I seemed to cannot figure that out.

Can someone shed some light on what should I do next please?

3
  • The "VirtualBox Host-Only Network #2" being changed should not matter much if you are using NAT/bridged network (which you should be if you are trying to access the internet from the VM). Try checking if your internet settings in the Ubuntu VM is correct (if it is set to DHCP instead of static, and if it is set to obtain DNS addresses correctly) Aug 28, 2017 at 5:51
  • After I upgraded to 17.04, I don't remember changing anything myself, but while I was troubleshooting, I noticed it's changed back to some static IP twice, bit for DNS it was changed to static without any DNS address entered. It's times I changed back to automatic, and DHCP. It's almost driving me crazy, all I wanted to do was to upgrade to 17.04, now I regret a little bit for upgrading it. I'm gonna check again a bit later today. I might post some screenshot as well. After see my next post, please let me know if you can make something of it. Thank you very much for your help
    – Dil Azat
    Aug 29, 2017 at 3:02
  • @TimothyWong: I checked network settings. it's all check out. it's on obtain IP automatically; obtain DNS server information automatically.
    – Dil Azat
    Aug 29, 2017 at 6:48

3 Answers 3

17

I had a similar issue. I tried switching to bridged, etc, and nothing seemed to work. Eventually I switched back to NAT, and found out which interfaces were available:

lshw -C network

I noticed that the networking was DISABLED. Then I manually brought up the interface:

ifconfig enp0s17 up

But after that it still wouldn't work. I had to manually get it to get an IP address using

dhclient enp0s17 -v

That did the trick and it's working now. Not sure if this will help your issue, but it fixed mine.

1
  • You may need to use sudo to run the commands.
    – lfurini
    May 13, 2021 at 9:25
0

Set your network settings in VirtualBox to look like this...

enter image description here

Update #1:

Change eth0 to enp0s3.

12
  • Thank you for your respond!! I went to setting> network for so many times, I tried most of the options, still no luck. Also among all the options "eth0" was not an option I've ever seen in my virtual box. Except for some reason during the upgrade, my virtual box was really messed for some reason beyond my pay grade. I'll run "ifconfig" when I have access to my pc and post the screen shot here as well. Please have a look at all of my posts to see if it'll tell you where my vm's problem might be.
    – Dil Azat
    Aug 29, 2017 at 3:06
  • I didn't see that option, when I ran 'ifconfig', the following result came out: lo: flags=73<up,LOOPBACK,RUNNING> MTU 65536
    – Dil Azat
    Aug 29, 2017 at 6:50
  • I didn't see that option, when I ran 'ifconfig', the following result came out: lo: flags=73<up,LOOPBACK,RUNNING> MTU 65536 127.0.0.1 netmask 255.0.0.0 ; inet6 ::1 prefixlen 128 scopeid 0x10<host>; loop txqueuelen 1000 (Local Loopback) RX packets 372 bytes 27792 (27.7 KB); RX errors 0 dropped 0 overruns 0 frame 0; TX packets 372 bytes 27792 (2707; TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    – Dil Azat
    Aug 29, 2017 at 6:57
  • Sorry, I was going to screenshot and post here. but didn't fee post picture option like you did. Also, it was around 6 lines of output, but didn't know how to post them here as they seem. Please try to understand and the output, and see if there is something wrong with it. Thank you a million
    – Dil Azat
    Aug 29, 2017 at 6:59
  • @DilAzat show me sudo lshw -C network. Edit your question with that output using copy/paste please. Ping me at @heynnema when you have that info for me. ps: what version VB are you running? Did you install Guest Additions?
    – heynnema
    Aug 29, 2017 at 13:36
0

On Ubuntu 17.10 this solution worked for me to get 'NAT network' working. See this post: Virtual NAT network NIC setup

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .