[Galaxy S I9000 Android Development] Arise:
port forwarding from host machine to VirtualBox - ssh example for easy copy/paste

For people on Windows, hating typing commands in virtualbox window, the solution is to ssh into the virtualbox using putty and do your job from there.

Some commands to do this job quickly:

1. Shut down the VM, close the virtualbox application.

2. open a cmd shell/window, and type: cd /D C:\Program Files\Oracle\VirtualBox

3. Now you have to use the "VBoxManage" command (you can find it in C:\Program Files\Oracle\VirtualBox folder)

3.1. So, if you have an Intel card, you must use something like:

VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/HostPort" 2222

3.2. if you have a pcnet card use something like:

VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Kernel Compiler" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222

3.3. Now, if you DON'T have a pcnet or an intel network card, then instead of e1000 or pcnet you must use the "nickname" of your card.

Your best bet to find this name is to open

"C:\Users\your_username\.VirtualBox\Machines\Kernel Compiler\logs\VBox.log

And search for "MAC"

You should get something like:

00:00:01.085 [/Devices/e1000/0/Config/] (level 4)
00:00:01.085 AdapterType <integer> = 0x0000000000000000 (0)
00:00:01.085 CableConnected <integer> = 0x0000000000000001 (1)
00:00:01.085 LineSpeed <integer> = 0x0000000000000000 (0)
00:00:01.085 MAC <bytes> = "0... 0... 2... 3... 2... a..." (cb=6)

As you can see above e1000 does the trick for me. If you don't have e1000 or pcnet, then you must have something else there, so use that value in the commands above.

If anything goes wrong and you f word your vbox, then remove the offending lines in

"C:\Users\your_username\.VirtualBox\Machines\Kernel Compiler\Kernel Compiler.xml

4. start virtualbox, start the image, and then try to ssh into it.

Ip: 127.0.0.1

port: 2222

Some explanations found on the net, could be maybe from virtual box manual, but I'm so lazy to read that:

VBoxManage.exe setextradata "__VMNAME__" "VBoxInternal/Devices/__CARDNAME__/0/LUN#0/Config/__RULENAME__/Protocol" __PROTOCOL__
VBoxManage.exe setextradata "__VMNAME__" "VBoxInternal/Devices/__CARDNAME__/0/LUN#0/Config/__RULENAME__/GuestPort" __GPORT__
VBoxManage.exe setextradata "__VMNAME__" "VboxInternal/Devices/__CARDNAME__/0/LUN#0/Config/__RULENAME__/HostPort" __HPORT__

~~~~~~~~~LEGEND~~~~~~~~~~

__VMNAME__ = name of VM from VirtualBox main window

__CARDNAME__ = name of virtual network adapter - pcnet for PCnet-FAST III, e1000 for Intel PRO/1000 MT Desktop, and so on

__RULENAME__ = name you want want the rule to be stored as

__PROTOCOL__ = TCP, or UDP - if you want to do both, you have to have a **second** set of rules with a **different** rulename (eg. SSH1 for TCP and SSH2 for UDP)

__GPORT__ = the destination port - for example, this could be "80" for a webserver

__HPORT__ = the external port - for example, this could be "8080" for a webserver if your ISP does not allow personal web servers on port 80