Menu

Schroot Log in to Edit

Chroot

Wireshark 1.6.7 with OPC ua dissector inside chroot on debian squeeze


NEEDS SOME MORE CLEANING


References

Requirements

  • A computer with Debian squeeze and an internet connection
  • Some disk space: the final chroot is a little bit under 1GB in size

Step by step

STEP 1. Install debootstrap and schroot

sudo apt-get install debootstrap schroot

STEP 2. Create a direchtory for chroot in your home directory

cd ~/
sudo mkdir /chroot

NOTE: if you make the directory outside your home directory, make sure your normal user has the right privileges.

STEP 3. Install Debian sid using debootstrap

sudo debootstrap --include=iceweasel sid /chroot http://ftp.us.debian.org/debian

NOTE1: include iceweasel with the installation. This is an easy way to install W.

NOTE2: use a nearby mirror if you don't live in the US of A.

STEP 4. In your /etc/apt/schroot.conf you should enter/uncomment this:

[sid]
description=Debian sid (unstable)
aliases=default
type=directory
mount-options=-o atime,sync,user_xattr
location=/home/<yourUser>/chroot
users=<yourUser>
root-users=<yourUser>
run-setup-scripts=true
run-exec-scripts=true

STEP 5. And your /etc/schroot/mount-defaults should look like this:

    # mount.defaults: static file system information for chroots.
    # Note that the mount point will be prefixed by the chroot path
    # (CHROOT_PATH)
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    /dev            /dev            none    rw,bind         0       0
    /dev/pts        /dev/pts        none    rw,bind         0       0
    tmpfs           /dev/shm        tmpfs   defaults        0       0
    /home           /home           none    rw,bind         0       0
    /tmp            /tmp            none    rw,bind         0       0

STEP 6. Now go into your chrooted environment

schroot -p -c sid

STEP 7. Try running iceweasel, it probably won't work.

iceweasel

You may have trouble starting X applications in your chroot because you cannot open display 0:0. You can fix this by typing: xhost + before entering the chroot:

xhost +
schroot -p -c sid
iceweasel

WARNING: to be safe, you should use a wrapper script as described over here

STEP 8. Install wireshark

sudo apt-get install wireshark

STEP 9. Run wireshark

wireshark

NOTE: you can start it directly from outside the crooted environment like so:

schroot -p -c sid wireshark

MORE TIPS AND TRICKS

1. locale troubles

You may get errors when installing things with apt-get because your locales aren't properly setup. Fix like so:

apt-get -f install.
apt-get install locales
dpkg-reconfigure locales

Select the locale(s) you want to use (you can check outside your chroot what you're using there with

2. Wireshark as non-root user

wireshark as non-root user:
METHOD 1

dpkg-reconfigure wireshark-common

--> choose yes

usermod -a -G wireshark <youruser>

You need to logout and login again to make the changes of your group to take effect.

METHOD 2 (works tested)

$ sudo -s
# groupadd -g wireshark
# usermod -a -G wireshark <yourUser>
# chgrp wireshark /usr/bin/dumpcap
# chmod 4750 /usr/bin/dumpcap

NOTE: you can add the group outside of your chroot.

3. A wrapper script

Create a file named wireshark_wrapper in

/usr/local/bin/wireshark_wrapper


#!/bin/bash
# right way for export Xauthority file
#xauth extract /home/<YOURUSERNAME>/chroot$HOME/.Xauthority $DISPLAY
xhost +
# run your command
schroot -c sid -p wireshark
# remove the Xauthority
#rm -f /home/<YOURUSERNAME>/chroot$HOME/.Xauthority
xhost -

and put an icon on your desktop/toolbar that calls this script.


Related

Wiki: Home

MongoDB Logo MongoDB