Running Backtrack in VirtualBox
April 11, 2008 – 4:59 AMSeeing as I’ve just spent the morning trying to get all this up and running I thought I’d create an entry about how to get Backtrack running in VirtualBox.
For those who haven’t heard of it, VirtualBox is an open source equivalent to vmware workstation. It does full snapshoting (unlike vmware server) and seems to have a very active support community.
The setup I wanted was for the virtual machine to have its own IP address and full network access. The default setup for VirtualBox is to have NAT based networking so I had to do a bit of work to get full “Host Interface” mode. Unlike vmware, VirtualBox doesn’t do all the networking itself you have to do the initial setup yourself. This is done by using tun/tap and bridging. The instructions here work on Arch but should be generic enough for any distro. The install guide has detailed instructions for debian/ubuntu, redhat and suse.
First you need to install uml_utilities and bridge-utils, in Arch:
pacman -S uml_utilities bridge-utils
You then create a bridge and add your main interface to it:
brctl addbr br0
ifconfig eth0 0.0.0.0
brctl addif br0 eth0
ifconfig br0 up
The IP address normally assigned to eth0 now needs to be assigned to br0, so either bring up your dhcp client or hardcode the IP using ifconfig. If you are using ifconfig remember to setup your default route. Also remember to kill any dhcp clients working for eth0.
Next is creating the tun/tap interface. First check if you have the tun module loaded:
lsmod|grep tun
and if not load it:
modprobe tun
The virtual machine is going to get its own interface, this can be named whatever you want, I call mine vbox0. To create it:
tunctl -t vbox0 -u robin
this then needs adding to the bridge:
brctl addif br0 vbox0
and, the bit I missed for a while, brining up:
ifconfig vbox0 up
You also need to check that the device (/dev/net/tun) is accessible by the user who is going to use it. I did this by creating a new vboxusers group, adding myself to it then making sure that the group could read and write from the device:
groupadd vboxuser
usermod -a -G vboxuser robin
chgrp vboxusers /dev/net/tun
chmod g+rw /dev/net/tun
You should now have a working virtual interface.
VirtualBox has a fairly simple GUI for creating new machines so I won’t talk through that in detail. Basically, click the create a new machine button, set the memory size and if you want to have a drive for the machine, set that up here as well.
Once you’ve setup the machine it will appear in the left hand list of available machines. Right click on it and chose settings. Chose Network and change the “Attached to” option to “Host Interface”. In the “Interface Name” section at the bottom enter vbox0 (or whatever you called it above).
Next go to the “cd/dvd-rom” section and chose “mount cd/dvd drive” and specify where your backtrack CD id, either ISO or physical location. Click OK and you’re done.
Start the machine, it should boot as normal and once up and running should try to get an IP address through dhcp, if you haven’t got dhcp you will need to setup the IP manually.
All of this information is available in the VirtualBox manual but I found that some of the scripts it referred to didn’t exist or didn’t work quite as expected. I also prefer to set this kind of thing up by hand, at least the first few times so that I really know what is going on, once I’m happy then I’ll look at scripting it.
Source: PaulDotCom Community Blog
5 Responses to “Running Backtrack in VirtualBox”
I got backtrack to start and everything, but I am stuck in the terminal. The Desktop and stuff isn’t showing up, so I am stuck using only text commands which really sucks because I am still pretty new at linux in general. Do you know how I can get it to give the the gnome desktop or anything similar?
By ian on Apr 10, 2009
Ian login with root user and toor as password. then just type startx
By cam on May 26, 2009
Silly question: Did you startx after you logged in?
By uberPenguin on Jun 17, 2009
I can’t even access gnome desktop even if i startx. Sometimes i see a blank screen with the gnome cursor but it seems to loop back to the beginning before being able to see anything on desktop.
I am using Win7 and was able to work Fedora10.
By Julien on Oct 8, 2009
hai, i am izzaty from malaysia. may i know, which is better to run backtrack, vmware workstation or virtualbox? since i am final year student and based on my studies, virtualbox is better than vmware. i need to install backtrack n doing my experiment.
By izzaty on Oct 7, 2011