我有以下问题。当我运行
emulator @avdname
时,会抛出以下错误:
(...)
qemu-system-x86_64: -chardev socket,port=46189,host=::1,nowait,nodelay,ipv6,id=modem: address resolution failed for ::1:46189: Name or service not known
(...)
/etc/hosts 文件
127.0.0.1 localhost
127.0.1.1 luis-HP-ProBook-450-G2
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我不知道是什么原因导致此问题,但按照 https://issuetracker.google.com/issues/215231636 的建议,我可以确认关闭 IPv6 完全解决了我的问题。
临时:
sysctl net.ipv6.conf.all.disable_ipv6=1
永久设置:将
net.ipv6.conf.all.disable_ipv6=1
放入 /etc/sysctl.conf
或 /etc/sysctl.d/99-sysctl.conf
(以您的系统中正确的方式为准)。
我发现SIM卡被禁用,因为
qemu-system-x86_64: Unable to connect character device modem: address resolution failed for ::1:45695: Name or service not known
我的电脑 Wi-Fi IPv6 被禁用。
如何解决:
ignore
或 auto
sudo sysctl net.ipv6.conf.all.disable_ipv6=1