Vagrant RDP => Windows2012R2 | 如何远程桌面连接我的Vagrant虚拟机?

3
  ~  vagrant rdp
==> default: Detecting RDP info...
    default: Address: 127.0.0.1:3389
    default: Username: vagrant
==> default: Vagrant will now launch your RDP client with the connection parameters
==> default: above. If the connection fails, verify that the information above is
==> default: correct. Additionally, make sure the RDP server is configured and  
==> default: running in the guest machine (it is disabled by default on Windows).
==> default: Also, verify that the firewall is open to allow RDP connections.

1

我正在使用(vagrant box add) mwrock/Windows2012R2 --provider virtualbox

我还需要什么?如何远程桌面连接到我的虚拟机?

1个回答

6

这是一个老问题,但由于它是谷歌搜索结果中最受欢迎的之一,我将提供最新答案。

测试环境:

  • 主机:macOS 10.13.6(High Sierra)
  • 虚拟机:Windows 10 1803(RS4)
  • Vagrant 2.1.5
  • Microsoft Remote Desktop 10.2.1

步骤:

  1. Configure Vagrantfile for Windows VM with RDP forwarded:

    config.vm.guest = :windows
    config.vm.communicator = "winrm"
    config.vm.network "forwarded_port", guest: 3389, host: 3389
    
  2. Enable Remote Desktop. In the VM:

    • Start > Settings > Remote Desktop > Enable Remote Desktop
  3. Install an RDP client
当你执行 vagrant up 命令时,你应该看到类似以下内容的输出:
==> default: Forwarding ports...
  default: 3389 (guest) => 3389 (host) (adapter 1)

然后,vagrant rdp 应该启动远程桌面并连接到虚拟机。

config.vm.provider "virtualbox" do |vb|下面,我应该输入什么来实际运行rdp,从vb中提供rdp服务? - John Peterson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接