To enable remote desktop on a VirtualBox machine, you have to follow these steps:
VBoxManage modifyvm MachineName -vrdp
This command enables rdp on the virtual machine
VBoxManage startvm MachineName -type vrdp
It starts virtual machine, listening for rdp request on port 3389 (default port)
rdesktop-vrdp localhost
Connects virtual machine with rdp (You can use rdesktop too).If you want to change rdp port, use this command:
VBoxManage modifyvm MachineName -vrdpport <port>
Also, enabling authentication for rdp is possible:
VBoxManage modifyvm MachineName -vrdpauthtype null | external | guest
VBoxManage is the command line interface of the VirtualBox.
You can make these settings with GUI: Settings -> Remote Display -> Enable VRDP Server
If you want to use your virtual machine with vrdp only, you can use this command simply:
VBoxHeadless -startvm MachineName
Note: RDP server is not included in Open Source Edition of the VirtualBox. If you want to use this feature, you have to use closed-source edition.