I am using Virtual Box and if i lose internet connection or anything happens with my network adapter on host machine i will lose the internet connection on my Virtual Machine.

Even if i connect again, the host is fine but my Virtual Machine can't connect, i need to restart it in order to get internet.

Is there a way to restart networking on the Virtual Machine somehow without rebooting the whole Virtual Machine?


i have tried this command:

sudo /etc/init.d/networking restart

but it just hangs and nothing happens.


This problem is very familiar as it seems and I have experimented a little and it turns out that you can change the network adapter while the VM is running here:

enter image description here

and then change only the Attached to: option to NAT or Bridged Adapter (mine was on Bridged adapter so i changed it to NAT).

enter image description here enter image description here

and click OK. And then change it again to which it was before and again click on OK to accept it.

Now go back to your VM terminal and run this command

sudo /etc/init.d/networking restart

And the internet connection will work without reseting the VM.

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.