I'm running Windows 8.1 on my laptop but I'm also going to install Ubuntu on a USB-Flash drive soon.

I was wondering what if I would get a virus on Ubuntu, could it then also infect my Windows? Because windows is installed on my internal HDD and Ubuntu will be installed on the external device and I won't transfer any files from one to the other.


I was wondering what if I would get a virus on Ubuntu, could it then also infect my Windows?

Short answer

By the virus that infected Linux? Maybe.

Portable malware

There do exist some cross-platform viruses, but they tend to be rare because operating-systems are like languages; there may be some overlap, but there is usually enough difference that you cannot simply plug-and-play something into different ones without modification or special handling.

In the book Shellcoder’s Programming Uncovered, Kris Kaspersky (no relation to the anti-virus) explains how it is difficult to write a virus that is compatible across different Linux versions because they use different mechanisms and are incompatible enough that you cannot simply use a single method that works on them and gives some examples of shellcode for different Unix/Linux systems. If it is difficult to write a virus that works across Linux, imagine how hard it would be for it work on Windows as well.

He actually says that most hacker are defeated because of insufficient attention to [portability]. This just further demonstrates that anything that would be that effective would be written by extremely dedicated hackers who are almost certainly getting something significant out of it (money), and that such viruses are usually part of organized crime and target more lucrative targets than the general populace (think Stuxnet).


Network worms tend to be the most common cross-platform malware because they don’t use low-level system access or OS-specific exploits, but rather higher-level components. These can certainly jump OSes, like something that uses JavaScript to do its dirty work or something that mails itself to everyone in your address book.


Your Windows installation is more likely to be at risk by a trojan that uses Linux as an infection vector, but carries a Windows payload. This is much more common than a cross-platform virus, and also works with Apple (an Apple virus that targets Windows). That said, trojans of this variety are still less common than worms.

Boot-record virus

Since Linux is booting on the system, it will have access to the HDD where Windows lives. This means that even if you use BitLocker to encrypt the files on the drive so that a virus in Linux has no access to the file-system in Windows, it can still infect the boot-record and hide a virus in some parts of the disk so that the next time you boot Windows, it gets injected. However this requires a fairly advanced virus to bypass all of the security components that Windows 7 uses to keep clean. Again, these are not too common.


In general, cross contamination isn’t usually a problem because just like with biological viruses, different OSes tend to be incompatible enough that there is just not enough payout to bother evolving something that can infect both (no, you can’t catch a cold from your pet or infect them with yours).


However, this does not mean you should get lax with security. There are a few things you should do:

  • Harden your Windows installation by disabling everything you don’t need, applying all updates, using some kind of anti-malware
  • Harden your Linux installation in the same way
  • Limit the files that you pass between them to media, (though even those can be infected). You said you don’t intend to pass any files, but you should usually be safe with files from trusted sources.

With even a little prevention, you can usually be safe.

|improve this answer|||||

This is certainly possible, albeit not very likely: Linux viruses are not very common.

The area of major concern is that of cross-platform viruses, i.e., those viruses which attack cross-platform applications. The Wikipedia page on Linux malware states:

A new area of concern identified in 2007 is that of cross-platform viruses, driven by the popularity of cross-platform applications. This was brought to the forefront of malware awareness by the distribution of an OpenOffice.org virus called Badbunny. Stuart Smith of Symantec wrote the following:

"What makes this virus worth mentioning is that it illustrates how easily scripting platforms, extensibility, plug-ins, ActiveX, etc, can be abused. All too often, this is forgotten in the pursuit to match features with another vendor... [T]he ability for malware to survive in a cross-platform, cross-application environment has particular relevance as more and more malware is pushed out via Web sites. How long until someone uses something like this to drop a JavaScript infector on a Web server, regardless of platform?"

Fortunately, though, Linux does have its anti-virus products, often free and Open Source, like ClamAV, or the anti-rootkit programs chkrootkit and rkhunter. Quoting again the same page of Wikipedia,

There are a number of anti-virus applications available which will run under the Linux operating system. Most of these applications are looking for exploits which could affect users of Microsoft Windows.

Hopefully, this should alleviate your concerns.

|improve this answer|||||

Windows virus could run on Linux using WINE. If you install WINE, you should most certainly consider installing an AV scanner, such as Clam.

|improve this answer|||||
  • That’s true, but viruses often exploit vulnerabilities and low-level components that either do not exist in WINE or are different enough to make the incompatible. Also, the virus itself cannot usually infect Linux itself (though it can infect the drive which can allow it to lay dormant until it has access to a Windows system). – Synetech Oct 27 '13 at 21:18

Few Linux viruses exist in the wild.However, you are very unlikely to stumble on and be infected by a Linux virus in the same way you would be infected by a piece of malware on Windows.With this in mind,you do not have to worry about your windows installation infecting a virus from Ubuntu.

This article here might give some insights into why Linux malware isn’t all over the Internet like Windows malware is.

|improve this answer|||||
  • Even safer than Linux is something more rare like wattOS, or best of all, an OS you write yourself, then you should be (fairly) certain that there are no viruses to infect you. – Synetech Oct 27 '13 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.