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

时间:2011-12-16 12:31:24

标签: c# .net azure remote-desktop

我已按照本教程创建了第一个azure应用程序 http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010

因为部署后它不能处理以下网址 http://24fb8b6a055d4ab2a556218f62d6dbe1.cloudapp.net/

我发现以下链接有助于通过远程桌面连接以便能够看到错误: http://wely-lau.net/tag/remote-desktop/

然而,在完成所有步骤后,我收到以下错误

  

远程桌面无法连接到远程计算机以获取其中一个   原因:

     

1)未启用对服务器的远程访问   2)远程计算机已关闭   3)网络上没有远程计算机

     

确保远程计算机已开启并连接到   网络,并启用了远程访问。

在: ServiceConfiguration.Cloud.cscfg

我有这个内容

<?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>

5 个答案:

答案 0 :(得分:5)

默认情况下,Remote Desktop for Azure使用通常的TCP端口3389:您需要在公司防火墙上启用此出站功能。

直接或通过Visual Studio通过配置文件设置远程桌面的另一种方法是使用Azure管理门户暂时修改它们。这相当容易,而且容易出错,特别是在涉及证书的情况下。

照常登录管理门户,然后选择“托管服务”。然后找到您要配置的服务。

下一步是配置Web角色或辅助角色以允许远程桌面连接:这将调整服务的配置文件,因此下次升级或重新映像时,此处的任何更改都将丢失。选择角色,然后在工具栏中确保选中“启用”,然后选择配置:

enter image description here

系统会提示您输入用户名,密码,证书和到期时间。

选择确定。如果您对配置进行了更改,则可能需要一段时间(有时需要几分钟)才能应用它们。

一旦实例再次标记为“就绪”,您可以选择一个并选择连接:

enter image description here

这将下载扩展名为.rdp的文件,然后您可以打开该文件以连接到远程主机。 (当你这样做时,你很可能会看到一些安全警告。)


如果您仍然看到关于无法连接到远程主机的警告,那么有几件事需要探讨:证书和防火墙问题。根据我的经验,通过门户在Azure中配置远程桌面设置的“手动”过程通常可以解决任何证书问题。

防火墙问题难以解决。您可能会发现使用Windows Azure Connect - 实质上是从PC创建到Azure实例的安全VPN连接 - 允许您直接访问Azure主机,跨公司防火墙进行隧道连接。

答案 1 :(得分:1)

如果您要公开https端点,请确保您还公开了http端点。对于我在webrole中托管的数据服务,这解决了同样的问题。

答案 2 :(得分:1)

以上所有内容对我都不起作用。

输入您的凭据,前缀为。例如。 “\马腾”。这样做是为了从输入的凭据中剥离Windows域。

它有些奇怪,没有记录在任何地方,它应该被windows azure RD管理器剥离!

答案 3 :(得分:1)

我遇到了这个问题并且没有任何效果,即使角色完全正常工作,我也无法使用远程桌面。

事实证明Azure SDK 1.7和1.8存在一个已知问题。以下是我从Microsoft收到的信息:

SDK版本1.7和1.8中的角色启动中的计时问题有时会导致远程转发器服务所需的防火墙规则被删除。重新启动服务将更正问题并重新创建防火墙规则,但这不是持久性修复。任何重新部署或重新启动角色实例都可能导致问题再次发生。

解决方法:

Azure应用程序开发人员可以实现引用* .cmd文件(例如RemoteForwarderConfig.cmd)的自定义启动任务,如下所述。这将确保创建防火墙规则,以打开远程转发器服务的端口。应将此启动任务添加到指定用于运行远程转发器的角色。

有关启动任务的文档,请访问http://msdn.microsoft.com/en-us/library/windowsazure/gg456327.aspx

示例任务配置:

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

示例任务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

答案 4 :(得分:0)

我遇到了这个问题并且无法解决这个问题。

证明密码不够复杂,但它在任何时候都没有通知我。添加更复杂的密码并使用\ YourUsername登录为我排序!