Thursday 12 February 2015

How to do port forwarding in virtual box.

How to do port forwarding in virtual box.


1. select your vm that you want for port forwarding.
NOTE: Make sure the vm is in stop mode.
2. select “settings"
3. select “Network"
4. select any free Adapter. “Lets say Adapter 2"
5. enable Enable Network Adapter 
6. In Attached to dorpdown, select NAT
7. Select Advanced
8: In Adapter Type: Select “Paravirtualized Network (virtio-net)”  [ This is important ]
9. Select “Port Forwarding"
10. In Right hand part of the “port forwarding” dialog box, select “+"
11. Provide the :
  Name: Anything you want. example for ssh, say “ssh"
  Protocol: Type of protocol [ for ssh: TCP ]
  Host IP: provide hostname from which host you want to connect to [ over here: 127.0.0.1 ]
  Host Port: On what port of that Host you want to connect to remote port [ example: 60022 ]
  Guest IP: Leave it Blank

  Guest Port: To what port you want to connect from the above host. [ for ssh, the default 22 ]