简体   繁体   English

远程桌面“无法连接到远程计算机”

[英]Remote Desktop “can't connect to the remote computer”

I have followed this tutorial to create the first azure application http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010 我已经按照本教程创建了第一个azure应用程序http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010

Because after deployment its not working on the following url http://24fb8b6a055d4ab2a556218f62d6dbe1.cloudapp.net/ 因为在部署之后它不能处理以下URL http://24fb8b6a055d4ab2a556218f62d6dbe1.cloudapp.net/

I found the following link helpful to connect via remote desktop to be able to see the error: http://wely-lau.net/tag/remote-desktop/ 我发现以下链接有助于通过远程桌面连接以查看错误: http//wely-lau.net/tag/remote-desktop/

However, after following all steps, I get the following error 但是,在执行所有步骤后,我收到以下错误

Remote Desktop can't connect to the remote computer for one of these reasons: 由于以下原因之一,远程桌面无法连接到远程计算机:

1) Remote access to the server is not enabled 1)未启用对服务器的远程访问
2) The remote computer is turned off 2)远程计算机已关闭
3) The remote computer is not available on the network 3)网络上没有远程计算机

Make sure the remote computer is turned on and connected to the network, and that remote access is enabled. 确保远程计算机已打开并连接到网络,并且已启用远程访问。

In: ServiceConfiguration.Cloud.cscfg 在:ServiceConfiguration.Cloud.cscfg

I have this contents 我有这个内容

<?xml version="1.0"?>
<ServiceConfiguration serviceName="GuestBook" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
  <Role name="GuestBook_WebRole">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=luisvalenciaguestbook;AccountKey=x" />
      <Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=luisvalenciaguestbook;AccountKey=x" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="levalencia" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="x" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2012-12-16T23:59:59.0000000+01:00" />
    </ConfigurationSettings>
    <Certificates>
      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="x" thumbprintAlgorithm="sha1" />
    </Certificates>
  </Role>
  <Role name="GuestBook_WorkerRole">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=luisvalenciaguestbook;AccountKey=x" />
      <Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=luisvalenciaguestbook;AccountKey=x" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="levalencia" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="x" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2012-12-16T23:59:59.0000000+01:00" />
      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
    </ConfigurationSettings>
    <Certificates>
      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="x" thumbprintAlgorithm="sha1" />
    </Certificates>
  </Role>
</ServiceConfiguration>

By default Remote Desktop for Azure uses the usual TCP port 3389: you'll need to have this enabled outbound at your corporate firewall. 默认情况下,Remote Desktop for Azure使用通常的TCP端口3389:您需要在公司防火墙上启用此出站。

An alternative approach to setting up Remote Desktop through the configuration files directly or through Visual Studio is to use the Azure Management Portal to modify them temporarily. 直接或通过Visual Studio通过配置文件设置远程桌面的另一种方法是使用Azure管理门户暂时修改它们。 This is rather easier and somewhat less error prone, especially where certificates are concerned. 这相当容易,而且容易出错,特别是在涉及证书的情况下。

Sign in to the management portal as usual, and choose "Hosted Services". 像往常一样登录管理门户,然后选择“托管服务”。 Then find the service you'd like to configure. 然后找到您要配置的服务。

The next step is to configure the Web Role or Worker Role to allow Remote Desktop connections: this will adjust the configuration file for the service, so any changes here will be lost when you next upgrade or reimage. 下一步是配置Web角色或辅助角色以允许远程桌面连接:这将调整服务的配置文件,因此下次升级或重新映像时,此处的任何更改都将丢失。 Select the role, then in the toolbar ensure "Enable" is checked on, and choose Configure: 选择角色,然后在工具栏中确保选中“启用”,然后选择配置:

在此输入图像描述

You'll be prompted for the username, password, certificate and expiry time. 系统将提示您输入用户名,密码,证书和到期时间。

Choose OK. 选择确定。 If you've made changes to the configuration it can take a little while (sometimes several minutes) for them to be applied. 如果您对配置进行了更改,则可能需要一段时间(有时需要几分钟)才能应用它们。

Once the instances are marked as "ready" again, you can then select one and choose Connect: 将实例再次标记为“就绪”后,您可以选择一个并选择“连接”:

在此输入图像描述

This will download a file with the extension .rdp , which you can then open to connect to the remote host. 这将下载扩展名为.rdp的文件,然后您可以打开该文件以连接到远程主机。 (You will most likely see some security warnings when you do so.) (当您这样做时,您很可能会看到一些安全警告。)


