canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.93k stars 654 forks source link

[hyperv] `multipass ls` shows stale IP address after instance restart #3354

Open holta opened 10 months ago

holta commented 10 months ago

After an instance is rebooted on Windows, multipass list and multipass info both display the instance's original/stale (erroneous!) IP address on top:

C:\Users\XXXX>multipass version
multipass   1.13.0-rc.1313+g66f773628.win
multipassd  1.13.0-rc.1313+g66f773628.win

C:\Users\XXXX>multipass get local.driver
hyperv

C:\Users\XXXX>multipass launch -n primary
Launched: primary
Skipping mount due to disabled mounts feature                                  # ⚠️ SHOULD WE IGNORE THIS WARNING? ⚠️

C:\Users\XXXX>multipass exec primary -- hostname -I
192.168.176.167

C:\Users\XXXX>multipass list
Name                    State             IPv4             Image
primary                 Running           192.168.176.167  Ubuntu 22.04 LTS    # ✅ ACCURATE IP ADDRESS ✅

C:\Users\XXXX>multipass restart

C:\Users\XXXX>multipass exec primary -- hostname -I
192.168.178.108

C:\Users\XXXX>multipass list
Name                    State             IPv4             Image
primary                 Running           192.168.176.167  Ubuntu 22.04 LTS    # ❌ STALE/ERRONEOUS IP ADDRESS ❌
                                          192.168.178.108                      # ✅ ACCURATE IP ADDRESS ✅

C:\Users\XXXX>multipass restart

C:\Users\XXXX>multipass exec primary -- hostname -I
192.168.181.12

C:\Users\XXXX>multipass list
Name                    State             IPv4             Image
primary                 Running           192.168.176.167  Ubuntu 22.04 LTS    # ❌ STALE/ERRONEOUS IP ADDRESS ❌
                                          192.168.181.12                       # ✅ ACCURATE IP ADDRESS ✅

WHY THIS HURTS: Newcomers and students get very confused, as we ask them to use the Multipass instance's IP Address and they naturally try the (top-most) STALE/ERRONEOUS IP Address.

UGLY WORKAROUND: Start > Run > services.msc > Multipass Service > Restart works! (To stop the display of the stale/erroneous IP address.)

QUESTION: We would rather not ask everyday users and newcomers to Restart "Multipass Service" ! Is the underlying bug possibly solvable in coming months?

ASIDE: A simple restart of "Multipass Service" indicates this issue appears to be very solvable — i.e. very distinct from the nightmare revolving around C:\WINDOWS\System32\drivers\etc\hosts.ics as mentioned by https://multipass.run/docs/troubleshoot-networking > Stale Internet connection sharing lease (or am I wrong?)

Tangentially Related:

sharder996 commented 10 months ago

Hi @holta, thanks for reporting this!

I am seeing this on my end as well and is something we should definitely get fixed.

holta commented 4 months ago

Hi @holta, thanks for reporting this!

I am seeing this on my end as well and is something we should definitely get fixed.

Hi @sharder996!

Any guesses if this might be fixed as part of Multipass 1.14 or 1.15?

holta commented 4 months ago

Question: Are the following somewhat related, if only tangentially?

sharder996 commented 4 months ago

It looks like the issue you mentioned might be specific to VirtualBox...

We have not gotten around to fixing this for the 1.14 release, but hopefully we can fix it for 1.15. I will bring it up with the team to see if we can prioritize it.

holta commented 2 months ago

We have not gotten around to fixing this for the 1.14 release, but hopefully we can fix it for 1.15. I will bring it up with the team to see if we can prioritize it.

Thanks! Are the following perhaps related?

ricab commented 2 months ago

Hi @holta, yes, those indeed appear to be related. Thanks for pointing it out!

The other two you mentioned in your earlier comment are only distantly related. They have conceptual similarities, but different causes and effects.

ricab commented 2 months ago

According to this comment, the stale IP is observed when hosts.ics has only one IP.