Denis Kozlov - 2015-12-08

For the reference:

Chapter 7. Remote virtual machines. 7.1.5. RDP authentication
https://www.virtualbox.org/manual/ch07.html#vbox-auth

  1. Enable VBoxAuthSimple with the following command:
    $ VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"

  2. To enable the library for a particular VM, you must then switch authentication to external:
    $ VBoxManage modifyvm "<vm>" --vrdeauthtype external

  3. Obtain the hash value for your desired password:
    $ VBoxManage internalcommands passwordhash "<password>"

  4. Configure users and passwords (hashes) by writing items into the machine's extradata:
    $ VBoxManage setextradata "<vm>" "VBoxAuthSimple/users/<user>" <hash>

Replace <vm> with the VM name or UUID, <user> with the user name who should be allowed to log in, <password> with your desired password and <hash> with the encrypted password.