X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=lbuild-initvm.sh;fp=lbuild-initvm.sh;h=6897c5d3977a248e5fc3bdc1e232113f0cd56449;hb=6cdd17193b49743e1d05804e8875f373a235f014;hp=ad83d46956aa86c51e64c39833d5091fc5cf48a7;hpb=352c53dcbc2909cdc8f9a9cb37bc06f21cde1b68;p=build.git diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index ad83d469..6897c5d3 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -532,7 +532,14 @@ function setup_lxc() { ### set up resolv.conf from host # ubuntu precise and on, /etc/resolv.conf is a symlink to ../run/resolvconf/resolv.conf [ -h $lxc_root/etc/resolv.conf ] && rm -f $lxc_root/etc/resolv.conf - cp /etc/resolv.conf $lxc_root/etc/resolv.conf + ### since fedora36, our hosts use systemd-resolved, but the guests can't use that + # so the administrator has the option to create /etc/resolv.conf.containers + # and if that file exists it will be copied in the containers instead of /etc/resolv.conf + if [ -f /etc/resolv.conf.containers ]; then + cp /etc/resolv.conf.containers $lxc_root/etc/resolv.conf + else + cp /etc/resolv.conf $lxc_root/etc/resolv.conf + fi ### and /etc/hosts for at least localhost [ -f $lxc_root/etc/hosts ] || echo "127.0.0.1 localhost localhost.localdomain" > $lxc_root/etc/hosts