I want to open an SSH connection from my laptop to desktop over an SSH (reverse) tunnel. I want to do that in one step using ProxyCommand (and netcat). It works when run from the installed OS on my laptop. It fails when run from a VirtualBox guest on my laptop.

My normal setup is that Kubuntu 12.04 is running in VirtualBox on the desktop and Kubuntu 12.04 is installed directly on my laptop. This works fine.

However, if I try to do the exact same thing with a Kubuntu 12.04 VirtualBox instance on my laptop, it fails as I will detail below.

Here's what my SSH tunnel looks like:

laptop--->nat--->middleman<--nat<--desktop

The desktop & laptop run Kubuntu 12.04 regardless of whether I'm using VirtualBox; and the middleman is Ubuntu 8.04.

I'll describe my SSH tunnel in more detail. Regarding this leg:

middleman<--nat<--desktop

...here is how it is established:

autossh -M 5234 -N -f -R 1234:localhost:22 user@middleman.com

That part is automatic and trouble-free.

From the laptop:

laptop--->nat--->middleman

I can connect to middleman and then from the middleman to the desktop in two steps under all conditions:

Here's the problem. This works when run directly from my laptop (where Kubuntu 12.04 is installed). But when I run it from VirtualBox instance of Kubuntu 12.04 (guest) on my laptop, it does not work. SSH asks for the password for middleman. There is no password set up, so I cannot connect.

The strange thing is that running the two separate commands allows me to connect to my desktop and it doesn't ask for a password. The ssh -vvv option shows no errors and nothing helpful.

I have been troubleshooting all day and I cannot find any difference in settings between the VirtualBox instance and the host OS on my laptop. I use the exact same id_rsa keys (public & private), the same user, and auth.log on the middleman server indicates it sees the same IP address in both cases.

So why would running VirtualBox on my laptop make this SSH tunnel stop working (at least working in one step)?

I do not understand why the problems shows up only when running VirtualBox, but since some feel it is related to endian-ness, maybe that explains it in a very nebulous way. Anyway, that's resolved it for me.