VirtualBox Installation – Windows Host with a BackTrack 4 Guest and VirtualBox Linux Guest Additions
In this tutorial I shall be installing BackTrack 4 as a guest in my Windows XP host.
Background: Backtrack is a great hacking platform with pre-installed network security tools. It was originally designed to be used as a live-cd, but the latest version allows for an easy hard drive install. Later tutorials will explain how to get BackTrack talking to other virtual machines. One could thus set up a nice hacking testbed to further your own understanding of network security.
One word of warning though: If the aim of your BackTrack installation is to learn more about Wi-Fi hacking, I’d advise you to use a live-cd or install it to a computer. It is possible to run a wi-fi usb stick through the virtual machine, but its not just plug and play. VirtualBox does have USB issues and you are going to find it difficult to get everything working as it should. Chances are if you’re reading this tutorial it’s probably a bit over your head to attempt that right now. My advice is to get used to the system and then go for it at a later stage.
Notes on the tutorial:
When you are required to type in a command, it will be presented by firstly showing the command prompt and then whatever should be typed, eg
This means that “clear” should be typed in (without the quotation marks).
Also note that Linux is case sensitive, thus “clear” does not equal “Clear”.
1. Download Backrack 4 from http://www.backtrack-linux.org/
In this example I downloaded the following file: bt4-final.iso
2. Download the latest VirtualBox application from http://www.virtualbox.org
In my example I have downloaded VirtualBox 3.1.2
3. Install VirtualBox.
During the installation you should elect to have all components installed.
During the installation you will get the following error message several times:
The software you are installing has not passed Windows Logo testing to verify its compatibility with Windows XP…
Click the ‘Continue Anyway’ button to proceed. Just so you know, what your installing are virtual network devices which enables your virtual machines to communicate with the host machine, other virtual machines, the internet, etc.
4. Set up your the Backtrack Virtual Machine
Type in a name for your virtual machine, in this example I’ve used “Backtrack 4”. Under the Operating System drop-down box select “Linux” and under Version select “Other Linux” (as indicated below). Click Next.
Next you have to select the amount of memory you wish your virtual machine to have. I would personally also not use more than half of your system memory. In this example I’ve used 512MB of memory as experience has shown that this is more than enough. Click Next.
Select “Create new hard disk” and then click Next.
This brings us to the “Create New Virtual Disk” window. Click Next.
You now have the option of using either selecting “Dynamically expanding storage” or “Fixed-size storage”. The difference between the two options is explained within the window. In this example, as my disk space is limited, I’ve selected “Dynamically expanding storage”. Click Next.
You now have the option to change the default location of where the hard disk of the virtual machine will be stored. Change the location if you need to. You also have the option of changing the maximum size of your hard drive. Unless you know for a fact that you’ll be placing large files in your virtual machine, don’t bother making the hard drive larger. In my example I’ve left it as 8 GB. Click Next.
Click Finish again.
5. Prepping you virtual machine for the Backtrack installation
This brings up the Settings window. In the left navigation pane select ‘Storage’.
In the ‘Storage Tree’ box click on the logo of a CD. Its label should read ‘Empty’. This will change the ‘Attributes’ section on the right hand side of the window as indicated below:
This will open the ‘Virtual Media Manager’ window.
Click the ‘Add’ button and navigate to the your Backtrack ISO file downloaded in step 1 (the bt4-final.iso file in my case). Select the ISO file and click ‘Open’. This will take you back to the ‘Virtual Media Manager’ window. Make sure the correct ISO is highlighted and click ‘Select’.
This will take you back to the ‘Settings’ window. Click OK
6. Installing the Backtrack 4 operating system
(Before you start you should know that virtual machines capture your mouse movements and keyboard strokes after you click on them and to release them you need to press right Ctrl)
Make sure your Backtrack 4 virtual machine is highlighted and click on Start.
This will spawn the virtual machine and should load the Backtrack boot menu. Depending on your screen resolution you may either select “Start BackTrack FrameBuffer (1024×768)” or “Start BackTrack FrameBuffer (800×600)”. In my example I’ve selected the 1024×768 resolution. Select your option and press Enter.
Backtrack is now booting up. At the end of the process you’ll be presented with the command prompt – root@bt:#
This should open up KDE, the Backtrack graphical front-end.
In the top left hand corner of the desktop is a file called “install.sh” script. Click on this icon. This will start the Backtrack 4 installation.
Select your time zone and click Forward.
Select your keyboard type. In my example its just the standard USA keyboard. Click Forward.
You should now be at the “Prepare disk space” screen. Make sure “Guided – use entire disk” is selected. Click Forward.
You should now be at the “Ready to install” screen. Click Install.
(Just a quick note: There are actually 7 steps in the install screen, but if you follow the above guide, you should automatically skip several of them).
Now wait. It takes quite a while to install. It took about 20 minutes on my system.
After the installation you’ll be presented with a message that states that the installation is complete. Click ‘Restart Now’.
You’ll be taken back to the command prompt and the following message will be displayed: “Please remove the disc and close the tray (if any) then press ENTER:” (as shown below).
At this point you need to unmount your loaded ISO. You do this by pressing right Ctrl (to release your mouse from the virtual machine). Then click on Devices –> CD/DVD Devices –> Unmount CD/DVD Device as indicated below. You might get an error message that says that the image could not be unmounted. Just click ‘Force Unmount’ if the error appears.
After you have unmounted the disc, click on the virtual machine screen (to recapture your mouse and keyboard) and press Enter. This will restart you machine.
After booting up, you’ll be presented with the login prompt.
The default login details for Backtrack 4 after a clean install are as follow:
Note: if you want to shut down the virtual machine at this point and continue the tutorial later, type in the following after logging in:
root@bt:# shutdown –P –q now
7. Installing the VirtualBox Linux Additions
After booting up and logging in press right Ctrl to release your mouse and click Devices –> Install Guest additions.
Click on the virtual machine (to re-capture mouse and keyboard) and type in the following:
|root@bt:# cd /||This changes the path to the root directory.|
|root@bt:# mkdir /mnt/cdrom||This creates a directory under the ‘mnt’ directory.|
|root@bt:# mount /dev/hdc /mnt/cdrom||This mounts the VirtualBox additions disk to the newly created directory.|
|root@bt:# cd /mnt/cdrom||This changes the path to the mounted CD.|
|root@bt:# ls||This lists the contents of a directory.|
|root@bt:# ./VBoxLinuxAdditions-x86.run||Note the “./” at the beginning of the command. This tells Linux that you want it to to run a script.|
If all went well, your terminal should look like the one below:
Lastly enter the following command to shut down your virtual machine:
root@bt:# shutdown –P –q now
That’s it! You’ve successfully installed a Backtrack 4 virtual machine with the VirtualBox additions. When you boot up your virtual machine and log onto KDE your mouse and keyboard will automatically be captured and released and you can resize your window to suit your needs. If you want to run it in fullscreen mode, just press right Ctrl+F.