This is a quick write-up on how I installed BT3 on an Ubuntu Hardy desktop. The end goal is to have BT3 running under VMWare with the ability to save changes and have swap partition, both activated automatically at boot. I'm assuming you have already downloaded the BT3 Final .iso file.
NOTE 1: I use Ubuntu, but the only thing specific to Ubuntu in this tutorial is probably the packages you need to install in order to be able to build the vmware modules for your kernel.
NOTE 2: This will not work if you are running the Xen kernels!
- Install required packages
First step is to install a compiler and headers for your kernel. You need this in order to compile the vmware modules that allow the virtual machines to use resources on the host machine.
If you are running a 64-bit machine, you'll also need the 32-bit libraries.Code:sudo apt-get install build-essential linux-headers-`uname -r`
This info is straight from Ubuntu's wiki page on installing VMWare.Code:sudo apt-get install ia32-libs libc6-i386
- Download and install VMPlayer
Go to VMWare's website and download the appropriate VMPlayer for your machine. (I'll update this with the URL once the forum will allow me to post them) Unpack the archive, change to the package's directory and run the install script.
I recommend you accept all the defaults. This script will compile all of the required kernel modules and install them for you. You can start VMWare Player from Application->System Tools->VMWare PlayerCode:cd vmware-player-distrib sudo ./vmware-install.pl
- Install BT3 VMX File
I used EasyVMX (its a website, google for the URL) to create a config for VMWare Player. You'll need to go to their website and create a config for yourself. You'll have to tweak the config a little after you download it from EasyVMX, but here are the settings I recommend:
- Virtual Hardware
Set the guest OS to "Generic Linux 2.6.x". The memory setting is really dependent on your hardware, so you'll have to pick one that makes sense for you.
- Network Interface Cards
Decide if you want NAT or Bridged. The NAT setting will forward packets through the host machine's IP. Bridged will put your VMWare host on your LAN. I recommend Bridged.
- CDROM Drives
Enable CDROM #2. Don't worry about filling in the filename for the .iso file, we'll take care of it later.
- Hard Drives
Enable Disk #1 and Disk #2. Disk #1 will be the partition where you will store changes. Set its size depending on your available disk space and how much space you think you'll need inside BackTrack. Disk #2 will be your swap partition. You'll probably want this to be something close to the memory size you selected in the Virtual Hardware section. I used 500MB.
- Sound and I/O Ports
These settings are dependent on your hardware. If you don't need them, I recommend disabling them. You might need USB turned on if you have a USB wireless adapter that you want to use from BT3.
Click on "Create Virtual Machine" and download the zip file from the next page. Create a directory to store your BT3 virtual machine and extract the zip file there.
Next, you'll have to slightly modify the .vmx config file. Open the .vmx file in a text editor and find the section with settings for your CDROMs. The comments in the file will tell you which ones. Out of the box, EasyVMX sets up ide1:0 as your host machine's CDROM. I reconfigured this to be the .iso file and I don't connect my host machine's CDROM to the virutal machine at all. The file also has config information to mount a .iso file as a simulated CDROM drive within the virtual machine. This is where you want to mount the BT3 .iso image.
To set all this up, delete the default settings for ide1:0. Change all of the config parameters in the ISO-image section to ide1:0 instead of ide1:1. Next, change the ide1:0.fileName to the actual path to your BT3 .iso file (i.e. bt3-final.iso). Finally, change ide1:0.startConnected to TRUE. When you are done, it should look like this:
Code:# Settings for the optional virtual CDROM, ISO-image ide1:0.present = "TRUE" ide1:0.fileName = "bt3-final.iso" ide1:0.deviceType = "cdrom-image" ide1:0.mode = "persistent" ide1:0.startConnected = "TRUE"
- Initial Setup of virtual machine's partitions
Now, you are ready to boot up your BT3 virtual machine. You need to start the VM in order to do some initial setup of the two virtual hard drives EasyVMX created for you. To start VMWare Player, go to Applications->System Tools->VMWare Player. Once Player starts, click on "Open an existing Virtual Machine" and navigate to the directory where you put the .vmx file. This will start the VM and boot the BT3 live CD.
Once BT3 has booted, we need to partition the virtual hard drives and create file systems on them. If you followed my recommendations above, /dev/hda will be your drive for changes and /dev/hdb will be your swap partition. Open a shell and use fdisk to partition these drives.
Type "n" to create a new partition. Select primary, partition 1, and use the entire disk. Press "w" to write the changes to the disk and exit. Next, set up your swap partition.Code:fdisk /dev/hda
Follow the same procedure as for hda, except before you write the changes, press "t" and enter "82" as the Hex code. Press "w" to write these changes and exit.Code:fdisk /dev/hdb
Now we need to create filesystems on these partitions. Run the following commands:
If you want to be able to access the changes partition from within Windows. You could use mkfs.vfat instead of mkfs.ext3.Code:mkfs.ext3 /dev/hda mkswap /dev/hdb
One last setup on these partitions. You need to mount /dev/hda1 and create a changes directory. Do the following:
With all of this done, shut down the BT3 VM. We need to make a couple of changes to the .iso to finish this set up.Code:mkdir /mnt/hda1 mount /dev/hda1 /mnt/hda1 mkdir /mnt/hda1/changes
- Modify the BT3 .iso to automatically boot with changes turned on
In order to do this you need to modify one of the files in the BT3 .iso image. I used a loop mount to mount the .iso and copied all of the files to another directory. Then you can change the file and recreate the image. Do all of this on the host machine.
Find the section that starts with "BT3 Graphics Mode (KDE)". We need to add a "changes" parameter to the kernel options line. Make the APPEND line look like this:Code:sudo mkdir /media/iso sudo mount -o loop -t iso9660 <path to bt3 iso> /media/iso sudo mkdir /tmp/bt3 cd /mnt/iso sudo cp -r * /tmp/bt3 cd /tmp/bt3/boot/isolinux sudo chmod 755 isolinux.cfg sudo nano isolinux.cfg
Save this file and then do the following commands:Code:APPEND changes=/dev/hda1 vga=0x317 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;kdm
Set the target file name to put the new .iso file in your BT3 virtual machine directory (i.e. path_to_vm_dir/bt3-final-custom.iso).Code:sudo chmod 555 isolinux.cfg cd ../../BT3 sudo ./make_iso.sh
Finally, update your .vmx file with the path to your new .iso file. If you follow my suggestion above, you need to change the ide1:0.fileName to look like:
Code:ide1:0.fileName = "bt3-final-custom.iso"
- Boot your BT3 Virtual Machine
Now, go ahead and run VMPlayer and boot up your BT3 virtual machine. Any changes you make (i.e. changing the root password or adding modules or files) will be saved and available across reboots. Have fun!