Skip to content

Instantly share code, notes, and snippets.

@ryanzyy
Created February 10, 2015 10:04
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 ryanzyy/ceb736b48481e92b5747 to your computer and use it in GitHub Desktop.
Save ryanzyy/ceb736b48481e92b5747 to your computer and use it in GitHub Desktop.
vbox port forwarding
vbox_manger = 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe'
(8000..8100).each do |p|
`"#{vbox_manger}" modifyvm "local-ubuntu" --natpf1 "port #{p},tcp,,#{p},,#{p}"`
end
#delete:
# `"#{vbox_manger}" modifyvm "local-ubuntu" --natpf1 delete "port #{p}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment