<1> Install SSH
Sure, you have to install a ‘ssh’ service on a guest OS
$ sudo apt-get install -y openssh-server
<2> Change VBox setting
# A guest OS name : my_ubuntu
# Host port : 3022
# Guest port : 22
#
# Sure, you can change port number as below
# $ emacs /etc/ssh/sshd_config
# $ service ssh restart
$ VBoxManage modifyvm my_ubuntu --natpf1 "ssh,tcp,,3022,,22"
# You can check VBox settings as below
$ VBoxManage showvminfo myserver | grep 'Rule'
<3> SSH into the guest OS on Virtual Box
# Even if network is unreachable, no problem
$ ssh -p 3022 user@127.0.0.1
* Referense page
No comments:
Post a Comment