Skip to content

Instantly share code, notes, and snippets.

@micheleb
Created July 8, 2015 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micheleb/f26cea573aa292f6a184 to your computer and use it in GitHub Desktop.
Save micheleb/f26cea573aa292f6a184 to your computer and use it in GitHub Desktop.
A script to add NAT forwarding rules to a VirtualBox VM
#!/bin/bash
if [[ "$#" -eq "4" ]]; then
VBoxManage modifyvm "$1" --natpf1 "$2,tcp,,$3,,$4"
else
echo 'USAGE: vm_forward_add vm_name rule_name host_port guest_port'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment