Tuesday, August 14, 2007

VMware eth0: ERROR while getting interface flags: No such device

When you first start a virtual machine (with a linux system) after moving, copying or downloading it from the internet, you will be prompted with the question whether you want to create a new identifier or not. If you click “Create”, you will probably don’t have network connection anymore in your virtual machine. This is because vmware changes the MAC-address of all ethernet-cards and linux detects a new but currently unconfigured network device.

$ sudo /etc/init.d/networking start
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

There are three ways to solve this problem:

Prevent
Click on the button “Keep” of the dialog prompted at the first start of the virtual machine after its store-position has changed (moving the directory of the virtual machine to a new location causes vmware to reshow this dialog).

Solve the right way
Edit the file “/etc/udev/rules.d/z25_persistent-net.rules”. You know by yourself what you have to do. If the file doesn’t exist,  go to “Solve the right way 2″. Else restart now udev with the command “/etc/init.d/udev restart” or reboot your system.

Solve the right way 2
Create the file “/etc/udev/rules.d/10_local.rules” and insert
KERNEL="eth*", SYSFS{address}="00:X0:18:ea:18:40", NAME="ethunten"
Don’t forget to replace the MAC-addres. Execute “udevtest /sys/class/net/eth0 net” and reboot your system.

Get backup
Replace the changed vmx-file with a backup (but I don’t belive you made one).

Live with it
When executing “ifconfig -a” you see the new network device (its probably called eth1, if you only have one network device).

 

Source:
http://www.debianhelp.co.uk/udev.htm
http://sicherheitsschwankung.de/post/jan/2005-10-13/renaming-network-devices-udev

 

Posted by schmidi2 in 18:10:14 | Permalink | No Comments »