Ubuntu – Network interface problem installing Ubuntu server on Acer Aspire H340 (headless server)

networkingserver

I've had an H340 for nearly 7 years now and it's beginning to choke under Windows. I dug around and found instructions for installing Linux on it by first installing it either on another computer (with a monitor) or using VirtualBox and a raw disk VM. I went with the latter option. The installation of Ubuntu Server 16.04 went well, though when I put the disk into the H340 then I could not find it on the network. I then went with my first option, which was to put the system HD in a PC for configuration. As it turns out, no network there either – but at least I had a monitor so I could diagnose a little bit.

The problem seems to lie with the file /etc/network/interfaces. It had some weird name for the network card (likely because of the initial VirtualBox configuration). All the instructions I've seen pointed to "eth0" being the interface name for the H340. Digging a little bit, I found that "enp2s0" worked for the PC (apparently that's the new name for eth0?). I was able to see the PC on the network. Good, I thought: I just need to slide it back into the H340!

But no. Still can't see the H340 on the network. I can't ping it either and the router doesn't see it (just like it didn't see the PC until I fixed the name in the interfaces file).

I've Googled left and right and can't figure out what to do to get Ubuntu to see the H340's network card. The instructions I had found mentioned the file etc/udev/rules.d/70-persistent-net.rules with a note saying that I should remove the entry there. As it turns out, the file doesn't even exist.

This is the short version. I've been at this for hours and now I need a break. Any idea of what I can try?

Thanks,
Michel

Best Answer

I find it weird when people answer their own question, but I'm going to do it anyway. A few hours of sleep helped take some distance. I found the solution in this question: Network interface name changes after update to 15.10 - udev changes

Check out the answer by DĂȘnio Robson, reproduced below (I hope that's OK). My understanding is that this changes Ubuntu's behaviour so that it doesn't... "get creative" with the interface name and uses the good old eth0. After making the edit to the grub configuration, I changed /etc/network/interfaces to refer to eth0 instead of enp2s0 then put the hard disk back into the H340. A few seconds later the machine was showing up on my network and I can SSH into it. Now the rest of the fun begins (configuring Samba, creating shares, adding disks to LVM, etc).

Here's DĂȘnio Robson's answer from the aforementioned question. If it helps, please upvote him.

Try this: Edit your /etc/default/grub. Change the line from

GRUB_CMDLINE_LINUX=""

to

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

and, finally run:

# update-grub

as root, and reboot your system.

Related Question