How to Connect to a VirtualBox Windows Guest Using Remote Desktop

Screen Shot 2015 11 02 at 4.02.48 PM

Oracle VirtualBox is a type-2 hypervisor that is popular on Windows, macOS, Linux, and Solaris. I switched from client Hyper-V to VirtualBox earlier this year and it has mainly been a good experience. I can’t say that one is necessarily better than the other – it’s swings and roundabouts. But in addition to some issues with network performance in Windows guests, which I address in a separate article, enabling access to virtual machines (VM) using VirtualBox Remote Desktop isn’t as straight forward as with Hyper-V. There are also some other problems to be aware of like trying to use VMs with a large screen resolution and installing 64-bit OS guests if another hypervisor, such as Hyper-V, is also installed on the system.

But primarily the main reason that I wanted to connect via VirtualBox Remote Desktop initially was because it isn’t possible to use higher display resolutions in VirtualBox VMs when accessing them using VirtualBox Manager. Connecting to a VirtualBox VM using Remote Desktop is the easiest way around the problem. And naturally, you might want to access a VirtualBox VM from devices other than on which the guest VM is hosted.

VirtualBox Remote Desktop Extension

VirtualBox has a feature called the VirtualBox Remote Desktop Extension (VRDE) and it is only available if you download and install the VirtualBox Extension Pack. But if you are connecting to a Windows guest, you don’t necessarily need VRDE and if you are not using VRDE, you don’t need to configure the Remote Display settings in VirtualBox Manager for the guest VM. You might decide to use VRDE and enable its Remote Desktop server if you want to use RDP to connect to a Linux VM. In the case of Windows guests, I say ‘don’t necessarily need’ because it might be required in some cases.

If you are using bridged networking and the host can communicate directly with the guest Windows OS, you don’t need to use VRDE. In situations where you are using a different type of network, like NAT, where the host cannot directly communicate with the guest OS, you can use VRDE to make a VirtualBox Remote Desktop connection. When using VRDE, any settings in Windows Server for enabling Remote Desktop are irrelevant because VirtualBox uses its own Remote Desktop server for VRDE.

Enable Remote Desktop in Windows Server

Before you can connect to Windows Server using Remote Desktop without VRDE, you should make sure that Remote Desktop is enabled in Server Manager.

  • Server Manager should open by default when you log in to Windows Server but if it doesn’t, just open the Start menu in your Windows Server VM and click on the Server Manager
  • In the left pane of Server Manager, make sure that Local Server is selected.
  • On the left side of the Properties section for the server, make sure that Remote Desktop is Enabled. If Disabled is shown, click Disabled, then check Allow remote connections to this computer, and then click OK.
  • Close Server Manager.
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)

Guest OS Network Configuration

If you want to connect to a Windows Server guest OS without the help of VRDE, you’ll need to change the default network setting for the guest VM from NAT to Bridged.

  • In VirtualBox Manager, select the VM you want to configure in the list on the left.
  • In the list of settings on the right, click Network.
  • On the Adapter tab, change ‘Attached to’ to Bridged Adapter using the menu.
  • In the Name dropdown menu, select the name of your host’s local network adapter. In my case, it is my notebook’s Wi-Fi adapter.
  • Click OK to apply the configuration.
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)

Once Remote Desktop is enabled in the guest OS and networking is configured so that the host can communicate directly with the guest OS, Remote Desktop should work. Open Remote Desktop from the start menu and enter the guest OS’s IP address to start the connection, just like you would in a physical environment.

Connect to a Guest VM Using VRDE

If you decide to use VRDE for VirtualBox Remote Desktop, install the VirtualBox Extension Pack.

  • Open VirtualBox Manager with administrator privileges.
  • In VirtualBox Manager, make sure all your VMs are powered off.
  • Then open Preferences from the File
  • In the Preferences dialog, click Extensions on the left.
  • Click the small green Add icon on the right of the dialog.
  • In the file browser dialog, select the extension pack you just downloaded and click Open.
  • Confirm that you want to install the extension pack and then you will see it listed in the dialog.
  • Click OK in the Preferences dialog.
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)

Once the VirtualBox Extension Pack is installed, you need to enable the VRDE server for the guest VM.

  • In VirtualBox Manager, select the VM you want to configure in the left pane.
  • In the list of settings on the right, click Display.
  • Switch to the Remote Display
  • Check Enable Server.
  • For the first VM that you can configure, you can leave the port set to 3389. But each VM that you configure for VRDE will need to be hosted on a unique port.
  • Click OK.
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)
How to Connect to a VirtualBox Windows Server Guest Using Remote Desktop (Image Credit: Russell Smith)

Now you can connect to the guest VM using Remote Desktop and VRDE. Open the Remote Desktop client in Windows from the Start menu and then use 127.0.0.2 as the IP address you want to connect to. If the guest VM is set to use the default RDP port (3389), then you don’t need anything else to connect. Where the RDP port is not 3389, you need to connect using the following format 127.0.0.2:3390 Replacing 3390 with the selected port number in your VM’s configuration.

Connecting from the host to a guest using Remote Desktop and VRDE is a strange experience in that you need to be already logged in to the VM to get access via Remote Desktop. You cannot log in using the Remote Desktop client. It’s not an ideal solution but if you need to use NAT networking, it is one option for enabling VirtualBox Remote Desktop access. Alternatively, you could add an additional network interface to your guest VM and set it to use Bridged networking so that you can connect to Windows without using VRDE. It adds complexity to the guest VM’s network configuration but makes access with Remote Desktop simpler.

FAQs

Can I use VirtualBox Remote Desktop to connect from a mobile device to my virtual machine?

Yes, you can use VirtualBox Remote Desktop to connect from mobile devices using RDP client apps. However, you’ll need to ensure proper port forwarding on your network and configure the VirtualBox Remote Desktop Extension (VRDE) with the correct network settings and security protocols.

Does VirtualBox Remote Desktop support multiple concurrent connections to the same VM?

VirtualBox Remote Desktop allows multiple simultaneous connections to the same virtual machine, but this feature requires the Enterprise or VRDP (VirtualBox Remote Desktop Protocol) edition and proper licensing. The number of concurrent connections can be configured in the VM settings.

Can I use VirtualBox Remote Desktop over the internet without a VPN?

While it’s technically possible to use VirtualBox Remote Desktop over the internet without a VPN, it’s not recommended for security reasons. Setting up a VPN or using an encrypted tunnel is strongly advised when accessing your VirtualBox Remote Desktop connections from outside your local network.

What’s the maximum resolution supported by VirtualBox Remote Desktop?

VirtualBox Remote Desktop supports resolutions up to 4K (3840×2160), depending on your host system’s capabilities and network bandwidth. The resolution can be dynamically adjusted during the remote session, and multiple monitors are also supported.

Does VirtualBox Remote Desktop support audio and USB device redirection?

Yes, VirtualBox Remote Desktop includes support for both audio streaming and USB device redirection. These features need to be explicitly enabled in the VirtualBox Remote Desktop settings, and the Extension Pack must be installed for full USB support.