How to (legally) get Windows virtual machine on linux via VirtualBox without buying Windows
My goal is to install Windows 7 on a virtual machine running on Ubuntu. The Lenovo machine came with Windows 7 installed, but did not come with a boot disk.
What are my options? Should I ask Lenovo for a disk? Will I need to purchase Windows just for the virtual machine?
OEM licenses (the ones that come with factory built machines) only allow you to perform a clean installation on the original machine. The license does not allow for virtualization. So, you cannot re-use the one that came with the machine for this purpose without breaking the contract you electronically signed with Microsoft.
You can download a trial version if you meet the eligibility requirements laid out here. In all likelihood, if you do not have an MSDN account you need to buy Windows 7 from a retail store to remain legal.
You can virtualize your existing Windows 7 installation, either using the method ntw1103 mentions or using VMWare's Converter, which will turn it into a VMDK file.
This is perfectly legal if you have Win7 Pro. Microsoft's license does not allow virtualization (last time I looked) of less-expensive licenses of their operating systems. (This is as of XP and Vista, I haven't read the Win7 licenses in detail.)
It's a wild thought and probably won't work for you, but you might consider trying ReactOS, which is a Windows-impersonating OS, an operating system using no Microsoft code but attempting to duplicate all its APIs and run all Windows programs. It's currently in alpha but it looks interesting, and I believe you can download a VM containing ReactOS directly.
If you need it for testing purposes Microsoft has prepared virtual machines for many windows versions for compatibility testing.
https://dev.modern.ie/tools/vms/linux/
VMs expire after 90 days.