Saturday, February 14, 2015

Port forwarding or Virtual box to Local machine/Mac

Connecting VIRTUAL box on mac

The best way to login to a guest Linux VirtualBox VM is port forwarding. By default, you should have one interface already which is using NAT. Then go to the Network settings and click the Port Forwarding button. Add a new Rule:

Host port 3022, guest port 22, name ssh, other left blank.

or from command line

VBoxManage modifyvm myserver --natpf1 "ssh,tcp,,3022,,22"

where 'myserver' is the name of the created VM. Check the added rules:

VBoxManage showvminfo myserver | grep 'Rule'

Please be sure you don't forget to install an SSH server:

sudo apt-get install openssh-server
To SSH into the guest VM, write:

ssh -p 3022 user@127.0.0.1
Where user is your username within the VM.

No comments:

Post a Comment

CSS tricks

Mixed paint in background: background: linear-gradient(to right, #b6e358, #38b143) Grid view: display: grid; grid-template-columns: a...