Getting a virus is bad. Getting a virus that causes your computer to crash when you reboot is even worse. We’ll show you how to clean viruses from your computer even if you can’t boot into Windows by using a virus scanner in a Ubuntu Live CD.
There are a number of virus scanners available for Ubuntu, but we’ve found that avast! is the best choice, with great detection rates and usability.
This article was written a while ago, and almost all of the anti-virus applications for Linux aren’t supported anymore. Here are the ones that still work:
You should be able to install Clam from the Ubuntu application center.
The better solution, however, is to use the BitDefender Rescue CD to scan your PC.
Unfortunately, avast! does not have a proper 64-bit version, and forcing the install does not work properly. If you want to use avast! to scan for viruses, then ensure that you have a 32-bit Ubuntu Live CD.
If you currently have a 64-bit Ubuntu Live CD on a bootable flash drive, it does not take long to wipe your flash drive and go through our guide again and select normal (32-bit) Ubuntu 9.10 instead of the x64 edition. For the purposes of fixing your Windows installation, the 64-bit Live CD will not provide any benefits.
Once Ubuntu 9.10 boots up, open up Firefox by clicking on its icon in the top panel.
Click on the Download tab, and then click on the link to download the DEB package.
Save it to the default location.
While avast! is downloading, click on the link to the registration form on the download page. Fill in the registration form if you do not already have a trial license for avast!.
By the time you’ve filled out the registration form, avast! will hopefully be finished downloading.
Open a terminal window by clicking on Applications in the top-left corner of the screen, then expanding the Accessories menu and clicking on Terminal.
In the terminal window, type in the following commands, pressing enter after each line.
sudo dpkg –i avast*
This will install avast! on the live Ubuntu environment.
To ensure that you can use the latest virus database, while still in the terminal window, type in the following command:
sudo sysctl –w kernel.shmmax=128000000
Now we’re ready to open avast!. Click on Applications on the top-left corner of the screen, expand the Accessories folder, and click on the new avast! Antivirus item.
You will first be greeted with a window that asks for your license key. Hopefully you’ve received it in your email by now; open the email that avast! sends you, copy the license key, and paste it in the Registration window.
avast! Antivirus will open. You’ll notice that the virus database is outdated.
Click on the Update database button and avast! will start downloading the latest virus database.
To scan your Windows hard drive, you will need to “mount” it. While the virus database is downloading, click on Places on the top-left of your screen, and click on your Windows hard drive, if you can tell which one it is by its size.
If you can’t tell which is the correct hard drive, then click on Computer and check out each hard drive until you find the right one. When you find it, make a note of the drive’s label, which appears in the menu bar of the file browser.
Also note that your hard drive will now appear on your desktop.
By now, your virus database should be updated. At the time this article was written, the most recent version was 100404-0.
In the main avast! window, click on the radio button next to Selected folders and then click on the “+” button to the right of the list box. It will open up a dialog box to browse to a location.
To find your Windows hard drive, click on the “>” next to the computer icon. In the expanded list, find the folder labelled “media” and click on the “>” next to it to expand it. In this list, you should be able to find the label that corresponds to your Windows hard drive.
If you want to scan a certain folder, then you can go further into this hierarchy and select that folder. However, we will scan the entire hard drive, so we’ll just press OK.
Click on Start scan and avast! will start scanning your hard drive.
If a virus is found, you’ll be prompted to select an action. If you know that the file is a virus, then you can Delete it, but there is the possibility of false positives, so you can also choose Move to chest to quarantine it.
When avast! is done scanning, it will summarize what it found on your hard drive. You can take different actions on those files at this time by right-clicking on them and selecting the appropriate action. When you’re done, click Close.
Your Windows PC is now free of viruses, in the eyes of avast!. Reboot your computer and with any luck it will now boot up!
Running avast! from a Ubuntu Live CD can clean the vast majority of viruses from your Windows PC. This is another reason to always have a Ubuntu Live CD ready just in case something happens to your Windows installation!