Skip to content

Instantly share code, notes, and snippets.

@minkione
Forked from nethunteros/lxc-kali.sh
Created January 23, 2018 12:07
Show Gist options
  • Select an option

  • Save minkione/b1c583d91e29c85ec4bafa9820a0d0d5 to your computer and use it in GitHub Desktop.

Select an option

Save minkione/b1c583d91e29c85ec4bafa9820a0d0d5 to your computer and use it in GitHub Desktop.
Build Kali container in LXC
#!/bin/bash
##########################################################################################
# (right now the lxc bridge interface isn't working with this guide)
# (still had to install lxc over this)
# This is for my testing env for building a kali template for LXC
# You may need to install additional packages.
#
##########################################################################################
# Prereqs
sudo apt-get update
sudo apt install -y binfmt-support qemu qemu-user-static bridge-utils \
python3-dev libtool debootstrap autoconf automake \
libcap-dev libcgmanager0 libcgmanager-dev libselinux1-dev\
libapparmor-dev docbook2x git python3-setuptools
# Make & install LXC
git clone https://github.com/binkybear/lxc.git -b kali
cd lxc
./autogen.sh
/configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu \
--with-rootfs-path=/usr/lib/x86_64-linux-gnu/lxc --sysconfdir=/etc --localstatedir=/var \
--with-config-path=/var/lib/lxc
make && make install
# Template is located @
# /usr/share/lxc/templates/lxc-kali
# Create Kali LXC container
lxc-create -n kali -t kali -- -r kali-rolling
# Start container in background
lxc-start -n kali
# Access kali with console
lxc-console -n kali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment