Monday, June 24, 2019

How to setup a VirtualBox Ubuntu virtual machine on a Windows 10 computer for remote desktop access

An Oracle VirtualBox virtual machine (VM) can be accessed from a remote Windows 10 computer through the remote desktop protocol (RDP) as if it were running locally on the local desktop. But this is not enabled by default; to allow remote desktop connections, the VM's remote display parameters must be set and enabled. The following steps show how this can be done.

Setting up a VM on the remote PC for remote access
  1. On the remote Windows 10 PC, start Oracle VirtualBox.

  2. In the list of virtual machines, select a VM, e.g. Ubuntu19. Click Settings.

    The Settings dialog box appears.
  3. Click Display and then the Remote Display tab.
  4. Toggle on the Enable Server field. In the Server Port field, type in an unused port e.g. 5000. Click OK.
  5. Click the black drop down arrow on the Start icon and choose Start Headless Start.



    The Virtual machine is started without displaying any windows.

Connecting to the remote VM from a local PC
  1. Now on a local PC e.g. an Ubuntu 18.04, start up a RDP client e.g. Remmina Remote Desktop Client.
  2. Create a new Remote Desktop Profile.

  3. In the Name field, type in a suitable name, e.g. demo_vbox.
  4. In the Protocol field, choose RDP - Remote Desktop Protocol.
  5. In the Server field, type in the IP address and port number of the remote Windows 10 computer, e.g. 192.168.123.123:5000.
  6. Choose an appropriate Resolution and Color depth.
  7. Save and connect to the VM.

    The remote desktop is displayed.

If the remote VM cannot be connected successfully, then it is possible the remote Windows 10 PC's firewall is blocking the network port. To open the port, the following steps can be done.

  1. On Windows 10, click the Start button and then the Settings icon.

    The Settings dialog box appears.
  2.  Click Windows Security. Click Firewall and network protection.

  3. Scroll down and click Advanced settings.

    The Windows Defender Firewall with Advanced Security on Local Computer dialog box appears.
  4. Click Inbound Rules.

  5. Scroll down and ensure the vboxheadless rule exists and enabled. If not create a new rule and enable the selected port e.g. 5000.

No comments: