Nowadays malware is no longer trying to break your computer on purpose or play mean jokes on people. So it is very probable that malware changed your settings in order to intercept and maybe change your traffic. Those changes might have had bugs or maybe the authors stopped the entire operation like it was the case with DNSChanger. There are a couple of popular ways malware will interfere with your internet access:
- Change DNS settings
- Change proxy settings
- Change routing settings
- Change local router settings
- Install malicious browser extensions
- Intercept (hook) browser functions
A new OS in a virtual machine wouldn't be affected by most of these changes because it would be connected directly to the network. This mode is called bridged mode and the computer in the virtual machine acts like a new computer on the network. There is one other mode of connecting to the internet and it is called NAT mode where your host computer acts like a router for your virtual machine.
Here are resources where you can read more:
Friendly reminderadvice: Google will not provide exact answers to your questions but int time, you will learn how to find information and answer your own questions better than this website will.