Problems connecting to VM with SSH

Post Reply
robinsoncaruso
New here
Posts: 5
Joined: Wed Aug 19, 2020 7:34 am

Problems connecting to VM with SSH

Post by robinsoncaruso » Wed Aug 19, 2020 9:07 am

Running a new TS-253Be on latest updates as of this post with a Ubuntu VM in virtualization station. I am having issues connecting with SSH to my VM. When I try to connect I get connection refused no matter which machine I try from (on the local network) both Windows with Putty and MacOS from terminal. If I wait a few minutes then it will connect just fine and will stay connected for a few minutes then disconnect. My VM is Ubuntu 20.x but I also tried with Ubuntu 18.4. I have rebuilt the VM 3 times now and none worked successfully. If I use the terminal via the web browser in the QNAP the VM works fine.

I started up tcpdump within the VM and monitored for connections. I tried to SSH to the VM and it showed no packets and I got connection refused in the SSH client. I then ran NMAP against the VM and got back that OpenSSH was running but filtered however the VM showed no packets within tcpdump. I waited about 5 minutes and tried this again, this time everything worked and tcpdump showed the packets hitting the VM. Before you ask, no iptables is not blocking the packets as I verified the default rule was ALLOW with no other rules and then even disabled it to 100% confirm, besides that behavior would not randomly block packets at different times, it would be all or none. I have confirmed that SSHd is running and is listening on port 22 (netstat -tunalp | grep ssh) and again since it works part time its likely not SSH. Keep in mind I rebuilt with 3 different VMs and even different OS versions and all had the same behavior so at this point its highly unlikely the VM is the issue and more likely the QNAP.

I think the issue is with the NAS and the virtual network. I suspect the virtual switch is intercepting the packets but not always. I don't know a ton about how the QNAP virtual network works in detail as I am new to the QNAP so I am hoping someone can assist with this issue. It looks like I may not be the only one with the problem but I haven't found an answer. HELP!!!

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Problems connecting to VM with SSH

Post by Trexx » Wed Aug 19, 2020 9:39 am

Did you install/enable SSH Server into the Ubuntu VM? I have a Ubuntu 18.x Server VM running in VS just fine with SSH.
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

robinsoncaruso
New here
Posts: 5
Joined: Wed Aug 19, 2020 7:34 am

Re: Problems connecting to VM with SSH

Post by robinsoncaruso » Wed Aug 19, 2020 8:09 pm

Yes I can connect sometimes and other times I can't. Its not a problem with the OpenSSH server, the packets are not even getting to the VM but its not all the time.

"I have confirmed that SSHd is running and is listening on port 22 (netstat -tunalp | grep ssh) and again since it works part time its likely not SSH."

User avatar
drdope
Getting the hang of things
Posts: 81
Joined: Tue May 24, 2016 8:02 pm

Re: Problems connecting to VM with SSH

Post by drdope » Wed Aug 19, 2020 8:46 pm

Could you post your Qnap vSwitch Setup?

Does this Problem occur on LAN and WLAN?
Asking this 'cause I' had a similiar strange issue once with a mobile client -> reason was the mobile client was switching between regular WLAN an Guest-WLAN by signal strength.
Guest-WLAN had a policy running "allowing only surfing and mailing". Regular WLAN gave full access...
:roll:
TS-677 - R7-1700/64GB/QM2-2P-384/2x 1TB 970 EVO (R1; System, VMs & SMB-Shares) & 2x 2TB WD Blue (R1; online-, ondevice-backup)
TS-669l, 3GB (2x 3TB WD30EFRX; Raid1; online-, offdevice-, onsite-backup)
TS-453A, 4GB (2x 3TB WD30EFRX; Raid1; online-, offdevice-, offsite-backup)
6x 2TB USB3.0 HDDs in daily rotation (offline, offdevice, offsite-backups)
"roughly 80% of storage related costs are generated by backups"

robinsoncaruso
New here
Posts: 5
Joined: Wed Aug 19, 2020 7:34 am

Re: Problems connecting to VM with SSH

Post by robinsoncaruso » Wed Aug 19, 2020 11:34 pm

drdope wrote:
Wed Aug 19, 2020 8:46 pm
Could you post your Qnap vSwitch Setup?

Does this Problem occur on LAN and WLAN?
Asking this 'cause I' had a similiar strange issue once with a mobile client -> reason was the mobile client was switching between regular WLAN an Guest-WLAN by signal strength.
Guest-WLAN had a policy running "allowing only surfing and mailing". Regular WLAN gave full access...
:roll:

The QNAP is wired on the LAN and the clients are wireless. I don't have wireless adapters in the QNAP. Here is the config:

https://i.imgur.com/8Y8vkTC.png

I did try with just 1 adapter enabled (vs using both) and same issue by the way.

User avatar
drdope
Getting the hang of things
Posts: 81
Joined: Tue May 24, 2016 8:02 pm

Re: Problems connecting to VM with SSH

Post by drdope » Thu Aug 20, 2020 12:20 am

Turning off link aggregation would have also been my first idea...
Have you checked if the problem still occurs, if the clients are connected via ethernet (just for diagnostics)?

