if you change from a malware/spyware infected windows setup to a linux setup will infections migrate to linux if they were on the computer? (when you are hacked/infected is it the op system that is infected or the hard drive?

  • 4
    Just FYI, if you're running WINE on Linux, some Windows malware could affect your Linux.
    – Adi
    Jun 9, 2013 at 20:46
  • I assume that you will erase the hard drive, in this case no. when you're hacked/infected, it's both operating system and hard drive that you need to assume.
    – vimdude
    Jun 13, 2013 at 12:50

4 Answers 4


Some infections actually target your firmware (e.g. BIOS) which makes them difficult to remove or avoid.

But typically, yes. The virus is obviously still there where you left it on your Windows drive or partition. The files don't get removed unless you delete them.

But if you're running Linux, then none of your windows software will execute, which includes any malware.

  • 1
    ...unless you keep the infected stuff and access it via WINE (although not all malware will run under WINE)
    – symcbean
    Jun 10, 2013 at 10:57
  • @symcbean thought of mentioning that, but I've always had difficulty getting malware to run under wine.
    – tylerl
    Jun 11, 2013 at 18:35

In general, hard drives are dumb in sense that they can't execute the virus code, but merely store the virus files that might be later executed through the use or by an operating system (which means they'd have to be written to execute on a specific OS). I say in general, because most consumer grade hard disks don't pack a custom programmable hard disk controller and enough controller's own non-volatile memory to hold a virus that could spread agnostic to operating system it's installed on. That of course doesn't really leave out the possibility the virus that infected the system merely corrupted hard disk's firmware in a way to cause problems on any operating system it's mounted from, or that there could be more advanced firmware viruses targeting enterprise class storage units. And since hard disk controllers are getting more and more sophisticated, and SSDs having a great deal of problems dealing with themselves and more advanced firmwares (and supporting hardware to run them) are needed, I wouldn't put it as too far-fetched, that we'll be soon seeing viruses that specifically target these controllers and can hold operating system agnostic payloads.


That depends if you first completely wipe the computer or not. It can be that your files are infected. With Linux the virus will probably not be able to emerge since it's not compatible with the operating system. However if you were to transfer the file to another Windows machine, it could be that this new Windows machine can get infected.


Except for the few exceptions for viruses that can run on Wine and iyou have Wine installed, Linux generally won't be affected by Windows virus.

Note though that Linux can be an asymptomatic carrier of Windows viruses. If you send other people a file infected Windows virus, their machine can catch the virus, even if the file looks fine on your Linux machine.

This is why you should do a virus scan on files that originates from possibly infected machine.

Also, some files can be corrupted by viruses in such a way that the file is no longer a valid file for whatever the original was intended for. These files may no longer be openable by a Linux application that would've been able to open the original file. Some viruses may infect the file in a way that would be fairly easy to recover the original file, others may not be so forgiving.

Also switching to Linux won't help you if the virus infects a hardware firmware. You may have to reinstall/update the firmware if you get infected this type of viruses. Firmware viruses are fortunately rare though, and they don't usually spread as readily as normal viruses.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .