On a Mac change directories to:

/Applications/VirtualBox.app/MacOS

vim portfw.rb

#!/usr/bin/ruby
if(ARGV.size < 4) 
	print "Ussage: ruby portfw.rb    \n"  
	exit()
end
print "Adding Portforwarding from #{ARGV[2]} to #{ARGV[3]} named (#{ARGV[1]} on VBOX:#{ARGV[0]}\n"

`./VBoxManage setextradata "#{ARGV[0]}" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/#{ARGV[1]}/HostPort" #{ARGV[2]}`

`./VBoxManage setextradata "#{ARGV[0]}" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/#{ARGV[1]}/GuestPort" #{ARGV[3]}`

`./VBoxManage setextradata "#{ARGV[0]}" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/#{ARGV[1]}/Protocol" TCP`

This simple script will make it easy to port forward local ports to a NATed virtualbox.

I recommend adding local aliases for ssh and scp

i.e.

# ~/.bashrc
alias sshl='ssh -p 2222'
alias scpl='scp -p 2222'

so you can just type

sshl localhost