An excellent article on the subject: Source.
Run these 3 commands from shell. SUDO not required.
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort” 2222
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort” 22
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol” TCP
Where…
- “name of vm” is your virtual machine name
- ssh is the name of the service. This is _required_ to be unique among the three commands.
- Ports 2222, 22, TCP respectively with your desired host port, guest port, and protocol.
…then shutdown your VM and Virtualbox host application, and restart them.
To Confirm the above settings are in place:
VBoxManage getextradata “name of vm” enumerate
To remove the settings made above from the VM: (again substituting the variables as appropriate).
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort”
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort”
VBoxManage setextradata “name of vm” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol”


























0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
You must log in to post a comment.