Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipass shell fails to start if ports are forwarded to non-existent IP #2383

Closed
brucejo75 opened this issue Dec 30, 2021 · 5 comments
Closed
Labels

Comments

@brucejo75
Copy link

multipass shell fails with a timeout if I have a lot of ports forwarded to a non-existent IP.

May be related to:
#573, #1512, microsoft/WSL#5514

Environment

Windows 10 20H2 (OS Build 19042.1415)
multipass 1.8.0+win
multipassd 1.8.0+win

Repro:

  1. multipass shell
  2. got the ip from my vm instance
  3. Forwarded a number of ports to the vm instance using netsh interface portproxy add v4tov4
  4. multipass delete primary
  5. multipass purge

At this point all my port forwards are pointing at a non-existent vm.

Result: running multipass shell times out.

See logs below, not much useful. No errors.

Workaround

After I reset all the ports pointing to a valid vm or delete them via netsh interface portproxy delete v4tov4 multipass shell would not timeout.

I do forward a large number of ports, it is possible multipass uses one or 2 of them?

Forwarded Port Numbers
4911
4912
4913
4811
4812
4813
4711
4712
4713
4211
4212
4213
4011
4012
4013
5911
5912
5913
5811
5812
5813
5711
5712
5713
5211
5212
5213
5011
5012
5013
5838
6838
8221
8222
8223
8224
8225
8226
8231
8232
8233
8234
8235
8236
9229
9239
9249
5555
6666
7777
netsh interface ipv4 show excludedportrange protocol=tcp

I did not know too check this when I was having the problem. Here is the list while it is working.

>netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
        22          22
      2222        2222     *
      2869        2869
      5357        5357
     49669       49768
     49769       49868
     49869       49968
     50000       50059     *
     61077       61176
     61177       61276
     61277       61376
     61677       61776
     61777       61876
     61877       61976

* - Administered port exclusions.
Windows Event Logs Ugh I hate windows event logs... I trimmed out all the non-essential information...
Date:          12/29/2021 1:58:32 PM
Description:
[primary] Waiting for SSH to be up


Date:          12/29/2021 1:58:32 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:31 PM
Description:
[primary] [27564] Cmdlet: 'Start-VM -Name primary'


Date:          12/29/2021 1:58:31 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet: 'Set-VMNetworkAdapter -VMName primary -StaticMacAddress "52:54:00:06:bb:ba"'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet: 'Add-VMDvdDrive -VMName primary -Path "C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/cloud-init-config.iso"'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet: 'Set-VMProcessor -VMName primary -Count 1'


Date:          12/29/2021 1:58:30 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:28 PM
Description:
[primary] [27564] Cmdlet: 'New-VM -Name primary -Generation 1 -VHDPath "C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/ubuntu-20.04-server-cloudimg-amd64.vhdx" -BootDevice VHD -SwitchName $switch.Name -MemoryStartupBytes 1073741824'


Date:          12/29/2021 1:58:28 PM
Description:
[primary] [27564] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:27 PM
Description:
[primary] [27564] Cmdlet: '$switch = Get-VMSwitch -Id C08CB7B8-9B3C-408E-8E30-5E16A3AEB444'


Date:          12/29/2021 1:58:27 PM
Description:
[primary] [27564] Cmdlet exit status is 'false'


Date:          12/29/2021 1:58:26 PM
Description:
[primary] [27564] Cmdlet: 'Get-VM -Name primary'


Date:          12/29/2021 1:58:26 PM
Description:
[powershell.exe] [27564] started: powershell.exe -NoProfile -NoExit -Command -


Date:          12/29/2021 1:58:26 PM
Description:
[primary] [25896] PowerShell finished successfully


Date:          12/29/2021 1:58:25 PM
Description:
[powershell.exe] [25896] started: powershell.exe Resize-VHD -Path C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/ubuntu-20.04-server-cloudimg-amd64.vhdx -SizeBytes 5368709120


Date:          12/29/2021 1:58:25 PM
Description:
[qemu-img] [11592] started: qemu-img info C:/WINDOWS/system32/config/systemprofile/AppData/Local/multipassd/cache/vault/images/focal-20211129/ubuntu-20.04-server-cloudimg-amd64.vhdx


Date:          12/29/2021 1:58:14 PM
Description:
[Hyper-V Health Check] [13708] PowerShell finished successfully


Date:          12/29/2021 1:58:14 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:14 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-Service -Name vmms | Select-Object -ExpandProperty Status'


