Linux P2V Migration Error: Make sure that you can run sudo without entering a password – Troubleshooting

If you are trying to migrate the Linux machine P2V and/or V2V using vCenter converter standalone tool but facing migration error: Unable to query the live Linux source machine. Make sure that you can run sudo without entering a password when logged in to the source machine over SSH as user. but did not get the solution yet.

Linux P2V Error
Linux P2V Error : Unable to query the live Linux source machine. Make sure that you can run sudo without entering a password when logged in to the source machine over SSH as user

I have the best solution If you are struggling / facing these following errors list in vCenter converter standalone tool.

Linux P2V / V2V Error 1 : Unable to query the live Linux source machine. Make sure that you can run sudo without entering a password when logged in to the source machine over SSH as user.

Linux P2V / V2V Error 2 : use of a non-root user for hot cloning of a Linux source machine.

Linux P2V / V2V Error 3 : VMware vCenter Converter Standalone Client need root privileges on the source machine ?

Linux P2V / V2V Error 4 : If you are / want to Use non root user to migrate the linux machine P2V and/or V2V.

Linux P2V / V2V Error 5 : sudo: sorry, you must have a tty to run sudo

Read also: Nutanix Move Migration Guide

Best Solution – Must Work

I am going to tell the the Best Solution that works in most of the cases to resolve the error: Unable to query the live Linux source machine. Make sure that you can run sudo without entering a password when logged in to the source machine over SSH as user.

Follow the steps:

Step 1: Open the Target Linux Machine ( Need to be migrated ) console

  • sudo vi /etc/ssh/sshd_conf
  • Change the “PermitRootLogin” parameter to “Yes“.
  • Save the file through “:wq!”
  • sudo service sshd restart

Step 2: Make changes in Sudoers config File

  • Add the following entry to /etc/sudoers to replace username with the non-root user’s name:
  • sudo vi /etc/sudoers
 username ALL=(ALL) NOPASSWD:ALL
#Defaults requiretty  ----> Comment it out

OR – You can just disable it on a per-user basis instead of globally disabling it. If the vendor tool has it’s own account that it’s using, disable requiretty for that one specific account and leave the global defaults in place.

Defaults:username !requiretty

Sudoer config File output will be like below:

##The COMMANDS section may have other options added to it.
##Allow root to run any commands anywhere

 root    ALL=(ALL)       ALL
 user1 ALL=(ALL) ALL
 user2  ALL=(ALL) ALL
 user3   ALL=(ALL) ALL
 user4 ALL=(ALL) NOPASSWD:ALL  --> Make this Entry for Non-root User, "sudo su -" command - will not ask user's password   
 
#Defaults requiretty   --> Comment this line
 
##Allows members of the 'sys' group to run networking, software,
##service management apps and more.
 #%sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, 

##DELEGATING, PROCESSES, LOCATE, DRIVERS
 ##Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL
 
##Allows members of the users group to mount and unmount the
 ##cdrom as root
 ##Drivers
 ##Cmnd_Alias DRIVERS = /sbin/modprobe
 #Defaults specification

Note: The sudoers configuration might vary by system. For Ubuntu operating systems further configuration is needed. Target the specific user you are using and assign it user id 0/group 0. Ensure that you also enable Allow root to ssh even though you are not using the root account.

Read also: Cross Hypervisor Migration To-from Nutanix AHV

Step 3: If you are using vCenter converter standalone tool – Windows based / Installed in Winodws OS than need to make few changes in xml files.

  • Go to Windows machine in which – vCentter converter standalone tool is installed and browse the path: %ALLUSERSPROFILE%\Application Data\VMware\VMware vCenter Converter Standalone\
  • If Converter Standalone is running on a Linux machine, go to path: /etc/vmware-converter/
VMware vCenter Converter Standalone path in Windows OS
VMware vCenter Converter Standalone path in Windows OS
  • Open the converter-agent.xml file in a text editor and change following
Change flag from <useSudo>false</useSudo> to  <useSudo>true</useSudo>  
  • Open the converter-worker.xml file in a text editor and change following
Change flag from <useSudo>false</useSudo> to  <useSudo>true</useSudo>

<useSudo>True</useSudo> Flag to indicate whether to use each task’s Linux P2V source machine’s password as the root password for the helper VM. Normally during Linux P2V the helper VM is inaccessible to the user, but this option overrides that behaviour and allows the user to login to the console of the helper VM.

This could be useful to retrieve logs in case of a catastrophic failure of the Converter Helper Server on the helper VM. It could also be used to debug problems with the network of the helper VM.

Important to note: when enabling this option it is highly recommended to also disable powerOff Helper Vm, so that the helper VM does not disappear out from underneath of you when the task is finished

Step 4: Restart vCenter Converter Standalone tool Services

Go to Windows Services and restart following services

  • Restart : Mware Converter Standalone Worker service
  • Restart : VMware Converter Standalone Agent

Alternatively way : instead of restarting Converter Standalone agent, you can reboot the system to make the changes to converter-agent.xml take effect.

Read also: Nutanix Infra Default Credentials

Conclusion

Hopefully, You might get the solution of Linux machine P2V / V2V migration error: Unable to query the live Linux source machine. Make sure that you can run sudo without entering a password when logged in to the source machine over SSH as user -issue solution here.

Thanks to to being with HyperHCI Tech Blog to stay tuned to get the latest techie updates.!

More Troubleshooting Useful Links

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