One option is Disk2VHD
https://learn.microsoft.com/en-us/sysinternals/downloads/disk2vhd
https://www.howtogeek.com/howto/8054/how-to-turn-a-physical-computer-into-a-virtual-machine-with-disk2vhd/
but the better option is to clean install the operating system from installation media, then migrate roles over.
--please don't forget to Accept as answer if the reply is helpful--