简体   繁体   English

Azure VM 远程桌面无法连接

[英]Azure VM Remote Desktop Can't Connect

Following a how-to book's guide on setting up a VM through the Azure Portal and getting the error when trying to connect遵循有关通过 Azure 门户设置 VM 并在尝试连接时出现错误的操作指南指南

Remote Desktop can't connect to the remote computer for one of these reasons: 1) Remote access to the service is not enabled 2) The remote computer is turned off [Verified through the Azure Portal it is turned on because Start is faded, while Restart and Stop are not] 3) The remote computer is not available on the network.由于以下原因之一,远程桌面无法连接到远程计算机:1) 未启用对服务的远程访问 2) 远程计算机已关闭 [通过 Azure 门户验证它已打开,因为 Start 褪色,而重新启动和停止都不是] 3) 远程计算机在网络上不可用。

The error occurs before I'm able to enter any credentials - it doesn't find the IP at all.该错误发生在我能够输入任何凭据之前 - 它根本找不到 IP。 The RDP file details (IP removed of course): RDP 文件详细信息(当然已删除 IP):

full address:s:[IPAddress]:3389
prompt for credentials:i:1
administrative session:i:1

What I've tried:我试过的:

  1. Even though the How-To book doesn't show where/how to specify a port, when I download the RDP file from the Connect option, it specifies the port 3389. The book seems to imply that simply downloading this file and connecting will work and there's no need to specify the port.即使 How-To 书没有显示在何处/如何指定端口,当我从Connect选项下载 RDP 文件时,它指定了端口 3389。这本书似乎暗示只需下载此文件并连接即可并且不需要指定端口。 I get the above error.我收到上述错误。
  2. Flushed DNS on my computer, ipconfig /flushdns刷新我电脑上的 DNS, ipconfig /flushdns
  3. In the Network Security Group option for the VM, I verified that port 3389 allowed any source and wasn't specific.在 VM 的网络安全组选项中,我验证了端口 3389 允许任何来源并且不是特定的。
  4. I did miss associating the subnet part of the Network Security Group to a virtual network , so I did associate my NSG with the default subnet set up for my Virtual Network. 我确实没有将网络安全组的子网部分与虚拟网络相关联,因此我确实将我的 NSG 与为我的虚拟网络设置的默认子网相关联。
  5. From the Quick start option, I don't see how to connect to this either;Quick start选项中,我也看不到如何连接到它; I'm guessing, I need to specify a different port, but don't see where to do it here either => Update: this appears to be in the Network Security Group 's Inbound security rules in the Azure portal.我猜,我需要指定一个不同的端口,但在这里也看不到在哪里做=>更新:这似乎在 Azure 门户中网络安全组入站安全规则中。
  6. Boot Diagnostics option shows the login screen. Boot Diagnostics选项显示登录屏幕。 A ping to the IP address fails four times with "Request timed out."对 IP 地址的 ping 失败四次并显示“请求超时”。

Note: this is not a Virtual Machine (classic) .注意:这不是Virtual Machine (classic)

just wanted to share what worked for me.只是想分享对我有用的东西。

After receiving an error prompt:收到错误提示后:

Connect is disabled for this virtual machine because of the following issues: Network interface 'vmwindows1094': Network security group 'VMWindows10-nsg' does not have inbound security rule that allows port 3389. VMWindows10-nsg由于以下问题,此虚拟机的连接被禁用:网络接口“vmwindows1094”:网络安全组“VMWindows10-nsg”没有允许端口 3389 的入站安全规则。VMWindows10-nsg

I have added an inbound port rule.我添加了一个入站端口规则。 Under VM > Settings > Add inbound port rules.在 VM > 设置 > 添加入站端口规则下。

Port: 3389 Protocol/Source/Destination: Any (this can be configured based on your security rules) Action: Allow端口:3389 协议/源/目标:任何(可根据您的安全规则进行配置) 操作:允许

On the Azure portal, Select your VM -> Settings -> Boot diagnostics.在 Azure 门户上,选择您的 VM -> 设置 -> 启动诊断。 Make sure that you can see the login screen.确保您可以看到登录屏幕。 You might need to enable diagnostics (under Monitoring section) if not enabled already.如果尚未启用,您可能需要启用诊断(在“监控”部分下)。 If you don't see the login screen, trying the 'Redeploy' option under 'Support and Troubleshooting' section of settings.如果您没有看到登录屏幕,请尝试设置的“支持和故障排除”部分下的“重新部署”选项。

If you can see that the machines has booted correctly, the connectivity issue might be because of a firewall at your end or on the VM.如果您可以看到计算机已正确启动,则连接问题可能是由于您端或 VM 上的防火墙造成的。 See if you can ping the machine.看看能不能ping通机器。 If you are behind a corporate firewall, try connecting from elsewhere and check your PC's firewall.如果您位于公司防火墙之后,请尝试从其他地方连接并检查您 PC 的防火墙。

Creating a new Virtual Machine on the new portal now creates a NSG (Network Security Group) along with the VM.在新门户上创建新虚拟机现在会与 VM 一起创建 NSG(网络安全组)。 You should be able to find it under all resources, same name as you VM.您应该能够在所有资源下找到它,与您的虚拟机同名。 Make sure that there is an Inbound rule configured for Remote desktop (it is created by default but might be worth checking).确保为远程桌面配置了入站规则(默认情况下创建,但可能值得检查)。

I had the same problem but adding an inbound security rule was not sufficient (although it is also needed).我遇到了同样的问题,但添加入站安全规则还不够(尽管也需要)。 I had to go to virtual machines > (myVm) > Reset password and then choose Reset configuration only我必须转到虚拟机 > (myVm) > 重置密码,然后选择仅重置配置

在此处输入图片说明

Try checking your VM has enough memory.尝试检查您的 VM 是否有足够的内存。

I had tried all of above suggestions and still didn't manage to access.我已经尝试了上述所有建议,但仍然无法访问。

After trying many times I managed to get in a message appeared saying:在尝试了很多次之后,我设法进入了一条消息,上面写着:

Your Computer is low on memory您的计算机内存不足

Not 100% sure that was the reason though.虽然不是 100% 肯定这是原因。

I faced the same issue.我遇到了同样的问题。 I had created an Azure VM but wasn't able to connect to it using RDP.我创建了一个 Azure VM,但无法使用 RDP 连接到它。

The culprit was a default "Inbound Port Rule" due to which all the inbound traffic was being blocked.罪魁祸首是默认的“入站端口规则”,所有入站流量都被阻止。

在此处输入图片说明

The solution is to create a new rule by clicking the "Add Inbound Port Rule" and allow traffic from port 3389. Make sure that the priority of this new rule is greater than the "DenyAllInBound" rule otherwise our new rule will not have any effect.解决方案是通过单击“添加入站端口规则”创建一个新规则并允许来自端口 3389 的流量。确保此新规则的优先级大于“DenyAllInBound”规则,否则我们的新规则将不起作用.

After adding the rule, try connecting to the VM using its public IP in RDP and you should be able to connect.添加规则后,尝试使用 RDP 中的公共 IP 连接到 VM,您应该能够连接。

This worked for me, hope it helps you as well.这对我有用,希望它也能帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM