Converting a Linux machine fails with the error: Unable to SSH to the source machine. Please check if a firewall is blocking access to the SSH daemon on the source machine
search cancel

Converting a Linux machine fails with the error: Unable to SSH to the source machine. Please check if a firewall is blocking access to the SSH daemon on the source machine

book

Article ID: 337357

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
When you attempt to convert a Linux machine using VMware Converter, you experience these symptoms:
  • You are connecting to the source machine with the user root.
  • All required ports for the conversion are open. For more information, see Required VMware vCenter Converter 4.x/5.x ports (1010056).
  • The conversion fails with the error:

    Unable to SSH to the source machine. Please check if a firewall is blocking access to the SSH daemon on the source machine.

  • The converter-worker.log file contains the errors:

    Note: For more information, see Collecting diagnostic information for VMware Converter (1010633).

    ...
    [<YYYY-MM-DD>T<time> PID error 'App'] Took too long to read from ssh client.
    [<YYYY-MM-DD>T<time> PID error 'App'] [Converter Agent SysinfoQuery] while trying to execute "C:\Program Files (x86)\VMware\VMware vCenter Converter Standalone\pscp.exe -noprompt -stdin -nokeycheck -P 22 C:\Program Files (x86)\VMware\VMware vCenter Converter Standalone\vmware-sysinfo-lin64.tar.gz root@IP_Address:/tmp/.vmware-sysinfo-mswjhbivliseacmo/vmware-sysinfo-lin64.tar.gz" received error code (247) with result:
    [<YYYY-MM-DD>T<time> PID error 'App'] [Converter Agent SysinfoQuery] Query(): Caught exception, cleaning up before bailing out ([Converter Agent SysinfoQuery] ssh connection timed out)
    [<YYYY-MM-DD>T<time> PIDerror 'App'] [Converter Agent SysinfoQuery] while trying to execute "C:\Program Files (x86)\VMware\VMware vCenter Converter Standalone\plink.exe -noprompt -stdin -nokeycheck -P 22 root@IP_Address cat /tmp/.vmware-sysinfo-mswjhbivliseacmo/vmware-sysinfo.log" received error code (1) with result:
    cat: /tmp/.vmware-sysinfo-mswjhbivliseacmo/vmware-sysinfo.log: No such file or directory
    [<YYYY-MM-DD>T<time> PID error 'App'] [Converter Agent SysinfoQuery] received an error code (1) from the ssh client that will be handled later
    [<YYYY-MM-DD>T<time> PID error 'App'] Converter Agent SysinfoQuery failed to grab log file; return code: 1; result:
    ...
    Missing updates: 0
    cat: /tmp/.vmware-sysinfo-mswjhbivliseacmo/vmware-sysinfo.log: No such file or directory
    [<YYYY-MM-DD>T<time> PID error 'App'] Sysinfo Query failed with error [Converter Agent SysinfoQuery] ssh connection timed out
    [<YYYY-MM-DD>T<time> PID info 'App'] Scheduled timer canceled, StopKeepAlive succeeds
    ...</time></time></time></time></time></time></time></time>


Cause

This issue occurs when a notice entry is present in the /root/.bashrc file and prevents Converter from copying the require files to the source machine using SSH.

Resolution

To resolve this issue, comment out the notice section in the /root/.bashrc file.

To comment out the notice section of the /root/.bashrc file:
  1. Log in to the source machine as root.
  2. Run this command to view the contents of the /root/.bashrc file:

    cat /root/.bashrc

  3. Verify that this line exists:

    if [[ -e ~/.notice ]]; then cat ~/.notice; fi

  4. Run this command to save a copy of the original .bashrc file:

    cp /root/.bashrc /root/.bashrc.orig

  5. Using a text editor add a hash (#) before if [[ -e ~/.notice ]]; then cat ~/.notice; fi in the /root/.bashrc file to comment out the notice section.

    Note: The example below is a sample of a /root/.bashrc file. Depending on your environment, the /root/.bashrc file may not reflect this example and may contain additional entries. Only modify the line referenced in this step.

    Original

    # .bashrc
    # User specific aliases and functions
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi
    if [[ -e ~/.notice ]]; then cat ~/.notice; fi

    Modified

    # .bashrc
    # User specific aliases and functions
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi

    # if [[ -e ~/.notice ]]; then cat ~/.notice; fi

  6. Save the changes to the file.
  7. Restart the conversion.


Additional Information

Required VMware vCenter Converter ports
Collecting diagnostic information for VMware Converter
转换 Linux 计算机失败并显示错误:无法使用 SSH 连接到源计算机。请检查防火墙是否阻止访问源计算机上的 SSH 守护进程 (Please check if a firewall is blocking access to the SSH daemon on the source machine)