If you still see the warning about being unable to connect to the remote host then there are a couple of things to explore: certificates and firewall issues. 如果您仍然看到关于无法连接到远程主机的警告,那么有几件事需要探讨:证书和防火墙问题。 In my experience the "manual" process, configuring the remote desktop settings in Azure through the portal, usually gets around any issues with certificates. 根据我的经验,通过门户在Azure中配置远程桌面设置的“手动”过程通常可以解决任何证书问题。

Firewall issues are harder to resolve. 防火墙问题难以解决。 You may find that using Windows Azure Connect -- which in essence creates a secure VPN connection from your PC to the Azure instances -- allows you to access the Azure host directly, tunnelling across your corporate firewall. 您可能会发现使用Windows Azure Connect - 实质上是从PC创建到Azure实例的安全VPN连接 - 允许您直接访问Azure主机,跨公司防火墙进行隧道连接。

All the above didn't work for me. 以上所有都不适合我。

Enter your credentials, prefixed with . 输入您的凭据,前缀为。 Eg “\\maarten”. 例如“\\ maarten”。 This is done to strip off the Windows domain from the credentials entered. 这样做是为了从输入的凭据中剥离Windows域。

Its somehow strange that is not documented anywhere and it should be stripped off by the windows azure RD manager ! 它在某种程度上是奇怪的,没有记录在任何地方,它应该被windows azure RD管理器剥离!

I had this problem and nothing worked, I couldn't Remote Desktop in even though the role was fully working. 我遇到了这个问题并且没有任何效果,即使角色完全正常工作,我也无法使用远程桌面。

It turns out there is a known issue with Azure SDK 1.7 and 1.8. 事实证明Azure SDK 1.7和1.8存在一个已知问题。 Here is the info I received from Microsoft: 以下是我从Microsoft收到的信息:

A timing issue in a role startup in SDK versions 1.7 and 1.8 sometimes causes a firewall rule required by the Remote Forwarder Service to be deleted. SDK版本1.7和1.8中的角色启动中的计时问题有时会导致远程转发器服务所需的防火墙规则被删除。 Restart of the service will correct the problem and recreate the firewall rule but this is not a persistent fix. 重新启动服务将更正问题并重新创建防火墙规则,但这不是持久性修复。 Any redeployment or restart of the role instance may cause the problem to reoccur. 任何重新部署或重新启动角色实例都可能导致问题再次发生。

Work Around: 解决方法:

Azure application developers can implement a custom startup task that refers to a *.cmd file (eg RemoteForwarderConfig.cmd) as described below. Azure应用程序开发人员可以实现引用* .cmd文件(例如RemoteForwarderConfig.cmd)的自定义启动任务,如下所述。 This will ensure a firewall rule is created that opens ports for the Remote Forwarder Service. 这将确保创建防火墙规则,以打开远程转发器服务的端口。 This startup task should be added to the role designated for running the remote forwarder. 应将此启动任务添加到指定用于运行远程转发器的角色。

Documentation on startup tasks is available at http://msdn.microsoft.com/en-us/library/windowsazure/gg456327.aspx 有关启动任务的文档,请访问http://msdn.microsoft.com/en-us/library/windowsazure/gg456327.aspx

Example task config: 示例任务配置:

<Task commandLine="RemoteForwarderConfig.cmd" executionContext="elevated" taskType="background"></Task>

Example task cmd file contents: 示例任务cmd文件内容:

@echo off
netsh advfirewall firewall add rule name="RemoteForwarderService custom rule" description="Allow incoming connections to the remote forwarder" dir=in protocol=tcp program="%ProgramFiles%\Windows Azure Remote Forwarder\RemoteForwarder\RemoteForwarderService.exe" action=allow enable=yes

If you are exposing a https endpoint, make sure you also expose an http endpoint . 如果要公开https端点,请确保还公开了http端点 This solved the same issue for me with a data service I am hosting in a webrole. 这解决了我在webrole中托管的数据服务的同样问题。

I had this issue and couldn't figure it out. 我有这个问题,无法弄清楚。

Turned out the password wasn't complex enough however it didn't inform me of this at any point. 原来密码不够复杂,但它在任何时候都没有通知我。 Adding a more complex password and logging in with \\YourUsername sorted it for me! 添加更复杂的密码并使用\\ YourUsername登录为我排序!

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

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