Fixing a missing Ethernet adaptor in Ubuntu on VMWare

Nov 7, 2010 20:05 · 291 words · 2 minute read configuration ethernet ubuntu vmware

I’ve got a series of Ubuntu 10.04 Server images which I’m using while teaching the Web Architectures module at Sheffield Hallam Uni.  Being able to hand out pre-built images which can be run as VMWare machines is incredibly useful, but comes with a bit of a glitch.

Ubuntu’s (and presumably Debian’s) network configuration ties the default Ethernet interface on eth0 to the MAC address of the host machine that the image was created on - move or copy the VM image, and the MAC address also has to change.

It’s not tricky, but it did take a bit of digging to figure out the workaround.  Which goes like this:

  1. Find the MAC address that’s being used by VMWare - for example, with VMWare Fusion on a Mac, bring up the virtual machine settings with Cmd-E, and select the Network option. The MAC address is hidden behind the Advanced Options drop-down - open that, and make a note of it. (If the VM is off, you can click in the field to copy it - otherwise it’s a pencil-and-paper job.)

  2. In the VM itself, navigate to the /etc/udev/rules.d directory, and open the XX-persistent-net.rules file with Nano or the editor of your choice.

  3. The first entry in the file should be for Eth0 - change the ATTR{address} section and replace the MAC address that’s currently there with the one that you copied from the VMWare settings.

  4. Save the file, and reboot the VM

  5. The network should now be available.

It would probably be quicker in the long run to script this, but editing the rules file in place needs slightly more Linux foo than I can call on at the moment.  And this isn’t a hugely complicated process to start with, of course.