Date:          12/29/2021 1:58:14 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:13 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor | Select-Object -ExpandProperty State'


Date:          12/29/2021 1:58:13 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:13 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V | Select-Object -ExpandProperty State'


Date:          12/29/2021 1:58:13 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:12 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-CimInstance Win32_ComputerSystem | Select-Object -ExpandProperty HypervisorPresent'


Date:          12/29/2021 1:58:12 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:12 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty ReleaseId'


Date:          12/29/2021 1:58:12 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:12 PM
Description:
[Hyper-V Health Check] [13708] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty CurrentMajorVersionNumber'


Date:          12/29/2021 1:58:12 PM
Description:
[powershell.exe] [13708] started: powershell.exe -NoProfile -NoExit -Command -


Date:          12/29/2021 1:58:05 PM
Description:
[primary] [5344] PowerShell finished successfully


Date:          12/29/2021 1:58:05 PM
Description:
[primary] [16904] PowerShell finished successfully


Date:          12/29/2021 1:58:05 PM
Description:
[powershell.exe] [16904] started: powershell.exe Remove-VM -Name primary -Force


Date:          12/29/2021 1:58:01 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:58:00 PM
Description:
[primary] [5344] Cmdlet: 'Stop-VM -Name primary -TurnOff'


Date:          12/29/2021 1:58:00 PM
Description:
[sshfs-mounts] No mounts to stop for instance "primary"


Date:          12/29/2021 1:56:45 PM
Description:
[primary] Waiting for SSH to be up


Date:          12/29/2021 1:56:45 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:43 PM
Description:
[primary] [5344] Cmdlet: 'Start-VM -Name primary'


Date:          12/29/2021 1:56:43 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet: 'Set-VMNetworkAdapter -VMName primary -StaticMacAddress "52:54:00:b8:d1:9b"'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet: 'Add-VMDvdDrive -VMName primary -Path "C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/cloud-init-config.iso"'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet: 'Set-VMProcessor -VMName primary -Count 1'


Date:          12/29/2021 1:56:42 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:40 PM
Description:
[primary] [5344] Cmdlet: 'New-VM -Name primary -Generation 1 -VHDPath "C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/ubuntu-20.04-server-cloudimg-amd64.vhdx" -BootDevice VHD -SwitchName $switch.Name -MemoryStartupBytes 1073741824'


Date:          12/29/2021 1:56:40 PM
Description:
[primary] [5344] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:39 PM
Description:
[primary] [5344] Cmdlet: '$switch = Get-VMSwitch -Id C08CB7B8-9B3C-408E-8E30-5E16A3AEB444'


Date:          12/29/2021 1:56:39 PM
Description:
[primary] [5344] Cmdlet exit status is 'false'


Date:          12/29/2021 1:56:38 PM
Description:
[primary] [5344] Cmdlet: 'Get-VM -Name primary'


Date:          12/29/2021 1:56:38 PM
Description:
[powershell.exe] [5344] started: powershell.exe -NoProfile -NoExit -Command -


Date:          12/29/2021 1:56:38 PM
Description:
[primary] [15728] PowerShell finished successfully


Date:          12/29/2021 1:56:37 PM
Description:
[powershell.exe] [15728] started: powershell.exe Resize-VHD -Path C:/WINDOWS/system32/config/systemprofile/AppData/Roaming/multipassd/vault/instances/primary/ubuntu-20.04-server-cloudimg-amd64.vhdx -SizeBytes 5368709120


Date:          12/29/2021 1:56:36 PM
Description:
[qemu-img] [25832] started: qemu-img info C:/WINDOWS/system32/config/systemprofile/AppData/Local/multipassd/cache/vault/images/focal-20211129/ubuntu-20.04-server-cloudimg-amd64.vhdx


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] PowerShell finished successfully


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-Service -Name vmms | Select-Object -ExpandProperty Status'


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor | Select-Object -ExpandProperty State'


Date:          12/29/2021 1:56:26 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V | Select-Object -ExpandProperty State'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-CimInstance Win32_ComputerSystem | Select-Object -ExpandProperty HypervisorPresent'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty ReleaseId'


Date:          12/29/2021 1:56:25 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet exit status is 'true'


Date:          12/29/2021 1:56:24 PM
Description:
[Hyper-V Health Check] [21928] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty CurrentMajorVersionNumber'


Date:          12/29/2021 1:56:24 PM
Description:
[powershell.exe] [21928] started: powershell.exe -NoProfile -NoExit -Command -


