VirtualBox 默认服务器名字是ubuntu_server 

VBoxManage setextradata ubuntu_server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata ubuntu_server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
//这个端口可以自由设定
VBoxManage setextradata ubuntu_server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
//ubuntu系统中的SSH服务端口22

通过dos命令终端修改VirtualBox 服务器名字是ubuntu

在安装virtualBox 下通过dos命令终端分别输入三行命令
VBoxManage setextradata ubuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata ubuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
//这个端口可以自由设定
VBoxManage setextradata ubuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
//ubuntu系统中的SSH服务端口22