ssh -p xxxx root@localhost / port forwarding doesn't work no more

Discussions related to using VirtualBox on Mac OS X hosts.
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

Hi,

I'd dozens of VMs running and ssh'ed into them by ssh -p 'portnumer' root@localhost.
It always worked.
Now it stopped working but just for newly created VMs.
I know how to configure port forwarding. It just doesn't work no more for new VMs.
I get:
Christians-MBP:$ ssh -p 6666 root@localhost
ssh: connect to host localhost port 6666: Connection refused
Christians-MBP:$ ssh -p 3334 root@localhost
ssh_exchange_identification: read: Connection reset by peer
Christians-MBP:1$

- sshd is running on the VM
- there's neither something in messages nor in journal
- tcpdump doesn't show anything, even not any RST message.

In my old VMs I can ssh in as I ever could.
Any newly created: SLES, CentOS, Ubuntu.. no way, all behave the same way.

I reinstalled VirtualBox several times.. it remains the same.

Thanks for any help!

Chris
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by socratis »

ChrisLi wrote:Now it stopped working but just for newly created VMs.
In the VirtualBox Manager, right-click on a VM that's "not working", Show in Finder. ZIP that ".vbox" file.
Do the same thing for a "working" VM. Attach both ZIP files to your response.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Port Forwarding just stopped working

Post by ChrisLi »

Hi,

I used VBox since many years on my MacBook Pro with tons of Linux-VMs.
I always log in via ssh -p 'myport' user@localhost to get the console and it just worked until a couple of weeks ago.
On my old VMs it still works but on my newly created it just doesn't work. I get a "connection closed by peer" or similar messages that make no sense.

I un-/reinstalled VBox completely and after reinstalling it makes no difference: port forwarding on my old VMs work but not on new ones.
I'm running the latest version, updated today..

Thanks for any hint!! I'm an IT-Trainer and I check out a lot of things on my VMs.. and this is worst case for me.

Best regards,
Chris
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by socratis »

I merged your new topic with the one from 2 months ago. Next time I'll simply remove your duplicate. Duplicate posts are not allowed. It's not good etiquette...
BTW, you have yet to reply to your first one...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

Hi Socratis,

sorry for the duplicate, I just didn't find my first poste and wasn't sure if I posted one anymore.
Thanks so much for looking into it, attached are the 2 zipped .vbox files.

Best,
Chris
Attachments
NotWorkingVM.zip
(1.49 KiB) Downloaded 207 times
workingVM.zip
(1.64 KiB) Downloaded 210 times
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by socratis »

ChrisLi wrote:I know how to configure port forwarding. It just doesn't work no more for new VMs.
How exactly were you configuring port forwarding? Because there is a key difference in your working CentOS 7.1 VM:
<Forwarding name="Rule 1" proto="1" hostip="127.0.0.1" hostport="2222" guestip="10.0.2.15" guestport="22"/>
You need to configure your new VMs the same as the old; change their settings in the networking section. BTW, it's not all ports that you were forwarding, it was port 2222 only...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

I go to settings -> network -> advanced settings -> port forwarding -> and used ports 3333, 4444, 5555 and 6666.
That's the only difference in the settings to get on the different boxes simultaneously.
What do you mean by key difference?

Thanks!
Chris
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

End of ideas?

- Chris
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

--- unsolved ---
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

I tried it with setting up a VM under a new user account on my laptop but it's the same, no more portforwarding.

- chris
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by socratis »

You have to explicitly enable port forwarding. Like you did in your old machines (the "key difference").
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

What more can I do than clicking on Port Forwarding and entering the needed info?

- Chris
Attachments
Screen Shot 2018-03-15 at 21.39.49.png
Screen Shot 2018-03-15 at 21.39.49.png (24.52 KiB) Viewed 18253 times
Screen Shot 2018-03-15 at 21.39.16.png
Screen Shot 2018-03-15 at 21.39.16.png (86.13 KiB) Viewed 18253 times
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

In the two .vbox files you see exactly the same line which prove that port forwarding is enabled on both:
working VM:
<NAT>
<Forwarding name="Rule 1" proto="1" hostip="127.0.0.1" hostport="2222" guestip="10.0.2.15" guestport="22"/>
</NAT>

not working VM:
<NAT>
<Forwarding name="Rule 1" proto="1" hostip="127.0.0.1" hostport="6666" guestip="10.0.2.15" guestport="22"/>
</NAT>

Hence there's no key difference but as I said just the port.
I tried even the same port 2222 in the not working VM (while the working one was down..) but it doesn't work ether.

- Chris
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

Socratis,

did you see that both machines are configured the same?

- Chris
ChrisLi
Posts: 11
Joined: 7. Jan 2018, 21:44

Re: ssh -p xxxx root@localhost / port forwarding doesn't work no more

Post by ChrisLi »

After several months suffering this problem it just works again; I just set up a new CentOS7 VM with btrfs..
.. configured the port forwarding as ever..
.. and it works again..
No reason detected; just a bug.

Bad Support here, proposing unlogical hints; or he had no time to look into it..

c
Post Reply