Set VirtualBox Preferences-"network-" plus a default host-only nic.
Then follow the settings here.
SSH login "ssh-l root 192.168.56.1-p 2222"
As for the SSH reference below, is copied from the book.
Yum Install SSH instructions: The installation of SSH, the general has been installed, if this step out of the Internet to check.
Ssh-keygen-t Dsa-p '-F ~/.SSH/ID_DSA Description: Generate the key, "~" is the current user folder simplified way,/home/xxxuser "-P" for the password, not set here. "-F" Specifies the generated key file, DSA is the key type. This command creates a ID_DSA and id_dsa.pub two files under the "~/.ssh/" folder, respectively, corresponding to the private key public key.
Cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys Description: The public key is appended to the authorization key.
SSH localhost verifies that you can log on.
SSH connection cent OS record in virtual box VM under Mac OSX