How to control VirtualBox Windows VM guest remotely

We could access our VirtualBox VM guest locally with ease, but what if the VM guest is remotely located, this post will show us 2 ways to access remote Windows VM guest and how to copy files between local machine and remote VM guest

Foreword

VirtualBox is a popular free VM software which we could use to create VM guest to install new OS instead of preparing a physical machine. Sometimes we need to copy some files to the VM, usually, if the VM is hosted on our local machine, we could do this by enabling share folders or dragging, but what if the VM is hosted on remote machine

How to access remote VM guest

There are 2 ways to access our remote VM guest:

  1. VirtualBox Remote Display Protocol (VRDP)
  2. Microsoft's Remote Desktop Protocol (RDP)

Next, let's dig into these ways.

VirtualBox Remote Display Protocol

It is easy to enable VRDP:

  1. Open Settings window of the VM
  2. Click Display Icon
  3. Switch to Remote Display tab
  4. Check Enable Server and confirm Server Port is set to 3389, Authentication Method is Null
  5. Click OK to confirm modification

https://i.loli.net/2018/08/13/5b7132cf3a950.png

Microsoft's Remote Desktop Protocol

RDP is integrated in professional version of Windows or above, first we need to check how our VM is connected to the network, usually 2 modes are used:

NAT

In this mode, the physical machine act as a gateway, VM guest connect to the network through host, we need to configure port forwarding for this mode:

  1. Open Settings window of the VM
  2. Click Network Icon
  3. Click the arrow in front of Advanced
  4. Click Port Forwarding button

https://i.loli.net/2018/08/13/5b71360235dbf.png

  1. Click + Icon, input the host ip, port, and the guest ip, port which it is forwarding to, Click OK after config is finished. 0.0.0.0 stands for any ip of the machine, 3389 is the default port of RDP

https://i.loli.net/2018/08/13/5b71365d95351.png

Bridged

In this mode, the VM guest will get an local ip as the host, we could access our VM guest directly using this ip, without any extra configuration.

Enable RDP on VM guest

RDP is not enabled by default, we should enable it first, taking Win10 for example:

  1. Launch Windows Explorer
  2. Right Click This PC, click Properties
  3. Click Remote settings
  4. Select Allow remote connections to this computer

Comparison of VRDP and RDP

We could use Remote Desktop Connection (mstsc.exe) to access our VM guest, input the forwarding IP:port of the host under NAT mode, or the guest IP under Bridged mode, After trying both VRDP and RDP, we found that:

  1. No authentication is needed for VRDP if Authentication Type is set to Null, but if Authentication Type is set to other values, we can not access our guest.
  2. RDP needs local account authentication of the guest.
  3. Can not copy files using Ctrl-C, Ctrl-V for VRDP, but it works for RDP.
  4. Visual style for VRDP is the same as local access, but Aero is enabled if we are using RDP 4.1 VRDP https://i.loli.net/2018/08/13/5b713f2ab8ce8.png 4.2 RDP https://i.loli.net/2018/08/13/5b713f750af3f.png

Conclusion

This post covered 2 ways of accessing remote VirtualBox Windows VM guest, VRDP is simple to set, but is limited. The configuration of RDP is more complicated, but we can use it the same way as we access a remote physical machine. RDP is recommended if you need to copy files between local machine and remote VM guest.