I have virtual machines. How does that affect SQL Server licensing?
There are two ways of going about this, which involve either licensing SQL Server at virtual machines level, or at the level of the real - non-virtual - cores in the server. At the level of virtual machines, you can licence them at server level or at the level of cores (which in this sense, cores mean virtual central processing units). If you choose to licence your virtual cores, the 4-core minimum still applies.
The second option - real cores in the server - is best if you're planning to run a lot of virtual machines with SQL Server: you then licence the physical cores with Enterprise Edition, and use Software Assurance, which allows an unlimited number of virtual machines.
For SQL Server 2016, the database is licensed by core, and it makes no difference whether that core is virtual or real.