The Temple of Fu

code, systems and games

Installing VirtualBox and Backtrack 4 Pre to hard drive

leave a comment »

This is how I installed Backtrack 4 Pre Final to a virtual machine I created in VirtualBox.

Installing VirtualBox

First I went here and clicked the link for all distributions. In my case it downloaded a file named VirtualBox-3.0.8-53138-Linux_x86.run. As root I change the files property to be executable.


chmod +x VirtualBox-3.0.8-53138-Linux_x86.run

I then ran the file

./VirtualBox-3.0.8-53138-Linux_x86.run

I use Slackware 13 and use KDE as my desktop environment and after installing VirtualBox there is a new entry found under K> Applications> System> Virtual Machine that will open the management application for VirtualBox.

I am not going to go into detail on how to setup a virtual machine but I will say I created one for Backtrack and gave it a 10G disk that is dynamic. I also made sure to connect the usb devices of my host.

Backtrack 4 Pre installation to hard drive

I downloaded the Backtrack 4 Pre iso from here

Once it was downloaded I then mounted it to the guest I created in VirtualBox and told it to boot the image.

Once the image booted I then created 3 partitions using cfdisk, making sure to flag the boot partition (hda1 in my case) as bootable.

  • hda1  ->  50MB boot
  • hda2  ->  256MB swap
  • hda3  ->  10G root

Once I finished this I did the following to install Backtrack to harddisk:

  • mkdir /mnt/bt4
  • mount /dev/hda3 /mnt/bt4/
  • mkdir /mnt/bt4 /boot
  • mount /dev/hda1 /mnt/bt4/boot
  • cp –preserve -R /{bin,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt4/
  • mkdir /mnt/bt4/{dev,mnt,tmp,proc,sys}
  • mount -t proc proc /mnt/bt4/proc/
  • mount -o bind /dev /mnt/bt4/dev/
  • cd /media/cdrom0/boot
  • cp –preserve -R {bootsplash,vmlinuz,initrd.gz} /mnt/bt4/boot/
  • chroot /mnt/bt4/ /bin/bash


Since my boot partition resides on its’ own partition I added the following to the grub loader.


title BT4 PreFinal
root (hd0,0)
kernel /vmlinuz root=/dev/hda3 rw vga=0x317
initrd /initrd.gz


And again since boot resides in its’ own partition.


root@bt:~# grub
grub> find /grub/stage1
(hd0,0)
grub> root (hd0,0)
grub> setup (hd0)
grub> quit


I then added the following lines to the /etc/fstab file to mount the partitions in the correct place.


/dev/hda1 /boot ext2 defaults 1 1
/dev/hda2 swap swap defaults 0 0
/dev/hda3 / reiserfs defaults 1 1


Reboot and make sure to remove the attached iso file, start up the virtual machine and voila PwnSauce goodness!!

Advertisements

Written by lordfu

January 13, 2010 at 3:43 pm

Posted in Slackware

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: