Wednesday, July 1, 2015

Virtual Box : SSH (How to login to a guest OS)

Virtual Box : SSH (How to login to a guest OS)

<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

solvedstack

No comments:

Post a Comment