If you’ve moved an Ubuntu virtual machine or modified it and then suddenly had a problem getting networking to work, you might want to read through this page, because I’ve figured out a workaround to get it working again.

The full error message is this:

eth0: ERROR while getting interface flags: No such device 
There is already a pid file /var/run/dhclient.eth0.pid with pid 6847440 
Internet Systems Consortium DHCP Client V3.0.4 
Copyright 2004-2006 Internet Systems Consortium. 
All rights reserved. 
For info, please visit http://www.isc.org/sw/dhcp/ 

SIOCSIFADDR: No such device 
eth0: ERROR while getting interface flags: No such device 
eth0: ERROR while getting interface flags: No such device 
Bind socket to interface: No such device 
Failed to bring up eth0.

Fixing"Failedtobringupeth0"inUbuntuVirtualMachine1.png
Run this command to edit the interfaces file, and then change eth0 to eth1.

sudo vi /etc/network/interfaces

Fixing"Failedtobringupeth0"inUbuntuVirtualMachine2.png

After you run this command to restart networking, everything should likely start working again:

sudo /etc/init.d/networking restart

You should be able to run a ping command, or use ifconfig -a and everything will be working.

Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »