Virtual machine from existing old drive


I’m running Windows 10 on a new desktop. I have my HDD from my old XP machine, which has a number of legacy apps that will not run on W10.
Can I install the old drive in the new desktop and use a virtual machine to run the XP operating system.
I’m thinking it would be similar to the description in this article: