Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hi I'm using Ubuntu Server on my VirtualBox. But I changed the MAC address of the NIC from virtual box settings. But now I cannot find the interface when I enter ifconfig. What should I do?

share|improve this question
1  
For Google's sake, the error you get when trying to ifup the interface is ERROR while getting interface flags: No such device. –  Tgr Aug 14 '12 at 16:21
add comment

migrated from stackoverflow.com Jan 3 '10 at 2:49

This question came from our site for professional and enthusiast programmers.

2 Answers

have you ran ifconfig -a ?

ubuntu and debian these days use udev to persistently assign the same nic the same device name. This works great except for when it doesn't do what you want it to do.

justin@media:~$ cat /etc/udev/rules.d/70-persistent-net.rules 
...
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:08:74:f2:83:e2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

if you run that on your VM you will most likely see two lines, one for eth0 and one for eth1. the easy way to fix it is to delete the eth0 line, and change the remaining eth1 to eth0.

share|improve this answer
    
Or you can just delete the whole file and reboot, it will be recreated. –  Tgr Aug 14 '12 at 16:16
add comment

More details would be good. Are you using NAT in your VB settings?

Have you rebooted the virtual Ubuntu? Even better (because you should never have to reboot Linux) have you restarted NetworkManager? Run dhclient?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.