VMware Communities
ade76
Contributor
Contributor

SSH not working with port forwarding

I've set up my Linux VM with NAT and set port forwarding 5022 to 22 

ade76_0-1668714622748.jpeg

I can see that 5022 is open on the host telnet or nc show a succesful connection, when I try to ssh i get disconnected. As if it's not passing the the connection. 

I can ssh to the guest from the host fine so I know it's up and running, putty on a windows box is a no and blink on an ipad also a no. 

VMware Fuision pro 12.2.4 

0 Kudos
6 Replies
ade76
Contributor
Contributor

So nobody has answers for this? 

Anyone at VMware able to point me in the right direction?  

Or is this just a feature that doesn't work? 

 

0 Kudos
Technogeezer
Immortal
Immortal

Have you checked any logging in your VM to see if the ssh daemon has even gotten a connection request? 

What's the exact error message being thrown by the ssh client? Is is simply not connecting or is it saying "connection refused".

I'm assuming that the VM is connected to your vmnet2 network.

Is the host running a firewall and is it configured to let port 5022 traffic through? 

This forum is a user-to-to user forum, and not official VMware support.. VMware employees do participate here, but may not respond as they do it on their own time.

- Paul (Technogeezer)
Editor of the Unofficial Fusion Companion Guides
0 Kudos
ade76
Contributor
Contributor

Something isn't quite right here

 

 

Configured subnet: 192.168.105.0
Setting vmnet-dhcp IP address: 192.168.105.254
Opened: vmnet2
Recving on     VNet/vmnet2/192.168.105.0
Sending on     VNet/vmnet2/192.168.105.0
Forked child process, pid=79588
Nov 24 15:43:17 VNLNetCfgLoad - Failed to load product config file: /Library/Preferences/VMware Fusion/config, error: Cannot open file "/Library/Preferences/VMware Fusion/config": No such file or directory.

Nov 24 15:43:17 VNL_Load - LOG_ERR logged
Nov 24 15:43:17 VNL_Load - LOG_WRN logged
Nov 24 15:43:17 VNL_Load - LOG_OK logged
Nov 24 15:43:17 VNL_Load - Successfully initialized Vnetlib
Nov 24 15:43:17 VNLAdapterStatus - ioctl: SIOCGIFFLAGS failed, error: Device not configured
Nov 24 15:43:17 VNL_GetVnetMTU - Failure in getting MTU
Nov 24 15:43:17 VNL_Unload2 - Vnetlib unloaded.
Nov 24 15:43:17 VNL_StartService - Started "DHCP" service for vnet: vmnet2
Nov 24 15:43:18 VNLNetCfgLoad - Failed to load product config file: /Library/Preferences/VMware Fusion/config, error: Cannot open file "/Library/Preferences/VMware Fusion/config": No such file or directory.

 

 

the other config file in 

/Library/Preferences/VMware Fusion look fine other than that missing config file/directory warning 

ssh is working on the guest; I can ssh to the Mac host and then to the guest, nothing in the auth.log for the iPad

I get socket error: disconnected from its terminal app. 

0 Kudos
ade76
Contributor
Contributor

So I did a fresh instal, wiped trace of Fusion from the system except for the VMs 

/Library/Preferences/VMware Fusion/config

Still missing.

Getting vmnet back as a fresh configuration was an utter pain.
open preference unlock it > Close Fusion > Open Fusion > create the VMnet > change the subnet 

The manual says it should work:
Advanced Network settings  

I am reluctant to upgrade to 13 if this feature doesn't work; it's likely to be the end of my Fusion use going forward, kind of bitter of about having dedicated hours to getting a VCP as well now. 

 

0 Kudos
dariusd
VMware Employee
VMware Employee

I recreated your configuration here and it worked: I can forward host port 5022 to a virtual machine's port 22, and then I can ssh from another machine on the network to the host's port 5022 (ssh -p 5022 username@fusion-host-IP) and it connects to the VM's ssh service right away.

Please try temporarily deactivating your Fusion host machine's macOS firewall, try ssh again, and see if the connection goes through.

0 Kudos
ade76
Contributor
Contributor

Thanks @dariusd 

That seems to have worked; oddly, I did try without the firewall the first time around. Didn't think of trying it without after a fresh install, as the Firewall rules has allow incoming connections for VMware Fusion.  
Works with and without the firewall now. 
That's a relief,  🙂 

 

 

 

0 Kudos