Browse Safely Using a Virtual Machine
Browsing the internet is getting more dangerous every day. One way to be safe is to create a "virtual machine" on your PC and use it to surf the web. If the virtual machine gets infected, simply dump it and build yourself another one.
This article tells you how to create a DSLVM (D*mn Small Linux Virtual Machine) on a computer running a Windows XP OS. The DSL VM provides a Firefox browser which you can use to surf the web. You should be safe since most viruses are written for Windows and there is very little contact between the DSLVM and XP, so the virus should not be able to touch XP.
Contents
Steps
Getting Ready
- Install the latest version of the free VMware Player from VMware.
- Create the configuration file at EasyVMX by filling in a few fields on the EasyVMX website. Use the following options:
- Virtual Machine Name: DSLVM
- Select Guest OS: Generic Linux
- Memory Size:128MB
- Disk Size: 500 MB
- Click "Create Virtual Machine" and download the configuration file using the provided link.
- Unzip the configuration file (.vmx) into a convenient folder - your work folder. You should have the configuration file (DSLVM.vmx) and a couple of virtual disk (.vmdk) files.
- Delete the .vmdk files - you should always use a tested virtual disk.
- Download a tested 500 MB virtual disk from the downloads section of EasyVMX and save it in the work folder.
- Open DSLVM.vmx using WordPad (not Notepad) and search for ide0:0.fileName. Edit the value in quotes to match the name of the tested 500 MB virtual disk you downloaded. For example, if the tested 500 MB virtual disk was called 500MB.vmdk, set ide0:0.fileName = "500MB.vmdk".
- Obtain the latest disk image for Damn Small Linux from damnsmalllinux.org and save it in the work folder.
First Boot
The first time you run the virtual machine, it needs to boot off the disk image. To tell VMware Player to do this, you must edit the .vmx file and point it to the .iso file as follows:
- Comment out all lines in the Settings for the physical CDROM drive and add the following 3 lines, making sure to replace the ide1:0.fileName with the name of the .iso file:
- ide1:0.present = "TRUE"
- ide1:0.fileName = "dsl-3.2.iso"
- ide1:0.deviceType = "cdrom-image"
- When you are done, it should look something like this:
- # Settings for physical CDROM drive
- # ide1:0.present = "TRUE"
- # ide1:0.deviceType = "cdrom-raw"
- # ide1:0.startConnected = "TRUE"
- # ide1:0.fileName = "auto detect"
- # ide1:0.autodetect = "TRUE"
- ide1:0.present = "TRUE"
- ide1:0.fileName = "dsl-3.2.iso"
- ide1:0.deviceType = "cdrom-image"
- Remember that ide1:0.fiileName must be the name of the .iso file and ide1:0.deviceType must be cdrom-image.
- Save your changes.
- Double click the .vmx file and allow the system to boot off the disk image. If everything works, you should have a DSL desktop running in the VMware Player. Use Ctrl+Alt to return to Windows.
- Click in the VMware Player to send input to the virtual machine.
Creating & Formatting Partitions
- Right-click on the desktop and select Run Program. Type xterm in the dialogue box. Type sudo su to become root.
- Create partitions on your 500 MB virtual disk by typing cfdisk /dev/hda. The following message appears:
- No partition table or unknown signature on partition table. Do you wish to start with a zero table [y/N] ?
- Type y to start with a zero table.
- When a screen appears navigate with the arrow keys. Choose [New], [Primary], 128.00, [Beginning], navigate to [Type], explicitly enter type 82, Linux swap (you may have to scroll to find it). Choose [Write] to write the partition table to the disk.
- A warning appears confirm that you want to write. Remember the name of the partition - it will probably be hda1.
- Use the down arrow key to highlight the remaining free space.
- Choose [New], [Primary], nnn.00, [Bootable], then navigate to [Type], explicitly enter type 83, Linux (you may have to scroll to find it). Yes, it is 83, not 82 as before. Choose [Write] to write the partition table to the disk.
- When a warning appears confirm that you want to write. Remember the name of the partition - it will probably be hda2.
- Navigate to [Quit].
- Exit xterm and reboot, using the disk image off the CDROM. You may have to select Esc during VMware player boot to access boot options. It cannot boot off the partitions you just created, since there is nothing on them.
- Right-click on the desktop and select Run → Program. Type xterm in the dialogue box. Type sudo su to become root.
- While su, type mkswap /dev/hda1.
- While su, type swapon /dev/hda1.
- Type dsl-hdinstall to install the OS to the partition. Make sure you select the Linux partition, not the Linux swap.
- Choose n to multiple users. Choose y to journalized ext3 filesystem if your machine is reasonably new. Choose y to give up your last chance to abort. Choose y to install a bootloader. Choose g to install grub.
- Reply n to the question about whether you have windows installed on /dev/hda1. Choose y to reboot.
- Enter a password each for users root and dsl and you should be done.
Cleanup
- Restore the CDROM settings, so it does not associate the .iso with the CDROM and you should be ready to surf the web using a completely disposable, lightweight virtual machine.
- Open DSLVM.vmx using WordPad (not Notepad) and change all the CDROM settings back to the defaults.
- When you are done, it should look like this:
- # Settings for physical CDROM drive
- ide1:0.present = "TRUE"
- ide1:0.deviceType = "cdrom-raw"
- ide1:0.startConnected = "TRUE"
- ide1:0.fileName = "auto detect"
- ide1:0.autodetect = "TRUE"
- Reboot and make sure everything works. If it does not, check the log file to find out which device is causing problems. Set that device to *****.present = "FALSE" in DSLVM.vmx. You may want to turn logging off once everything works - you can always turn it back on later.
- You're done!
Warnings
- Backup your data first!
- Test your backups next - make sure the backups work before you risk your data.
- You need to be computer literate to attempt this.
Things You'll Need
- VMware Player to run the virtual machine.
- Configuration File (a .vmx file) to provide VMware Player with configuration options.
- Virtual Disk (a .vmdk file) to store the operating system.
- DSL Disk Image (a .iso file) containing a bootable image of the latest stable DSL distribution.
- Note: Microsoft has recently released its own free virtualization technology called Microsoft Virtual PC 2007 and provides free virtual hard disks as well (see the external links section). However, these instructions have not been tested with Microsoft products. Other technologies include VirtualBox and Qemu.
Related Articles
Sources and Citations
- VMWare
- DamnSmallLinux.org
- This article was written after trying to follow a tutorial here, which, incidentally, did not work too well. This page provided helpful instructions on creating and formating partitions correctly.
- Microsoft Virtual PC 2007
- Microsoft Virtual Hard Disk