<commit_before>\documentclass[a4paper]{article}
\usepackage{verbatim}

\begin{document}
\section{Creating the master}
First I installed schroot and debootstrap

\begin{verbatim}
sudo apt-get install schroot debootstrap
\end{verbatim}

Next I created the configuration file

\begin{verbatim}
cd /etc/schroot/chroot.d
touch precise_amd64.conf
\end{verbatim}

And filled it with the following content

\begin{verbatim}
[precise_amd64]
description=Ubuntu precise pangolin
directory=/home/lars/ubuntu-master/precise.chroot
root-users=lars
type=directory
users=lars,m2user
\end{verbatim}

Note that I already had the necessary folders created.
Also note that the root user is a user from the outer system. In this case, I (lars) will be able to schroot into this system without using sudo.
Then I installed precise into the directory

\begin{verbatim}
sudo debootstrap --variant=buildd --arch=amd64 precise 
  /home/lars/ubuntu-master/precise.chroot/ 
  http://archive.ubuntu.com/ubuntu/
\end{verbatim}

Now one can list all schroots with

\begin{verbatim}
schroot -l
\end{verbatim}

One can enter the schroot using

\begin{verbatim}
schroot -c precise_amd64 -u root
\end{verbatim}

Note that you might get an error message depending on whether the folder you start the schroot in also exists in the schroot environment or not.

Schroot automatically mounts the /home folders. We don't want that, thus we deactivate this by commenting the /home line in /etc/schroot/mount-defaults. Actually we don't want to mount any folder from the outside to the schroot, so we comment all lines that aren't commented yet.
\section{A first copy}
I edit the file /etc/schroot/chroot.d/precise\_clone.conf

\begin{verbatim}
[precise_clone]
description=Ubuntu precise pangolin
directory=/home/lars/ubuntu-master/precise.clone
root-users=lars
type=directory
users=lars,m2user
\end{verbatim}

Next I create a folder and mount the original system into it

\begin{verbatim}
cd /home/lars/ubuntu-master
mkdir precise.clone
sudo mount --bind -r /home/lars/ubuntu-master/precise.chroot 
  /home/lars/ubuntu-master/precise.clone
schroot -c precise_clone -u root
\end{verbatim}

This even works.

\section{Installing packages}
The package list is very short and incomplete. Change that via

\begin{verbatim}
sudo cp /etc/apt/sources.list 
  /home/lars/ubuntu-master/precise.chroot/etc/apt/sources.list
schroot -c precise_amd64 -u root
apt-get update
apt-get upgrade
apt-get install openssh-server vim
\end{verbatim}

\section{Setting upd ssh}

We already installed the ssh server in the last section. Now change the port it listens on:

\begin{verbatim}
schroot -c precise_amd64 -u root
vim /etc/ssh/sshd_config
\end{verbatim}

Then restart the server

\begin{verbatim}
/etc/init.d/ssh restart
\end{verbatim}

Now from the outside do

\begin{verbatim}
ssh localhost port_you_chose
\end{verbatim}

\section{Pitfalls}
\begin{itemize}
\item Look at /etc/passwd. For some reason all users of the top system appear here. This might be good for others but not for us.
\item The shell via ssh looks weird.
\item We want different ports for all schroots, but we only have one file we can change.
\end{itemize}

\end{document}<commit_msg>Installing M2.<commit_after>\documentclass[a4paper]{article}
\usepackage{verbatim}

\begin{document}
\section{Creating the master}
Replace precise by another version if needed.

First I installed schroot and debootstrap

\begin{verbatim}
sudo apt-get install schroot debootstrap
\end{verbatim}

Next I created the configuration file

\begin{verbatim}
cd /etc/schroot/chroot.d
touch precise_amd64.conf
\end{verbatim}

And filled it with the following content

\begin{verbatim}
[precise_amd64]
description=Ubuntu precise pangolin
directory=/home/lars/ubuntu-master/precise.chroot
root-users=lars
type=directory
users=lars
\end{verbatim}

Note that I already had the necessary folders created.
Also note that the root user is a user from the outer system. In this case, I (lars) will be able to schroot into this system without using sudo.
Then I installed precise into the directory

\begin{verbatim}
sudo debootstrap --variant=buildd --arch=amd64 precise 
  /home/lars/ubuntu-master/precise.chroot/ 
  http://archive.ubuntu.com/ubuntu/
\end{verbatim}

Now one can list all schroots with

\begin{verbatim}
schroot -l
\end{verbatim}

One can enter the schroot using

\begin{verbatim}
schroot -c precise_amd64 -u root
\end{verbatim}

Note that you might get an error message depending on whether the folder you start the schroot in also exists in the schroot environment or not.

Schroot automatically mounts the /home folders. We don't want that, thus we deactivate this by commenting the /home line in /etc/schroot/mount-defaults. Actually we don't want to mount any folder from the outside to the schroot, so we comment all lines that aren't commented yet.
\section{A first copy}
I edit the file /etc/schroot/chroot.d/precise\_clone.conf

\begin{verbatim}
[precise_clone]
description=Ubuntu precise pangolin
directory=/home/lars/ubuntu-master/precise.clone
root-users=lars
type=directory
users=lars
\end{verbatim}

Next I create a folder and mount the original system into it

\begin{verbatim}
cd /home/lars/ubuntu-master
mkdir precise.clone
sudo mount --bind -r /home/lars/ubuntu-master/precise.chroot 
  /home/lars/ubuntu-master/precise.clone
schroot -c precise_clone -u root
\end{verbatim}

This even works.

\section{Installing packages}
The package list is very short and incomplete. Change that via

\begin{verbatim}
sudo cp /etc/apt/sources.list 
  /home/lars/ubuntu-master/precise.chroot/etc/apt/sources.list
schroot -c precise_amd64 -u root
apt-get update
apt-get upgrade
apt-get install openssh-server vim
\end{verbatim}

\section{Setting upd ssh}

We already installed the ssh server in the last section. Now change the port it listens on:

\begin{verbatim}
schroot -c precise_amd64 -u root
vim /etc/ssh/sshd_config
\end{verbatim}

Then restart the server

\begin{verbatim}
/etc/init.d/ssh restart
\end{verbatim}

Now from the outside do

\begin{verbatim}
ssh localhost port_you_chose
\end{verbatim}

\section{Installing M2}

We use oneiric instead of precise.
Use Google to find a more complete sources.list.
Add the

\begin{verbatim}

\end{verbatim}


\section{Pitfalls}
\begin{itemize}
\item Look at /etc/passwd. For some reason all users of the top system appear here. This might be good for others but not for us.
\item The shell via ssh looks weird.
\item We want different ports for all schroots, but we only have one file we can change.
\end{itemize}

\end{document}
{'fraction_non_alphanumeric': 0.08175049384592008, 'fraction_numerical': 0.00455857772375019, 'mean_word_length': 4.498746867167919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4469375', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2066, 'n_words': 783}