If depends. If you have SQL Server Enterprise Edition installed, then you can buy enough CPU licenses to cover the host and all VMs on that host will be covered. If you have Standard Edition you need to license each VM by itself.
So if you have a 4 CPU server, and you have Enterprise Edition, you can purchase 4 CPU licenses of SQL Enterprise and you are covered for all SQL Instances you install on that piece of hardware.
However if you have standard edition, and you have 2 VMs running SQL Server with 4 vCPUs each, then you need to purchase 8 standard edition licenses.
Hopefully that helps.