RDP into VirtualBox on Windows

13

10

My co-worker has an old Mac, and needs to test something on Windows. His Mac is not powerful enough to run a VM, so he needs the ones I have. I have a few VMs that fit his needs.
The solution I thought of was for me to host the VMs, and for him to connect to them through RDP. If you have a simpler solutions, I'm all ears. And no, we don't (yet) have a local server to run the VMs on in headless mode (that would be perfect).

I use VirtualBox 4.2.12, hosted on Windows 7 Pro. The VM I'm using are downloaded from http://www.modern.ie; right now I'm trying with Windows 7 Enterprise.
The VirtualBox addons are installed on the guest OS; I even have reinstalled them, just in case.

In the config of the VM, in the Display/Remote Access tab, I have checked "Enable the server", port 3390, no authentication, allow multiple connections. I have also tried with various random ports, with the same result

In the Network tab, I have tried NAT and bridge:

  • When I use "NAT", when I try to connect to m.y.i.p:3390 using mstsc, I get a message: Your computer could not connect to another console session on the remote computer because you already have a console session in progress. I can't find much on this error on Google, and anything I found didn't work, like here.
  • When I use "bridge", I get a classic message when you try to connect to a computer that doesn't exist or has RDP disabled, using the VM's IP, even though I have disabled the firewall in the VM.

The firewall has been disabled on both the guest and the host OS.

Do you have any idea on how I can get a remote access into these VMs ?

Thanks

thomasb

Posted 2013-06-18T13:14:09.347

Reputation: 421

My issue was an older version of the Extension Pack was installed; it was disabled without any error message showing when the VM started. Here's how to update: https://forums.virtualbox.org/viewtopic.php?f=7&t=44337

– user423430 – 2017-04-07T03:28:05.580

Try another port number? Check your Firewall? – David – 2013-06-18T14:51:40.447

I tried other ports, and I have disabled the firewall on both the host and the guest OS. – thomasb – 2013-06-18T15:03:55.450

@thomasbtv: Have you tried using the VM hostname instead of IP address? – James P – 2013-06-19T08:33:58.923

Answers

19

I have found a not-very-friendly-but-works solution:

In the VM's settings:

  • Set the RDP port to anything (it works with 5030)
  • Set the network access to NAT
  • Go to Network > Advanced > Port redirection, add the following line:
    RDP ; TCP ; host's IP ; 5030 ; 10.0.2.15 ; 3389

The host's IP must be the actual host's IP if you want to connect with another computer, or 127.0.0.1 if you want to connect on the host computer.

My VMs all seem to have 10.0.2.15 as IPs, but maybe that's a coincidence. Check that, if it doesn't work.

On the guest OS, check that RDP is enabled: on Win7, right click computer > properties > Remote settings (on the left panel) > Allow connections (I used the "less secure" one)

The VMs downloaded on modern.ie have an "auto-logon" feature that's nice in general, but annoying in this scenario (they might prevent you from logging in). On Win7, run "netplwiz" and check "Users must enter a user name and password". The password of the user can be found here (it's Passw0rd!)

thomasb

Posted 2013-06-18T13:14:09.347

Reputation: 421

Also ensure that the firewall on your Windows guest is disabled. You can do this by executing the following in a Command Prompt or PowerShell session: netsh advfirewall set allprofiles state off. – Carlos Nunez – 2014-11-02T19:48:42.867

Make sure to enable RDP on the guest! If you don't you will get a nasty "connection refused by host" – phil – 2014-12-03T17:41:26.607

..and watch out for anything that disables it, like Avast/AVG installs. – mckenzm – 2019-07-04T01:36:36.993

3

The above answer (by cosmo0) should solve the problem, except if you need authenticated connection. For authentication, choose external in VM Settings > Display > Remote Display > Authentication Method. Then in RDP client, press Show Options and tick Allow me to save credentials. Press connect and it should prompt you with loging/password dialog.


If it doesn't work for you, then create RDP user as follows. Locate VBoxManage.exe command line tool (in my case it was inC:\Program Files\Oracle\VirtualBox\) and perform following commands while VM is off:

VBoxManage internalcommands passwordhash "your_password"

you will get a hash here. Copy it. Then continue with:

VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
VBoxManage modifyvm "your_VM_name" --vrdeauthtype external
VBoxManage setextradata "your_VM_name" "VBoxAuthSimple/users/your_username"
your_hash

This way your create an RDP user that should work. NOTE, this user is NOT related to any existing users in guest or host os, its for VirtualBox only.

nazikus

Posted 2013-06-18T13:14:09.347

Reputation: 265

1

This should work without running a server on the VM. It is VirtualBox's server you are connecting to.

It should not be necessary to start headless.

Do use a different port of you have enabled RDP to your "client". Do allow multiple screens.

mckenzm

Posted 2013-06-18T13:14:09.347

Reputation: 829