Security Explained  
   
 
 

Installing Linux in a Virtual Environment: Part 2

The BackTrack distribution was designed to be used as a LiveCD, an entire operating system run from CD. However due to its assortment of tools and utilities we want to install it to use al lthe time. The authors foresaw this situation and developted BackTrack in such a way as to be installable. Normally with VMWare we would not need to go through two installation proceedures, but the LiveCD nature of BackTrack necessitates it.

Step 1: Boot BackTrack

Start the virtual machine and wait for a prompt. We'll be dealing with mostly the command line for this tutorial, all words and commands that are to be typed into the console will be enclosed in 'single quotes' these quotes should not be typed into the console, only the words within them. The first prompt asks you to log in. The username is 'root' the password is 'toor'

Step 2: Using CFDisk

Next we'll create partitions on our virtual hard drive for BackTrack to be installed into. For this we'll use a program called 'cfdisk' We will need two partitions, one for the files, and one for swap space (virtual memory). Start the program by typing 'cfdisk' into the prompt.

root@slax:~# cfdisk

Step 3: Create Main Partition

Choose 'New' using the right and left arrow keys and pressing Enter.

Create a new partiton

For this partition we want to make it at least 2.55GB so let's just round up to 3GB to give us some extra space. Choose 'Primary' then type 3000 into the prompt and press 'Enter' Then select 'Beginning'

Step 4: Create a Swap Partition

Use the down arrow to select the remaining chunk of "Free Space" and then press 'New'
This time make the partition only 500mb. Use the same settings as the above partition, 'Beginning' and 'Primary' but when you are done creating it choose 'Type' from the menu and press 'Enter'

This will bring up a huge list of different partition types. Press Enter to advance past the first page and choose '82' for Linux Swap. This is also the default option chosen for you.

Use type 82 or Linux Swap

Step 5: Write Partition Table to Disk

Finally select 'Write' from the menu, the program will prompt you to make sure you want to write these options to the disk. Type 'yes' and press 'Enter' Next exit cfdisk by selecting 'Exit' from the menu.

Write changes to disk

Step 6: Format your Partitions

Now that we have the partitions we need to format them for use. BackTrack uses a file format called ext2 for its system. At the prompt type 'mke2fs /dev/hda1' so it looks like this:

root@slax:~# mke2fs /dev/hda1

Next we'll do a similar process with the swap space. Type 'mkswap /dev/hda2' into the command prompt so it looks like this:

root@slax:~# mkswap /dev/hda2

Step 7: Mount Partitions and Activate Swap

Now we'll activate both partitions. First we turn the swap space on with a command called 'swapon'
Type 'swapon /dev/hda2' into the command prompt so it looks like this:

root@slax:~# swapon /dev/hda2

Next we'll make a mount point for our primary partition and mount it. Type 'mkdir /mnt/hda1' into the command prompt to make a directory, then type 'mount /dev/hda1 /mnt/hda1' into the prompt:

root@slax:~# mkdir /mnt/hda1
root@slax:~# mount /dev/hda1 /mnt/hda1

Step 8: Start KDE

We start the graphical desktop by simply typing 'startx' into the command prompt.

root@slax:~# startx

Step 9: Installing BackTrack

Once KDE has fully started click the 'K' icon at the bottom left of the screen. Select 'System' then 'BackTrack Installer'

BackTrack Installer Menu

Step 10: Install Settings

Your settings should be correct by default and should read:

  • Source: /boot
  • Install BackTrack to: /mnt/hda1
  • Write MBR to: /dev/hda

This is also where you can choose to install BackTrack compressed to save space. I reccomend using the full install option, it will be much faster. When you've checked your settings click 'Install' and relax, installation should take anywhere from 10-30 minutes.

BackTrack Installer Setup

Finished

Congratulations, you've just installed BackTrack in a Virtual Environment. The next tutorials will help you complete your testbed and get started learning about security.