Ed's Big Plans

Computing for Science and Awesome

Phew! Sun Virtualbox Port Forwarding (on NAT) Solution

without comments

I finally found a solution for the port forwarding issue I was having with Sun VirtualBox (i.e. NAT provided a weird one-way mapping from which Tin (host) couldn’t dial into TinUbuntu (guest)…) — as far as I understand, this solution is guest operating system neutral but must be configured for each guest handled by a particular installation of Sun VirtualBox. That means that if you’re crazy like me and plan to put your virtual harddrives on USB sticks, you’d probably do just as well to put in a makefile that will do your configurations for you too. So here’s the solution, also saved in my wiki for extra truthiness!

Thanks to Evan and his “justwerks software” blog.

The following commands were issued…

cd /Applications/VirtualBox.app/Contents/MacOS

$VBoxManage setextradata "TinUbuntu"\
     "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP

$VBoxManage setextradata "TinUbuntu"\
     "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 22

$VBoxManage setextradata "TinUbuntu"\
     "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 2222

Which causes TinUbuntu TCP:22 to be forwarded to Tin TCP:2222.

In future, I should remove these rules and re-add them replacing “guesthttp” with my own name for this rule– In his blog, Evan has used a series of names: “guesthttp”, “guestssh” and “guestsql”– In reality, these are actually very good, unambiguous names that I’ll probably end up borrowing.

The one thing I should really dig around for is the meaning of “LUN#0”– it looks like something that’s important– the remaining virtual-directory-like objects in the configuration string look less daunting– “pcnet/0” is likely referring to the first virtual network adaptor connected to TinUbuntu.

Eddie Ma

October 16th, 2009 at 10:05 am

Posted in Technology

Tagged with ,