Monday, July 2, 2012

VirtualBox VM RDP access

For remote access to a VM's user interface, RDP is an interesting additional option.
Of course, other usual client network access methods apply as well.
 
$ read RDP_USER
$ RDP_PASS=$(stty -echo; read INPUT; stty echo; echo $INPUT)
$ RDP_HASH=$(VBoxManage internalcommands
  passwordhash "$RDP_PASS"cut -d' ' -f3)

$ VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"

$ VBoxManage modifyvm vm1
  --vrdeauthtype external
  --vrdeport 33891
  --vrde on

$ VBoxManage setextradata vm1
  "VBoxAuthSimple/users/$RDP_USER" "$RDP_HASH"