Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know that Ubuntu is immune to virus so there is no question of it getting infected while browsing the net.however I frequently transfer files from my pendrive (which I get from other virus infested computers) to my own laptop and save it on the data drive which is shared by both windows and Ubuntu.

I would like to know if there is a chance for Windows viruses which might get saved and then infect it whenever I switch to windows later on.its ironic that I scan my pendrive using avast on Windows and then save all my files to my hard drive to keep my laptop free from virus even though I have Ubuntu.

Can anyone suggest an alternative?

share|improve this question
4  
Ubuntu is not immune to viruses or other malware. But can be said to be, in comparison with that other platform. –  david6 Nov 9 '12 at 8:24
add comment

2 Answers

Viruses affect systems where that file is executed on.

You can not execute an .exe on a normal Ubuntu so there you will not have an issue. Viruses for Linux are not that mature to affect us. The smaller marketshare might have something to do with it. Or that the average Linux user is more aware of what he/she is doing. Might be all of those. But nevertheless a Linux virus like they appear in Windows has yet to be found.

2 problem area's:

  1. You can execute it with wine. Wine has restrictions but this can(/will) affect your wine 'partition' and programs used with wine and everything you can access from within wine as long as the Linux permissions let you. So -never- use sudo or go to root when using wine (this is more of a general rule and not related to Viruses).

  2. If you use Ubuntu to download a file with a virus and then move the file to a Windows system this virus will be activated on executing that file and it will affect your Windows system.

So the answer to your question is: yes, if you move those files to a Windows system it will be able to harm your Windows system. But for those last 2 cases you can use a virus scanner on Ubuntu to check files before you move them to Windows. Catching the bug before it reaches the OS it is meant to mess with is the smarter options (besides not using Windows ;) )


Some interesting topics:

share|improve this answer
1  
As far as I know wine 1) runs as the current user and 2) exposes the entire filesystem as the Z: drive. Most of the implementation weaknesses that windows viruses rely on are not present in wine (at least, they aren't present in a sufficiently similar way) for them to run, but you should still be careful about running anything you don't trust - it might still read your files and transmit anything interesting it finds elsewhere, for instance. –  chronitis Nov 9 '12 at 9:10
    
@chronitis you are correct. I was told a while ago wine uses a limited user internally but this seems to be incorrect (or I did not understand it :D ) I removed my answer at that time but can not find the question anymore :( –  Rinzwind Nov 9 '12 at 10:04
add comment

No, the reason Ubuntu is immune to Windows viruses is because they cannot execute, they're written for windows and windows libraries. The only way to execute a Windows Viruses in Ubuntu or any Linux distro is from Wine, if you do that I will only be able to affect your virtual C drive that wine creates (not your actual C drive with windows)

TL:DR No.

share|improve this answer
3  
but what happens if i accidently save the virus in d drive while using ubuntu and and click on it when i am on windows or is this case also ruled out. –  fr33c0untry Nov 9 '12 at 6:28
    
@fr33c0untry - The virus will run!! This answer is wrong in a dual boot context like yours :). Ubuntu will not run/execute the virus file by itself but it will not magically clean it and Windows will run it when used. –  laurent Nov 9 '12 at 11:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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