qemu-system-x86_64:地址解析失败 ::1:46189:名称或服务未知

问题描述 投票:0回答:2

我有以下问题。当我运行

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
android-emulator android-virtual-device qemu
2个回答
13
投票

我不知道是什么原因导致此问题,但按照 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
(以您的系统中正确的方式为准)。


0
投票

我发现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 被禁用。

如何解决:

  1. 将计算机 Wi-Fi IPv6 设置为
    ignore
    auto
  2. sudo sysctl net.ipv6.conf.all.disable_ipv6=1
© www.soinside.com 2019 - 2024. All rights reserved.