You MUST have a Debian unstable environment (physical/dual boot, virtual machine, container or a chroot with schroot) to create packages suitable for uploading to debian. See instructions given below to setup Debian Sid. You can use lxc, docker or a virtual machine for development.

Note: The target audience is, people just discovering debian.

LXC

If you have trouble setting it up, skip this section and see docker section below.

If you already have a GNU/Linux system, lxc would be the easiest to setup. Install lxc using this command.

sudo apt-get install lxc

If you have Ubuntu 14.04/trusty then install lxc from backports

sudo apt-get -t trusty-backports install lxc

Arch/Manjaro users see https://wiki.archlinux.org/index.php/Linux_Containers

Now install some necessary packages for networking support for the container.

sudo apt-get install -qy libvirt-clients libvirt-daemon-system iptables ebtables dnsmasq-base # if libvirt-client is not available, try libvirt-bin

Check status of libvirt daemon (service)

systemctl status libvirtd 

and start if not running

systemctl start libvirtd 

Now start the networking service using

sudo virsh net-start default
sudo virsh net-autostart default

Check LXC#Network_setup_in_buster for buster specific changes.

Now create the container named debian-sid

sudo lxc-create -n debian-sid -t download -- --dist debian --release sid

You might have to use lxc-attach instead of lxc-console to connect to the container. After attaching yourself you could set your root password using passwd.

Before connecting to the container, you might want to start the container

sudo lxc-start -n debian-sid

To connect to the container

sudo lxc-attach -n debian-sid

This is assuming that you have named your container 'debian-sid' as per the previous instructions.

See http://blog.scottlowe.org/2013/11/25/a-brief-introduction-to-linux-containers-with-lxc/ for more info on using lxc.

Create a new user with adduser and switch to that user with su - <username>. See https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-debian-8. Easiest way to create a user with permission to run sudo would be:

useradd -m -g sudo <username>

It is worth noting that you need to install sudo as it does not come default. Also the -m tag creates a home folder for the user, this is not trivial and can be skipped.

Docker

If you already setup a container with lxc as instructed above, you can skip this step.

Install docker either from your OS's package repositories or check out https://docs.docker.com/engine/installation/linux/.

Pull the development docker image that FSCI provides

docker pull registry.gitlab.com/fsci/resources:debian-dev

Create a container with it and run bash on it

docker run --privileged --name "sid" -it registry.gitlab.com/fsci/resources:debian-dev bash

If needed, update and upgrade to latest versions of packages

apt-get update && apt-get upgrade

Create a normal user for packaging. See https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-debian-8

Exit after your work is done. If you need to connect to it later, use the following commands which will take you to the bash prompt

docker start sid
docker attach sid

Virtual Machine

Install Virtual box and run Debian Sid in it.

sudo apt install virtualBox

For Manual installation, download Debian Testing ISO from Debian website and install it inside already installed VirtualBox. Once you have Debian Testing, you can upgrade it to Sid/unstable.

Edit /etc/apt/sources.list and change testing to sid or unstable.

apt update
apt dist-upgrade

If you want to make your job easy just install vagrant

sudo apt install vagrant-libvirt libvirt-daemon-system

Make sure that you are having only single Hypervisor running otherwise be ready to see some error. Also, vagrant installation might ask you to install some other additional packages, allow it to do so.

Add your user to libvirt group to use vagrant without additional privillege prompts

sudo gpasswd -a <your user> libvirt

Create a new directory from where you want to start VM. vagrant will store some configuration file in that directory and then switch to that directory

mkdir /path/to/directory/packaging
cd /path/to/directory/packaging

Now we need to tell vagrant where we need to fetch Vagrant box (VM image)

You can find recent Debian Testing vagrant box on the following URL https://app.vagrantup.com/debian/boxes/testing64

vagrant init debian/testing64
vagrant up

Note: This can take some time depending on your internet connection speed.

Then you can connect to the VM by

vagrant ssh

Note: Current image is very old, so you will need to run apt update and apt dist-upgrade (to update debian-archive-keying) before you can upgrade to sid.

You can update to Sid by replacing testing with sid in /etc/apt/sources.list and running

apt update
apt dist-upgrade

Note: If you use nfs to share host directory with the vm, then you'll need rpc-statd service or you may get no locks available error message.

sudo systemctl enable rpc-statd  # Enable statd on boot
sudo systemctl start rpc-statd  # Start statd for the current session