How to Connect to a VirtualBox Windows Guest Using Remote Desktop
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 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 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.
Say Goodbye to Traditional PC Lifecycle Management
Traditional IT tools, including Microsoft SCCM, Ghost Solution Suite, and KACE, often require considerable custom configurations by T3 technicians (an expensive and often elusive IT resource) to enable management of a hybrid onsite + remote workforce. In many cases, even with the best resources, organizations are finding that these on-premise tools simply cannot support remote endpoints consistently and reliably due to infrastructure limitations.
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 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.
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.
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 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.
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.
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 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.