1

I decided to reinstall my TVHeadend server. I used to have Gentoo installed and decided to go for Ubuntu-server instead. Sounds like a simple task but I spent all day with network struggle. Internet search never provided me with any hint of the actual problem or any proper solution so to save someone else some frustration...

Objectives

Install Ubuntu-server with ssh and TVHeadend. Connect to WiFi - there is no cable access nearby where the TV aerials need to be placed.

Hardware used: a Gigabyte mini PC with built in WiFi.

Network-problem

Computer halts the systemd boot sequence to wait for a LAN-cable to be connected and there is no (reasonable) timeout.

It is also difficult to get the WIFI up and running. I was able to scan for WIFIs (i.e. the wifi is working) and followed guides I found to add the network information to /etc/network/interfaces without success. I tried to install NetworkManager and use the nmtui text based ui to connect but NetworkManager seems to disconnect WIFI if a LAN cable is connected and that was required to boot.


Search phrases to find this question:
disable eth0 disable LAN
use only WIFI
replace LAN with WIFI
enable WIFI during boot
netplan

2
  • Please see: askubuntu.com/questions/976464/… netplan is the default now.
    – chili555
    Dec 23, 2017 at 22:05
  • @DavidFoerster, I am still new here and cant resolve my own questions just yet. Help is appreciated :)
    – Erik R
    Dec 24, 2017 at 8:16

3 Answers 3

2

This worked for me:

1) Install the required packages:

sudo -s -H
apt-get install wireless-tools
apt-get install wpasupplicant

2) Check wifi adapters (mine is wlp4s0):

iwconfig

3) Search available wifis for "my_wifi" essid:

iwlist wlp4s0 scan | grep my_wifi

4) Edit netplan config file: /etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  wifis:
    wlp4s0:
      dhcp4: yes
      dhcp6: yes
      access-points:
        "my_wifi":
        password: "my_passord"

5) Reconfigure netplan:

netplan --debug generate

netplan apply

6) Finally reboot:

shutdown -r now; exit

That should restart your ubuntu server, and connect to "my_wifi" with WPA2 "my_passowrd" (change wlp4s0, "mi_wifi", and "my_password" for the appropriate ones).

Happy year 2018 !

1
  • WARNING: indentation in YAML files are critical, so in order to make the code really works you've to set 2 (actually any) additional spaces before password: "my_password !
    – LucaM
    Jun 13, 2018 at 13:35
0

netplan - The Colombo egg

The solution was pretty easy.

As stated, netplan is the way to configure interfaces now. Configuration is located in /etc/netplan/

The LAN cable interface (enp3s0 in my case) was configured in /etc/netplan/01-netcfg.yaml a generic way to tell whatever networking-back-end you use to start the interface during boot. You can read more about netplan on the ubuntu wiki.

I removed the file (moved it actually, just in case). I added enp3s0 to /etc/network/interfaces without the keyword auto. Auto seems to tell the network system to make sure it is started, removing that it will be started if it is available. NetworkManager hinted me that interfaces recorded in that file will not be managed by NetworkManager.

I installed network manager and used the nmtui to connect to WIFI. I had to manually enable NetworkManager in systemd but I installed and removed it a few times and also disabled it at one point so in normal cases I hardly think that should be needed.

I rebooted and things seems to work nice.

Hypothesis

Going into guesswork here. The installer didn't find my WIFI card so I had to connect using LAN cable. I think that the installer recorded the used network connection as system connection using netplan to secure that it is started during boot regardless if systemd or NetworkManager is used.

0

While I can appreciate the initiative and research that went into this answer, I frankly do not feel that it is useful to crudely disable netplan, install and then disable Network Manager and, finally, set up /etc/network/interfaces in order to use wireless in a 17.10 or later server.

As I noted above, netplan is the default behavior, not only in server installations, but also desktop installations that, by default, use Network Manager. In a desktop installation, netplan turns over configuration to Network Manager. Here is the default yaml file:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Ubuntu have decided, for many reasons, I’m sure, that the future is netplan. In my opinion, going to extreme measures to bypass it amounts to fitting wooden spoke wheels on your sleek black BMW.

The exact method to set up wireless using netplan on a server running Ubuntu 17.10 is known; for example, here: /etc/network/interfaces is ignored

I suggest that anyone faced with the problem in the original question learn and use netplan.

1
  • Well, this kind of comments i not very kind or helpful. I spent a day messing with things that shall just be configured (2 minutes) and then work. Telling me that my full day of crappy struggle with no decent information found despite tons of searching is "not very useful" is kind of insulting to be honest.
    – Erik R
    Dec 25, 2017 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .