wiki:TorLabInstallFs

This file describes the istallation of Tor in the filesystem used by the Virtual Machine. These steps are needed only if you want to install a different version of Tor. Otherwise, you can simply download the modified filesystem files.

Installing Tor in the Netkit Filesystem

( for detailed instuctions on modifying the Netkit filesystem, see http://www.netkit.org/faq.html#q07 )

The default Netkit FS does not contain Tor, so we have to add it. We launch a VM that uses and modifies the original filesystem file, and we install Tor on this system. The original Netkit filesystem is Debian based, so we use "apt" and Debian repositories duing the process. By chosing the right repository, you can decide whether to use the stable (currently 0.1.2.17) or the development (currently 0.2.0.8-alpha) version of Tor.

Note: later on, Netkit will launch VM's with a copy-on-write version of the filesystem, so the one we create now remains intact.

Note: a VM has easy read/write access to files on the host machine through the /hosthome and /hostlab directories.

Starting VM to modify filesystem

Start a virual machine that can modify the original file system (-W) and has external network access (--eth0=tap,....):

vstart vm --eth0=tap,10.0.0.1,10.0.0.2 -M 256 -W

Resolving DNS problems

Check whether DNS is working from the VM. If it is not working, you have to teach the VM to use the right nameserver. One way of doing this is to copy the resolv.conf from your host inside the VM:

on your host:

cp /etc/resolv.conf ~/resolv.conf.tmp

in the VM:

cp /hosthome/resolv.conf.tmp /etc/resolv.conf

Adding "apt" experimental sources (only for experimental version of Tor)

(based on http://wiki.noreply.org/noreply/TheOnionRouter/TorOnDebian )

If you want to install the experimental version of Tor you have to teach the VM's Debian to look for experimental packages as well. edit /etc/apt/sources.list and add the following lines:

deb http://mirror.noreply.org/pub/tor etch main
deb-src http://mirror.noreply.org/pub/tor etch main
deb http://mirror.noreply.org/pub/tor experimental-0.2.0.x-etch main
deb-src http://mirror.noreply.org/pub/tor experimental-0.2.0.x-etch main

Installing Tor in the VM

Install Tor inside the VM, using the following commands:

apt-get update
apt-get install tor

The last command will install a large number of packages. Don't worry, it will be fine.

Remove automatic startup:

For some reason tor start is scheduled before networking (with priority 20), which creates various problems. To resolve these problems and to keep Tor startup flexibile, we remove tor startup from rc.d . We will start Tor directly from the Netkit startup scripts.

rm /etc/rc?.d/S??tor
#as an alternative, remove deemon mode from /etc/defaults/tor

Installing other software in the VM

You can install other software just as in any Debian based linux system.

1, To intall a package, use

apt-get install <package name>

2, You can easily copy executables into the filesystem through your home directory, which is mounted in the VM as /hosthome

Note: when copying executables, make sure they are linked to the right version of the libraries or that they are statically linked!

3, You can also compile sources inside the VM For this you need to install the compiler as a preparatory step:

apt-get install gcc g++ make binutils automake autoconf

Shutting down the VM

You should shut down the VM gracefully, otherwise your base filesystem gets corrupted.

Inside the VM do

halt

or from the host do

vhalt vm

Installing Wireshark

If the version from the stable distrib is enough for you, just do:

apt-get install wireshark

If you need the newest version:

First, edit /etc/apt/sources.list

mcedit /etc/apt/sources.list

and change the keyword stable to unstable.

Now you can install the new wireshark:

apt-get update
apt-get install wireshark

To install your own modules: Start Wireshark and check the plugins directory in Help/About? copy your module files (*.so) into this directory (/usr/lib/wireshark/wireshark/plugins/0.99.7pre1 in my case)

Freeing up some space on the virual FS

apt-get autoclean
Last modified 11 years ago Last modified on Dec 12, 2007, 2:46:26 PM