As far as licensing is concerned, Microsoft considers virtual machines to be the same as "real" machines.
That means that an instance of Windows installed in a virtual machine must be authenticated with a valid Microsoft product key.
If your original installation of Windows 7 Pro came preinstalled on your computer -- i.e., it was an "OEM" installation -- the license you have is limited to that original hardware and can't be transferred to any other machine, including any virtual machine.
If, however, you had purchased a retail copy of Windows 7, uninstalled that from your computer when you switched to Linux, and now installed the same edition of Windows in a virtual machine, then the product key from that original retail purchase would be
valid to authenticate your virtual installation.
As you've seen, with Windows 7, the "not genuine" notice does not disable Windows, it just causes increasingly frequent messages and other annoyances:
Unlike Windows XP and Vista, failure to activate Windows 7 leaves you with an annoying, but somewhat usable system. According to a Microsoft developer blog post on "Microsoft Developer Network," if you don't choose to activate Windows 7 during installation,
you will see an "Activate Windows Online Now" message in the system tray. If you don't activate then, you will see an "Activate Now" message every day from day four through day 27. Until day 30, you will get the "Activate Now" message every four hours until
day 30. After day 30, you will get the "Activate Now" message every hour, along with a notice that your Windows version is not genuine whenever you launch the Control Panel. In addition, Windows 7 does not perform any system updates after the grace period.
Finally, Windows will automatically turn your screen background image to black every hour – even after you change it back to your preference. This behavior continues until you successfully activate Windows 7.
-- https://smallbusiness.chron.com/register-vista-product-key-45567.html