Read: internet. I do have network access.
Not sure what changed but I can't access any server/ip address outside of my own home network anymore from within Qemu. This makes apk unable to contact it's servers and is quite annoying for development. I can however access any device on my home network (I can ssh into my router fine for example).
Does nslookup postmarketos.org yield anything fruitful?
So it seems more and more that this is an issue in combination with the network configuration at home. If I try the same setup at my school's network or at my parents house, it works absolutely fine.
This building has as far as I know one big shared connection, of which every apartment gets 1 IP address in. I just plug my router in and work on my own subnet which I can control, but I have no control over the rest of the building. Is there anything I can try to debug this issue?
If your router does natting (which it probably does) then the rest of the network shouldn't matter at all.
It does indeed. Strange, not sure what else it could be...
Actually, this sounds like a DNS issue. Some ideas to debug this:
8.8.8.8 work inside the VM? (This would support my theory, that this is only a DNS problem)/etc/resolv.conf and compare with your host. pmbootstrap keeps it in sync whenever you enter a chroot, but maybe it has gone wrong there.You shouldn't test stuff with ping in the vm since ICMP packets won't work with user-mode networking. you can try dig google.nl @8.8.8.8 to check the connectivity with actual dns traffic.
For now I've worked around this by connecting the host to a VPN (which I should do anyway for privacy reasons). A bit strange still that this happens in the first place.
Okay, glad that you were able to work around it at least.
It sounds like it is related to your local network, as no one could reproduce it (I've tried at least), so I would suggest we close it for now?
Sounds fine to me.
+CC @bhush9 who reported the same problem once.
While debugging the chrony issue described in https://github.com/postmarketOS/pmbootstrap/pull/1543#issuecomment-399624179 I was able to reproduce the "no internet in qemu" problem.
This probably happens, because we copy the /etc/resolv.conf from the host to all chroots, and as a side effect it ends up in the rootfs.
Here's a workaround:
sudo rm /etc/resolv.confsudo udhcpcI did not figure out a good patch that prevents the /etc/resolv.conf from getting copied. Adding the following at the end of copy_files_from_chroot() in pmb/install/_install.py did not work:
pmb.chroot.root(args, ["rm", mountpoint + "/etc/resolv.conf"])
Most helpful comment
You shouldn't test stuff with ping in the vm since ICMP packets won't work with user-mode networking. you can try
dig google.nl @8.8.8.8to check the connectivity with actual dns traffic.