Date:          12/29/2021 1:56:19 PM
Description:
[daemon] Daemon arguments: C:\Program Files\Multipass\bin\multipassd.exe --verbosity debug


Date:          12/29/2021 1:56:19 PM
Description:
[rpc] gRPC listening on localhost:50051, SSL:on


Date:          12/29/2021 1:56:17 PM
Description:
[update] Latest Multipass release available is version 1.8.0


Date:          12/29/2021 1:56:16 PM
Description:
[service_main] service is running


Date:          12/29/2021 1:56:16 PM
Description:
[service_main] registering control handler


Date:          12/29/2021 1:56:16 PM
Description:
[main] calling service ctrl dispatcher


Date:          12/29/2021 1:56:16 PM
Description:
[main] Service arguments: C:\Program Files\Multipass\bin\multipassd.exe /svc --verbosity debug 


Date:          12/29/2021 1:56:16 PM
Description:
[main] Starting Multipass 1.8.0+win


Date:          12/29/2021 1:54:57 PM
Description:
[primary] [28472] PowerShell finished successfully


Date:          12/29/2021 1:54:57 PM
Description:
[primary] [18500] PowerShell finished successfully


Date:          12/29/2021 1:54:56 PM
Description:
[powershell.exe] [18500] started: powershell.exe Remove-VM -Name primary -Force


Date:          12/29/2021 1:54:50 PM
Description:
[primary] [28472] Cmdlet exit status is 'true'


Date:          12/29/2021 1:54:50 PM
Description:
[primary] [28472] Cmdlet: 'Stop-VM -Name primary -TurnOff'


Date:          12/29/2021 1:54:49 PM
Description:
[sshfs-mounts] No mounts to stop for instance "primary"

@brucejo75 brucejo75 added the bug label Dec 30, 2021
@Saviq
Copy link
Collaborator

Saviq commented Jan 4, 2022

Hey @brucejo75 there's nothing obvious going on here. We use port 50051 to communicate with the Multipass service, and port 22 directly to the instance IP to multipass shell to it. Does multipass version also get stuck when you hit this issue? Does it report the multipassd version?

PS> multipass version
multipass   1.8.0+win
multipassd  1.8.0+win

@Saviq Saviq added question and removed bug labels Jan 4, 2022
@brucejo75
Copy link
Author

brucejo75 commented Jan 4, 2022

@Saviq, Thanks for the response.

I will have to look at this once I am back in town at the end of the month.

From memory, I was able to run other multipass commands. I know that I issued multipass info primary successfully.

The info for the primary vm never had an IP. Also, I was not using cloud-init so not the same as #1039

Also, I am unable to repro using my repro steps. So perhaps is was some other gremlin.

@brucejo75
Copy link
Author

Also, I am unable to repro using my repro steps. So perhaps is was some other gremlin. Will reenter if I have repeatable repro.

@SPA20
Copy link

SPA20 commented Dec 12, 2022

I am on Windows 10 Enterprise laptop and still the same issue:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\xxxxx> multipass list
Name State IPv4 Image
primary Running N/A Ubuntu 22.04 LTS
test1 Running N/A Ubuntu 22.04 LTS
PS C:\Users\xxxxx> multipass shell test1
shell failed: ssh connection failed: 'Failed to resolve hostname test1.mshome.net (No such host is known. )'
PS C:\Users\eshaach> multipass version
multipass 1.10.1+win
multipassd 1.10.1+win
PS C:\Users\eshaach> multipass shell
shell failed: ssh connection failed: 'Timeout connecting to primary.mshome.net'
PS C:\Users\eshaach> type C:\Windows\System32\drivers\etc\hosts.ics

Copyright (c) 1993-2001 Microsoft Corp.

This file has been automatically generated for use by Microsoft Internet

Connection Sharing. It contains the mappings of IP addresses to host names

for the home network. Please do not make changes to the HOSTS.ICS file.

Any changes may result in a loss of connectivity between machines on the

local network.

172.19.61.134 primary.mshome.net # 2022 12 0 18 22 16 13 30
172.27.48.1 US-00008275.mshome.net # 2027 12 6 11 2 57 31 380
PS C:\Users\eshaach>

Initially i found an extraline feed and numeral "2" as additional line in the hosts.ics file. I have delted that character. Still no luck. Is this issue resolved ?

@kevgilmore
Copy link

Windows 11 Pro laptop
version: 21H2
build: 22000.1455

Experiencing the same issue.
.ics shows only one entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants