UbuntuAsahi / ubuntu-asahi

Native Ubuntu installations for Apple silicon hardware
https://ubuntuasahi.org/
861 stars 27 forks source link

Recommended way to setup Wifi after v24.04 server successful install #153

Open ccgarant opened 4 days ago

ccgarant commented 4 days ago

What is the recommended way to setup a wifi or ethernet connection after successful install? I also ran into this issue with v22 server install. If netplan in /etc/netplan what is the recommended filename? Also, is there a group name to set them UP? (E.g. sudo ip link set wlp1s0f0 up)

I have a mac mini m1 with ip a of end0 and wlp1s0f0.

ip a ... end0: <BROADCAST, MULTICAST> MTU 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00: .... altname enp3s0 ... wlp1s0f0: <BROADCAST, MULTICAST> MTU 1500 qdisc noop state DOWN group default qlen 1000 ...

tobhe commented 4 days ago

The netplan docs have a wifi example that should almost work. On Ubuntu Server you need to use renderer: networkd. renderer: NetworkManager won't work because NetworkManager is not installed.

It should looks something like:

network:
  version: 2
  renderer: networkd
  wifis:
    wlp1s0f0:
      dhcp4: yes
      access-points:
        "network_ssid_name":
          password: "**********"

The file name doesn't matter as long as in ends in .yaml and is placed in /etc/netplan/, so default.yaml or wifi.yaml should both work.

EDIT: after creating the file you will have to run netplan apply to apply it.

eslerm commented 3 days ago

I "replace" netplan by installing network manager and:

$ cat /etc/NetworkManager/conf.d/manage-all.conf 
[keyfile]
unmanaged-devices=none
$ # delete other /etc/netplan/*.yaml
$ sudo cat /etc/netplan/00-nm.yaml
network:
  version: 2
  renderer: NetworkManager
$ sudo netplan generate
$ sudo netplan apply
$ sudo systemctl disable systemd-networkd-wait-online.service 
$ sudo reboot
ccgarant commented 3 days ago

Agree but this is assuming you don't have any internet connections yet to install / update.

ccgarant commented 3 days ago

Still couldn't get wifi up but at least I got ethernet end0 working from the netplan yaml...

tobhe commented 3 days ago

@ccgarant if you run ip link set wlp1s0f0 up what does that return? You might need to apt install rfkill and rfkill unblock all.

ccgarant commented 3 days ago

Thanks @tobhe, I set wlp1s0f0 to "up" and no errors. I installed rfkill and ran those commands, all good.

Now upon sudo systemctl restart ssh (enable and start tried before), there seems to be the following status errors.

Ssh.service not found.

I manually created one and type it into /etc/systemd/system/ssh.service

I've tried sudo apt install openssh-server and there seems to be a dependency package warning.

Upon daemon-reload, and restart ssh, there is another warning.

Ssh.socket not found. Not sure if this is all from openssh-server not installing correctly...

tobhe commented 3 days ago

This looks like ssh socket activation: https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189 in short: instead of managing ssh via the service it is now managed via the ssh.socket. That means systemd starts the service automatically as soon as it sees a network packet arrive on the ssh port. Restart does not exist because a new process is spawned for each connection.