Hi Alvaro,

Thanks for your explanation.

Just want to make sure I understand your response.  There are two ways to 
do this, either via 

1) forwarded_ports, or 
2) public network

------------------------------------------------------------------------------------------------------------------------------------------------------------------
For 1, I did the following:

config.vm.network "forwarded_port", guest: 3389, host: 3389, id: "rdp", 
auto_correct: true

According to the doc:

"""
Defining a Forwarded Port
The forwarded port configuration expects two parameters, the port on the 
guest and the port on the host. Example:

Vagrant.configure("2") do |config|
  config.vm.network "forwarded_port", guest: 80, host: 8080
end
This will allow accessing port 80 on the guest via port 8080 on the host.

For most providers, forwarded ports by default bind to all interfaces. This 
means that other devices on your network can access the forwarded ports. If 
you want to restrict access, see the guest_ip and host_ip settings below.
"""

After

$ vagrant rdp

on the host.  I tried to connect from another node:

$ xfreerdp /u:vagrant /v:<hostip>:3389

This did not work.  Am I doing something wrong?

Note:
$ xfreerdp /u:vagrant /v:127.0.0.1:33389 works from the host (localhost)
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------

For 2. I followed an stackoverflow recommendation:

config.vm.network :public_network, :bridge => 
'eth0',:use_dhcp_assigned_default_route => true


This got the VM to get a DHCP address, and I was able to connect via:
$ xfreerdp /u:vagrant /v:<guest_ip>:3389

where I got the guest_ip by first xfreerdp ... 127.0.0.1, then querying for 
its assigned ip :
is there a better way of getting the assigned guest vm's ip address from 
the host?

------------------------------------------------------------------------------------------------------------------------------------------------------------------

In any case 2. seems to work for now, but I don't quite understand why the 
forwarded_ports method 1. doesn't quite work.

Thanks,
-f



On Tuesday, March 27, 2018 at 12:27:59 AM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> hello
>
> exactly in the same way you will do with a VM without vagrant.
>
>
> port fwd localhost 3389 -> 3389 allows you to connect from where that port 
> is valid, ie localhost 
>
> if you want to connect from the network
>
> - check whats the IP the VM got from public_network
> - check firewall allows incoming connection to port 3389
> - profit
>
> Thanks
> Alvaro.
>
>
> On Tue, Mar 27, 2018 at 8:46 AM, Frankie Liu <[email protected] 
> <javascript:>> wrote:
>
>> Hello Alvaro,
>>
>> I hope it is ok to reply here, I read docs but there is not much 
>> information on how to set it up correctly for rdp.
>> I tried various combinations of forwarded_ports, public_network
>>
>> config.vm.network "forwarded_port", guest: 3389, host: 3389, id: "rdp", 
>> auto_correct: true
>> config.vm.network "public_network"
>>  
>>   # config.vm.communicator = :winrm
>>   # config.winrm.host = "ip.of.the.host"
>>   # config.winrm.guest_port = "5986"
>>   # config.winrm.port = "55986"
>>   # config.winrm.transport = "ssl"
>>   # config.winrm.ssl_peer_verification = false
>>
>> Note that I can connect via 127.0.0.1:33389 which comes from the message 
>> after
>> vagrant rdp.  I can connect from the host machine, but connections from 
>> other devices
>> in the network have been unsuccessful.  Could you let me know how to set 
>> it properly?
>> I think rdp and firewall seem to work because I can connect via loopback 
>> 127.0.0.1 using
>> xfreerdp -u vagrant 127.0.0.1:33389.  But connection from other network 
>> nodes doesn't
>> seem to work.
>>
>> Thanks,
>>
>> -f
>>
>> Quoted from your previous post:
>> If you are familiar with rdp over the network, then you need:
>> - add a private or public network or add port fwd to 3389
>> - ensure rdp is enabled and firewall is open
>> - ensure the user you want to use is allowed to use rdp
>> - your rdp client can use the box rdp version
>> - connect either by public/private IP and port 3389. Or the port redirect 
>> of localhost:3389
>>
>>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>> IRC: #vagrant on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/66e84ad1-e8ab-4a3a-9fbb-803584046a83%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/66e84ad1-e8ab-4a3a-9fbb-803584046a83%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Alvaro
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/6dc75793-c2b2-4090-b47b-1c0f889ec1a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to