1

I have a Dell PowerEdge R710 server with ESXi 5.5 installed on it. Server is connected to switch, switch is connected to router, router has internet access. On ESXi I have one virtual machine, Windows Server, IP: 10.0.0.11/24. My virtual machine is able to access the Internet but what should I do to be able to access my Windows Server (virtual machine on ESXI host) from the Internet (for example for remote desktop connection)?

5
  • Start some troubleshooting sets. Are your ports set up correctly to point at your server and do you have any firewall rules (or not as the case me be) which will restrict access. Feb 25, 2014 at 14:33
  • @MatthewWilliams: Im afraid thats not the firewall issue (not yet;) I dont know how to properly set up my public address - from where can I obtain it? Thats my biggest question. My router is J-SRX210H (my gateway). I would like to configure it like this, when I connect to the specific IP through the Internet, my remote desktop will connect me with my virtualized Windows Server. But the problem is deeper: if I have few virtual machines I want to access from the outside and have only one public address? Feb 25, 2014 at 14:37
  • You can get your public ip by typing "what is my IP" into Google. You can setup remote desktop following any of the many tutorials from Google (I can't recommend on because I don't know what software you are using for this). If you want to access each Virtual Machine from a single IP you would either need to access the host OS or set up port rules for each system. Feb 25, 2014 at 14:53
  • @MatthewWilliams: Ok, it cleared some things a little bit. Yes, my main concern is to be able to access from the Internet each virtual machine I will have on my ESXi host. What should I do to achieve this? How to setup such rules you mentioned about? Feb 25, 2014 at 14:56
  • If you need to provide full access to each and every VM, you need as much public IPs. Which you won't get, unless you start throwing tons of money at your ISP. Unless you're ready to do this, you need to set up port forwarding for every single host, manually.
    – Daniel B
    Feb 25, 2014 at 14:58

5 Answers 5

3

Assuming you can reach the server via RDP from within the LAN, all you have to do is set up port forwarding on your router. The default RDP port is 3389. Sometimes ISPs have a firewall externally, and in that case you would need to forward another incoming port which is more likely to be open, e.g. 443, to your server internally.

This challenge has virtually nothing to do with VMs in general or ESXi in particular.

5
  • It has everything to do with the VMs if the challenge is to RD into specific environments rather than the host server itself. Since the comments are discussions public addresses the solution required access from outside the LAN. Feb 25, 2014 at 15:04
  • 1
    As long as the VMs are connected to the same subnet as the router, it does not matter that they are virtual. They could be physical. The challenge would be identical.
    – eivamu
    Feb 25, 2014 at 15:13
  • Yes the point was access to specific systems rather than a host OS. The fact they are virtual makes no difference. I am also aware there isn't any specific reason here to need this type of access, but we have no idea what reason is behind the request so just answering the question as it's given. Feb 25, 2014 at 15:15
  • +1 for the good point on subnet usage in this instance. Feb 25, 2014 at 16:44
  • OK, Matthew, thank you for the feedback regarding directly answering a somewhat unclear question. I will take this into consideration next time.
    – eivamu
    Feb 25, 2014 at 18:10
2

Port forwarding is indeed the way to go. I have a similar setup with a R710 running ESXi.

  • 1st I have a port forwarding rule to expose iDRAC so that I can manage the server remotely - from anywhere. Move away from ports 80 & 443 for security reason.
  • 2nd you might want to expose EXSi console as well using the same technique.
  • 3rd For my CentOS farm running on ESXi I setup SSH on specific port for each VM.
  • 4th You set port forwarding rule for each so that I can reach out to them through the same external IP.
  • This is a scenario where using a free service to map your IP to a dummy domain name becomes handy. I use noip.com. Free and reliable.

Update: With more recent routers, no need to set custom SSH port on each guest VM. You can have a rule on your router to redirect traffic received on port 222 (as an example) and redirect incoming traffic to a specific guest on port 22 (default SSH port) - based on IP or hostname. Much more easier to manage!

1
1

In order to set up what you require you will need to set up port forwarding rules for each VM you have (I assume you don't have a collection of static IPs to hand). This will also include changing the listening port for each VM you have with Remote Desktop enabled.

If you wish to access your host OS then connect to your router (Default Gateway) admin page and set up a forwarding rule on port 3389 pointed to the internal IP of your host.

Within your first VM enable your Remote Desktop as usual, but now you will need to change the listening port. Since you didn't specify the OS of your VMs I will assume Microsoft to match your host. If not let me know. To change your listening port follow the steps:

1. Start Registry Editor.
2. Locate and then click the following registry subkey:
3. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
4. On the Edit menu, click Modify, and then click Decimal.
5. Type the new port number, and then click OK.
6. Quit Registry Editor.
7. Restart the computer.

Obviously you can change the ports however you want. So a logical method would be to increment your port usage by 1 per server. Once again go into your router and set up port forwarding rules (one per machine) using your new port and IP address of the VM.

I have used this method to set up Remote Desktop into two Windows VMs on a Windows Server 2008 RT host in the past without incident.

Source

Disclaimer: I am aware the reference is for XP, but it seems to work on my Windows 7 machine and, once again, you have not specified your OS, so please add additional information for an updated answer as required.

1

Obviously I am not an ESXi expert or I would likely not have found this thread, but wouldn't it be easier to setup a VPN tunnel and just VPN into the network? So long as you have remote desktop (or ssh for linux/mac) turned on for each vm, which has to be configured anyhow, then you would only need the ports forwarded to the VPN server to gain access.

0

I know this post is a few months old. But just in case, here is my way. I port forward 1443 to 443 on my ESXi server (if you don’t use 443 for other services you can go straight 443 to 443). This is for vSphere to access ESXi server itself. To access the VMs themselves, you will also need to port forward 902. Then simply put MY_DOMAIN:1443 in the "IP Address / Name" field to log in. Because I run multiple VMs, I find these to be a simple solution, as I only have to forward 2 ports per ESXi server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .