[SOLVED] Networking doesn't start correctly when logging onto a console instead of GUI (MATE) in Ubuntu 18.04
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Networking doesn't start correctly when logging onto a console instead of GUI (MATE) in Ubuntu 18.04
I'm trying to repair a neighbour's laptop (I'll just call him "D") and came to the conclusion I really need to run an update. The difficulty is that the laptop won't boot to a normal GUI interface (D uses MATE), so I am restricted to using the console. My attempts at resolving the problem can be seen in this forum thread: https://www.linuxquestions.org/quest...356/page2.html
That brings me to the current problem. In order to run apt-get update and associated commands, I need to have a network connection. The information below is essentially from my last post on that other thread.
To find out what the networking status on D's machine is, I ran ifconfig with the following result:
I've been told that ifconfig is deprecated, but the results are still valid. Interesting here is the first entry "enp2s0", which has been given the IP address 192.168.1.65, This address was allocated by my IPCop, so D's laptop obviously has an address within my home network. [By the way, before anybody wastes their time telling me that IPCop is no longer supported, I already know and it's not really relevant here.]
Next I tried to find out what DNS settings were in use. From what I've read so far the command systemd-resolve --status should provide some information. The results were less than encouraging:
Code:
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 3 (wlp3s0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 2 (enp2s0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
I cannot fully interpret this, but it suggests that the LAN connection (enp2s0) is not able to access a DNS service. So the question then is: what can it "see" or access?
Again, not encouraging, since it tells me that there is no access to the internet, only a connection to the local network.
So I tried nmcli device show to find out what the device IDs are (I've left out the WLAN stuff since that's not relevant. Besides... it isn't activated from what I can see in the results so far) :
Right, so the connection ID is "Kabelgebundene Verbindung 1". So what does this connection have available to it? To ascertain that I tried the command nmcli connection show "Kabelgebundene Verbindung 1". And here I'm truly at a loss:
That is the IP address of my IPCop DNS. Now I know that works, otherwise I wouldn't be able to post this at all. Things like this give me the "heebee-geebees", because I cannot figure out what's going on. I have no idea how to find out either, because I'm not really a networking expert. I've been reading the man pages for nmcli, but I' don't know what I can do to rectify a situation where everything seems to be correct... er... apart from the fact that I can't access the internet from D's machine.
If anybody can provide some advice on how I can fix the internet access using the console, I would be very grateful.
I don't know NM well and can't interpret the nmcli output. The only time I have used systemd-resolve I created a dent in my wall from banging my head against it, so I am not that clued in there either. However, there are simpler ways to check network connectivity.
You do have an IP address, which tells me that there is some connectivity. My first question is, what makes you think you have no internet access? What error message (if any) do you get from apt-get update?
Sorry for this question, but is the laptop wired to a switch?
What does ping report? ping router, ping your-DNS-server, ping 1.1.1.1 etc.
What does your routing table look like? Run ip route to check.
How about testing DNS with the commands nslookup, host and/or dig (not sure which of them is installed)?
The Xorg.0.log doesn't really look all that weird and there don't seem to be any obvious problems. That said, I'll have to have a closer look and filter out the rubbish. All that will take a bit of time, because I have to mount a USB drive, then copy the file to the USB drive, unmount it again, transfer to my machine.... you get the picture. Fact is that X isn't running (you got that right), but that is the initial problem as defined in the "Linux Desktop" forum post that I mentioned. The fact that X doesn't run is, IMO, a symptom and not a cause. It seems to be the snapd service that is causing the problem... maybe.
Still, I would like to get networking running. WLAN is not really an option, because that doesn't really start up at all. It's the wlp3s0 connection. I left the WLAN (AKA wifi) stuff out of my previous post, but here is what nmcli device gives back about it:
Sorry about the German (I've now changed the language temporarily), but "nicht verbunden" means "not connected" and "nicht verwaltet" means "not administered". In short: no wifi available. That's also why iwconfig enp2s0 gives a reply of "no wireless extensions". Before you ask: yes I do have a wifi service here.
The file resolv.conf just contains comments and the advice that the systemd.resolve --status gives details of the actual name servers. I posted the results of that command earlier in my original post on this forum.
The route command gave the following:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 20100 0 0 enp2s0
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp2s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s0
I'm not quite sure how to interpret that, so I'll look it up on the man pages. I'll also edit the Xorg.0.log and post the results as soon as I can.
@berndbausch:
Most of the stuff you asked about is on that other post in the "Linux Desktop" forum. I should have thought of posting that here as well. Here's what I can tell you so far:
Yes, the laptop is connected via a switch... but then so is mine and, when I work from home, so is my work laptop. All 3 run Ubuntu 18.04.
Ping: I can ping the DNS on my local IPCop server, but I cannot ping anything on the internet like google or linuxquestions. When I try anything on the internet I get "name or service not found". That tells me fairly directly that domain names are not being resolved.
running apt-get update gave the following:
Code:
Ign:1 cdrom://Ubuntu 15.10 _Wily Werewolf_ - Release amd64 (20151021) wily InRelease
Fehl:2 http://archive.ubuntu.com/ubuntu bionic InRelease
»archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:3 http://de.archive.ubuntu.com/ubuntu bionic InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:4 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:5 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:6 http://de.archive.ubuntu.com/ubuntu zesty InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:7 http://de.archive.ubuntu.com/ubuntu zesty-updates InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:8 http://de.archive.ubuntu.com/ubuntu zesty-backports InRelease
»de.archive.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:9 http://security.ubuntu.com/ubuntu bionic-security InRelease
»security.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:10 http://security.ubuntu.com/ubuntu zesty-security InRelease
»security.ubuntu.com« konnte nicht aufgelöst werden.
Fehl:11 http://archive.canonical.com/ubuntu zesty InRelease
»archive.canonical.com« konnte nicht aufgelöst werden.
Fehl:12 cdrom://Ubuntu 15.10 _Wily Werewolf_ - Release amd64 (20151021) wily Release
Bitte verwenden Sie apt-cdrom, um APT diese CD-ROM bekannt zu machen. apt-get update kann nicht dazu verwendet werden, neue CD-ROMs hinzuzufügen.
Fehl:13 https://repo.skype.com/deb stable InRelease
»repo.skype.com« konnte nicht aufgelöst werden.
Fehl:14 http://ppa.launchpad.net/ubuntu-mate-dev/ppa/ubuntu artful InRelease
»ppa.launchpad.net« konnte nicht aufgelöst werden.
Fehl:15 http://ppa.launchpad.net/ubuntu-mate-dev/ppa/ubuntu zesty InRelease
»ppa.launchpad.net« konnte nicht aufgelöst werden.
Paketlisten werden gelesen...
In addition I also get reams of warning messages stating that certain packages are multiply configured. I really have to fix up D's sources.list and sources.list.d, but that will have to wait. First I really need to get the machine running normally again.
running ip route gives:
Code:
default via 192.168.1.1 dev enp2s0 proto dhcp metric 20100
169.254.0.0/16 dev enp2s0 scope link metric 1000
192.168.1.0/24 dev enp2s0 proto kernel scope link src 192.168.1.65 metric 100
I'm not certain what all that means, so I'll check on the man pages when I get a chance.
As for the other commands you recommend, I'll give them a go tomorrow. I'm hoping I'll get a bit more time to work on this then.
Thanks to both business_kid and bernbausch for their input. If anyone else can provide advice, all tips and hints are welcome.
Getting the network card up is comparatively easy beside wifi. It needs it's module, & firmware both of which the kernel should have. Then you need to know what you're connecting to.
From your ifconfig output I can see that epn2s0 is the wifi and has an IP. Seeing as wifi nearly invariably connects via dhcp, it means that wifi has some connection. You can verify this with
Code:
iwconfig epn2s0
If you're connected, it should have an ESSID and Access Point set. Now where it's connected is interesting; My wifi used randomly connect to a dhcp server on my printer, which got me nowhere fast :-/.
Once you get some info on what you should be connecting the nic to, and how (fixed IP, DHCP, etc) we can handle that in all likelihood with a few commands.
It looks like you have, indeed, a problem with DNS. Ubuntu 18.04 uses systemd to manage DNS, and as I alluded, I had a hard time getting it to work a few months back.
It turns out that the PC's DNS server is either configured via DHCP, or by writing its IP address in /etc/systemd/resolved.conf. Here is my version of this file:
DNS is my main DNS server, Domains is the domain I set up at home. FallbackDNS is the secondary server in case the first one breaks.
That's all I can contribute in good faith. You should pursue your troubleshooting with the systemd-resolve command; you started already but need somebody to help you with the output.
As berndbausch has pointed out, /etc/systemd/resolved.conf appears to be the canonical file. But as long as you're in the shell, you're going to have to populate it each time. I have Mint here, which is Ubuntu with a faster GUI, and the file looks like this
I'm not sure why you figure that enp2s0 is a wifi connection. The data above suggests to me that it is an ordinary ethernet connection. (I think that's why it's called "en<something>") The wireless connection is wlp3s0 ("wl" ==> wireless LAN, perhaps?). But to make sure, I tried the iwconfig command on both.
iwconfig enp2s0:
Code:
enp2s0 no wireless extensions.
iwconfig wlp3s0:
Code:
wlp3s0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
So wlp3s0 is the wifi connection and it isn't up (or how ever one expresses it).
I could try editing /etc/resolv.conf after backing up the symlink, but I'm unsure what to do with it. According to the warning in the linked file, any content will be overwritten. Is there a command that I can use instead? Is there a reason not to put the necessary data into the file /etc/systemd/resolved.conf? I'm being a coward...
OK... I did the backup of the symlink, made the modifications you suggested in a new file called /etc/resolv.conf, and rebooted. After switching to root and remounting / as a writable file system, I tried ping www-google.com and "hey presto", it worked! I then tried apt-get update and apt-get upgrade and both of those worked (despite getting all the warnings about multiple repository configs). Unfortunately, when I rebooted, I got the same problem as before... the boot process hangs on the splash screen. (sigh)
That is what the other post (mentioned above) is all about, so I guess I'll try following up the problem there.
@berndbausch
I didn't try editing /etc/systemd/resolved.conf, because the hack suggested by business_kid worked. As you point out the most important entry is the DNS IP address. I'll check out the details in the man pages, and maybe I can avoid having to use that hack.
Thanks to both of you for the advice. I will mark this as solved.
Good to heart my bodge worked. The reasoning behind it was that the links were
etc/resolv.conf -->/run/systemd/resolve/stub-resolv.conf and that's a null file of 0 bytes. So to get that, NetworkManager has to run. Catch-22.
Now that you ran X, /etc/resolv.conf is gone. Make a backup of it - you might need it.
I would boot to console, regain your internet access, run 'sudo apt-get dist-upgrade'. Then find Xorg.0.log. My Mint has it in /var/log; the other possible location is ~/.local/share/xorg/ grab a copy on a usb disk, and post the output of
Thanks business_kid. I understand the logic behind the networking "kludge" you suggested. I must remember to reverse it when I no longer need it. Still, it's good to know how to set up networking without the network manager.
I'm afraid my successes, however, were not as far reaching as you think. I did not get X running and when I try the normal boot (not switching plymouth off) the system hangs at the splash screen as before.
I would boot to console, regain your internet access, run 'sudo apt-get dist-upgrade'. Then find Xorg.0.log. My Mint has it in /var/log; the other possible location is ~/.local/share/xorg/ grab a copy on a usb disk, and post the output of
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.