I can't connect to the internet in chroot. For example, when I run apt update, I get a "temporary failure resolving". I tried copying resolv.conf over but still same error.
Asked
Active
Viewed 1.1k times
3 Answers
7
This helped me.
echo "nameserver 8.8.8.8" > /etc/resolv.conf
or
echo "nameserver 8.8.8.8" > /run/systemd/resolve/stub-resolv.conf

Vijay
- 8,056
-
I tried this and the output is incredibly strange. It says that the file "/etc/resolv.conf" does not exist even though I put it into the folder that I chroot into. – Charlie Oct 27 '18 at 16:52
-
"/etc/resolv.conf" is alink. – Vijay Oct 27 '18 at 17:07
-
to "/run/systemd/resolve/stub-resolv.conf" – Vijay Oct 27 '18 at 17:15
-
Turned out that the files from /run/systemd/resolve weren't copied over to the guest system. After copying the files, internet works. – Charlie Oct 27 '18 at 20:27
2
you should creat the folder /run/systemd/resolve with mkdir :
mkdir /run/systemd/resolve
then you can create the link with:
ln -sr /var/run/resolvconf/resolv.conf /run/systemd/resolve/stub-resolv.conf
after that, type sud apt-get update

Tri Bintang
- 21
-
"/bin/ls: cannot access '/var/run/resolvconf/resolv.conf': No such file or directory" – Charlie Oct 27 '18 at 16:53
0
It turned out that the files from /run/systemd/resolve weren't copied over to the guest system. After copying the files, internet works.

Charlie
- 131