Ubuntu – How I made the new ubuntu server 17.10 installation only use WiFi

17.10ethernetnetworkingserverwireless

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

Best Answer

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 !