qemu-system-x86_64 : address resolution failed for ::1:46189: Name or service not known
Asked Answered
H

2

8

I have the following problem. When I run emulator @avdname the following error is thrown:

(...)
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
(...)

I tried to find the solution on the internet (here and here) but still without success.

/etc/hosts file

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
Hiss answered 11/2, 2022 at 0:34 Comment(3)
Given this is just loopback, is it absolutely vital to use ipv6? It might be an ipv6-specific issue that you could workaround by using ipv4...Atomize
The image I'm pulling up is system-images;android-31;google_apis_playstore;x86_64. In no step I choose between ipv4 or ipv6. Automatically when I am not connected to any network, when executing the command emulator @avdname the execution ends unexpectedly.Hiss
oh, it's the android emulator, not QEMU being used directlyAtomize
L
13

I don't know what causes this, but following the advice at https://issuetracker.google.com/issues/215231636, I can confirm that turning off IPv6 completely fixed my issue.

Temporary: sysctl net.ipv6.conf.all.disable_ipv6=1

Permanent setting: put net.ipv6.conf.all.disable_ipv6=1 in /etc/sysctl.conf or in /etc/sysctl.d/99-sysctl.conf (whichever is the right way in your system).

Levorotation answered 24/4, 2022 at 19:39 Comment(4)
I was stuck not being able to run the emulator on Fedora (and also Ubuntu) for 2 days; I tired so many solutions but NONE of them worked. Finally, after disabling IPv6, the emulator worked like a charm! Thank you! I wonder why would even having a problem with IPv6 would cause the emulator to not appear at all...Kowatch
Thanks alot even i was facing the same problem after disabling the ipv6 my emulator works like a charm .Patron
Same question and answer here and here.Kaufmann
I don't agree with the answer... What if my system need IPv6 to be used? It looks like a workaround but it doesn't solve the problem. I.e. only one thing works - either emulator or IPv6. Not both... :(Lizethlizette
S
0

I found SIM card disabled, because qemu-system-x86_64: Unable to connect character device modem: address resolution failed for ::1:45695: Name or service not known

My computer Wi-Fi IPv6 is disabled.

how to fix:

  1. set computer Wi-Fi IPv6 to ignore or auto
  2. sudo sysctl net.ipv6.conf.all.disable_ipv6=1
Subjective answered 18/1 at 18:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.