
🐧 Lightweight Kali Linux on My M1 MacBook: No Docker, No VMs
by Amhar Azwar
Platform: Apple MacBook Air (M1, 2020, base model)
Use Case: Ethical hacking, penetration testing, terminal-based Linux vibes
Constraints: 2GB of available storage, no Docker Desktop, CLI-only obsession
📘 Overview
Hey there! I’m Amhar Azwar, a software engineer with a side hustle in ethical hacking and pentesting. My mission? To run Kali Linux on my base M1 MacBook Air (2020) without choking its measly 2GB of available storage or leaning on bloated tools like full VMs or Docker Desktop. Spoiler: I did it, and it’s all terminal-based—because who needs a GUI when you’ve got bash skills?
In this guide, I’m spilling the beans on how I used Docker and Colima to spin up a lean Kali environment, complete with the Social-Engineer Toolkit (SET). I’ll share the technical hiccups I hit (like losing my setup to a rookie mistake), the fixes I cooked up, and some pro tips to make your own setup slicker than a pentester’s phishing email.
🚀 Why Colima Over Docker Desktop?
Docker Desktop is the go-to for many, but it didn’t vibe with my setup:
- Size: It’s 2GB of available storage on my 256GB Mac.
- Daemons: Background processes? No thanks, I like my resources free.
- Minimalism: I wanted a lightweight, CLI-driven flow, not a GUI crutch.
Enter Colima—a sleek container runtime for macOS, built on Lima and Docker. It’s lightweight, terminal-friendly, and lets me run full Linux environments like Kali without breaking a sweat. Game changer.
🛠️ Full Setup: Kali Linux + Docker + Colima on M1 Mac
🔹 1. Install Docker (CLI-only) and Colima
First, I grabbed the essentials via Homebrew—because what’s a Mac setup without it?
brew install docker colima
Then, I fired up Colima with Docker as the runtime:
colima start --runtime docker
This spins up a tiny Linux VM under the hood, ready to host my containers—all from the comfort of my Mac terminal.
🔹 2. Create a Persistent Kali Linux Container
Here’s where I tripped up initially. I ran:
docker run -it kalilinux/kali-rolling
Cool, right? Nope. Exiting that session trashed the container—and all my work (RIP my first SET install). Lesson learned: unnamed containers are temporary. To keep my setup alive, I gave it a name:
docker run -it --name kali-persist kalilinux/kali-rolling /bin/bash
Now,
kali-persist
🔹 3. Inside Kali: Install the SET Toolkit
Inside the Kali shell, I got to work:
apt update && apt upgrade -y apt install git python3-venv -y git clone https://github.com/trustedsec/social-engineer-toolkit.git cd social-engineer-toolkit python3 -m venv venv source venv/bin/activate pip install -r requirements.txt pip install pycryptodomex python setoolkit
Boom! SET fired up, and I was ready to simulate some social engineering magic—right from my Mac.
❗ Rookie Mistake: docker start -ai kali-persist
Flopped
docker start -ai kali-persist
After my first session, I tried restarting with:
docker start -ai kali-persist
And got slapped with:
Error response from daemon: No such container: kali-persist
Why? My original unnamed container was a ghost—deleted when I exited. I’d set up SET for nothing.
✅ Fix: I rebuilt it properly with
--name kali-persist
🧠 Pro Move: Shortcut Script to Launch Kali
Typing commands every time? Nah, I’m too lazy for that. So I whipped up a script,
kali.sh
#!/bin/bash container="kali-persist" if docker ps -a --format '{{.Names}}' | grep -q "^$container$"; then docker start -ai "$container" else echo "❌ Container '$container' not found. Run the setup first:" echo "docker run -it --name $container kalilinux/kali-rolling /bin/bash" fi
Made it executable:
chmod +x ~/kali.sh
Now,
~/kali.sh
🧼 Keeping It Lean: Cleaning Up
With only 2GB to play with, I stay ruthless:
docker ps -a # List all containers docker rm <id> # Trash unused ones docker image prune # Wipe dangling images
Keeps my Mac light and my setup mean.
🔁 Running SET Like a Boss
To relaunch SET in future sessions:
docker start -ai kali-persist cd social-engineer-toolkit source venv/bin/activate python setoolkit
I got fancy and added this to Kali’s
.bashrc
cd ~/social-engineer-toolkit source venv/bin/activate
Now, every restart lands me in the SET zone, ready to roll.
✍️ Final Thoughts
This setup is my pride and joy—a minimalist masterpiece. I’ve got:
- A persistent Kali terminal on macOS
- Tools like SET, Nmap, and more at my fingertips
- No bloat from Docker Desktop or chunky VMs
It’s all driven from my Mac’s native terminal, lightning-fast and storage-friendly. Whether you’re a pentesting newbie or a CLI nerd, this is your ticket to Kali on an M1 Mac—tested and tweaked by yours truly.
🧠 Handcrafted and battle-tested by Mohamed Amhar
📍 On a base M1 MacBook Air with 2GB of available storage