WLAN does strange things, sometimes... basically WLAN adds tons of variables (aka potential problems) that an ethernet connection is resilient to...
TS-677 - R7-1700/64GB/QM2-2P-384/2x 1TB 970 EVO (R1; System, VMs & SMB-Shares) & 2x 2TB WD Blue (R1; online-, ondevice-backup)
TS-669l, 3GB (2x 3TB WD30EFRX; Raid1; online-, offdevice-, onsite-backup)
TS-453A, 4GB (2x 3TB WD30EFRX; Raid1; online-, offdevice-, offsite-backup)
6x 2TB USB3.0 HDDs in daily rotation (offline, offdevice, offsite-backups)
"roughly 80% of storage related costs are generated by backups"

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Problems connecting to VM with SSH

Post by Trexx » Thu Aug 20, 2020 2:06 am

robinsoncaruso wrote:
Wed Aug 19, 2020 11:34 pm
drdope wrote:
Wed Aug 19, 2020 8:46 pm
Could you post your Qnap vSwitch Setup?

Does this Problem occur on LAN and WLAN?
Asking this 'cause I' had a similiar strange issue once with a mobile client -> reason was the mobile client was switching between regular WLAN an Guest-WLAN by signal strength.
Guest-WLAN had a policy running "allowing only surfing and mailing". Regular WLAN gave full access...
:roll:

The QNAP is wired on the LAN and the clients are wireless. I don't have wireless adapters in the QNAP. Here is the config:

https://i.imgur.com/8Y8vkTC.png

I did try with just 1 adapter enabled (vs using both) and same issue by the way.
Your port trunking/link aggregation set up would be my guess (or your switch isn't compatible/configured right). Unplug your 2nd NIC connection and I bet your VM SSH issues go away. Also unless you are seeing sustained 1Gb+ throughput on your 1st NIC port when used alone, you probably aren't getting any benefit for it anyway.

Link Aggregation/Port Trunking doesn't change the 1Gb connection limit between a NAS & a single client (PC, phone, etc.). It ONLY benefits you IF you have MANY clients hitting the NAS at the same time and the cumulative load from them is greater than 1Gb.

For most people, especially with plug and play switches, it causes more headaches than it solves for the average user.
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

robinsoncaruso
New here
Posts: 5
Joined: Wed Aug 19, 2020 7:34 am

Re: Problems connecting to VM with SSH

Post by robinsoncaruso » Thu Aug 20, 2020 8:16 am

Trexx wrote:
Thu Aug 20, 2020 2:06 am
robinsoncaruso wrote:
Wed Aug 19, 2020 11:34 pm
drdope wrote:
Wed Aug 19, 2020 8:46 pm
Could you post your Qnap vSwitch Setup?

Does this Problem occur on LAN and WLAN?
Asking this 'cause I' had a similiar strange issue once with a mobile client -> reason was the mobile client was switching between regular WLAN an Guest-WLAN by signal strength.
Guest-WLAN had a policy running "allowing only surfing and mailing". Regular WLAN gave full access...
:roll:

The QNAP is wired on the LAN and the clients are wireless. I don't have wireless adapters in the QNAP. Here is the config:

https://i.imgur.com/8Y8vkTC.png

I did try with just 1 adapter enabled (vs using both) and same issue by the way.
Your port trunking/link aggregation set up would be my guess (or your switch isn't compatible/configured right). Unplug your 2nd NIC connection and I bet your VM SSH issues go away. Also unless you are seeing sustained 1Gb+ throughput on your 1st NIC port when used alone, you probably aren't getting any benefit for it anyway.

Link Aggregation/Port Trunking doesn't change the 1Gb connection limit between a NAS & a single client (PC, phone, etc.). It ONLY benefits you IF you have MANY clients hitting the NAS at the same time and the cumulative load from them is greater than 1Gb.

For most people, especially with plug and play switches, it causes more headaches than it solves for the average user.

The problem actually first started before I setup the second NIC. The only reason I setup the second NIC was to move the vSwitch to the second NIC to make sure it wasn't a problem with the first NIC. So unfortunately that isn't the problem. Do you happen to know if the QNAP has a traffic logging function that I could look at? I would like to see what its doing with the packets or if for some crazy reason the problem is between the QNAP and the client.

robinsoncaruso
New here
Posts: 5
Joined: Wed Aug 19, 2020 7:34 am

Re: Problems connecting to VM with SSH

Post by robinsoncaruso » Thu Aug 20, 2020 9:43 am

A little more troubleshooting and it appears that the problem always happens when connecting from MacOS to the VM. Connecting from Windows 10 using Putty does not appear to have the problem. Then I tested another Mac I had here with the same OS and it does not appear to have the problem. The problem is now isolated to a single Mac and I am 99% sure its a VPN adapter problem and likely not related to the QNAP or VM at all. Oh well, I guess that is good and bad but it rules out the QNAP/VM. Thank you to everyone for their help, I do wish the QNAP had better logging but that is likely because I didn't SSH into the QNAP traverse the OS.

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Problems connecting to VM with SSH

Post by Trexx » Fri Aug 21, 2020 9:48 am

Glad to hear you got it figured out.
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

Post Reply

Return to “Virtualization Station”