systemd-networkd - No networking in recovery mode
1: Boot to recovery mode
2: Drop to a root shell prompt (read only)
3: Remount file system to read and write:
mount --options remount,rw /
mount --all
4: Add dns server just to be safe that DNS will work:
vi /etc/resolv.conf
add
nameserver 8.8.8.8
(8.8.8.8 is the Google DNS server)
5: Reboot and get into a root shell again with read/write access Remount to read and write:
mount --options remount,rw /
mount --all
6: Stop networking:
systemctl stop network-manager
7: Setup wireless connection and scan:
ifconfig wlan_name up
iwlist wlan_name scan
8: Create wpa configuration file and connect:
wpa_passphrase NETWORK_ID WIRELESS_KEY > /home/(username)/wpa.conf
wpa_supplicant -B -i wlan_name -c /home/(username)/wpa.conf
Ignore any IOCSIWENCODEEXT
and SIOCSIWGENIE
errors, and finally run:
dhclient wlan_name
If you don't want to create a file to save your config, use these commands instead:
iwconfig wlan_name essid NETWORK_ID key s:WIRELESS_KEY
dhclient wlan_name
Source:
https://ubuntuforums.org/showthread.php?t=2164398
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
Running UbuntuGnome 17.04 I am not enable to start networking in recovery mode, because there is an
unknown group "power" in message bus configuration file
error when NetworkManager is trying to connect. NetworkManager won't connect.I am using a Wireless Lan Adapter:
Bus 003 Device 004: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
. In an older Version of Ubuntu Gnome it was possible to enable networking using this adapter.EDIT:
I could solve the 'unknown group "power" in message bus configuration file' error due to
cd /etc/dbus-1/system.d
andfind . | xargs grep 'power'
. It showed up that thermald seems to not work properly. Purging it temporarily the error was not shown up. But NetworkManager didn't connect as well. Running root from recovery it tells me that nmcli can not be found. But it is installed and works properly running the system in graphic mode as user. Any ideas how to solve this?EDIT:
I decided to use systemd-networkd for running as root in recovery. I disabled Network-Manager and enabled systemd-networkd as well as systemd-resolved. I could start systemd-networkd. But I don't know how to scan for wifi and connect to it. Or maybe just connect to it with typing in the needed informations... Any ideas?
Thanks a lot
-
Kees Beets almost 7 yearsIs a wired network connection an option in recovery mode? If not you need to create a systemd service for your wlan interface, referring to a /etc/wpa_supplicant/wpa_supplicant.conf specifying ssid and psk key to use. (Sorry I realize the last piece is not very concrete, hence asking if wired is an option.)
-
Kees Beets almost 7 yearsAny details to the error? What if you execute the piece after 'ExecStart' directly? (So something along the lines of: /sbin/wpa_supplicant -i%i -c/etc/wpa_supplicant/wpa_supplicant.conf
-
Kees Beets almost 7 yearsthe %i needs to be replaced with the actual interface. looking at your other logfiles it seems this is 'wlx24050f7cdde7'. so please post output of
/sbin/wpa_supplicant -iwlx24050f7cdde7 -c/etc/wpa_supplicant/wpa_supplicant.conf
.
-