From-Scratch Build · Dev Environment
A set of shell scripts that spin up a clean Linux virtual machine and provision it into a ready-to-work development box — the same way, every time, so "set up my dev environment" becomes one command instead of a lost afternoon.
What it is
A virtual machine is a whole computer running as software inside your real one — its own operating system, isolated from the host. It's the cleanest place to develop: you can install anything, break anything, and throw the whole thing away without touching your actual laptop. The catch is setup. A fresh VM is an empty Linux box, and turning it into a usable workspace — users, keys, packages, Docker, language tools — is tedious and easy to get subtly wrong.
I built this to automate that turning-into-a-workspace step. A handful of scripts create a lightweight Linux VM and then provision it: every package, permission and tweak applied in a defined order, described in code rather than typed by hand. Run it on an empty VM and you get a complete dev environment; run it again and nothing breaks.
The core idea I wanted to learn: a development environment should be disposable. If provisioning is fully scripted, a broken VM isn't a crisis — you delete it and rebuild an identical one in minutes, because the machine is defined by code you can re-run.
The stack
The build is a thin orchestration script wrapped around a few well-chosen tools. Here's the role each one plays.
A small, fast Linux virtual machine that runs on the host. It's the disposable box everything else is built on top of.
The single entry point. A shell script that starts the VM, gathers connection details, and kicks off provisioning in the right sequence.
A provisioning tool runs ordered, declarative tasks over SSH — create the user, install packages, set permissions — so the setup is repeatable and auditable.
Key-based login wired up automatically, so connecting to the VM is passwordless and a friendly ssh alias just works.
The target user is added to the Docker and sudo groups, so the dev box can build and run containers out of the gate.
A fast Python toolchain and per-directory environment loading, so projects pick up their own settings the moment you cd in.
How it works
The setup runs as an ordered sequence, and every step is written to be safe to repeat. That property — idempotence — is what lets you re-run the whole thing without fear.
Boot a fresh Linux virtual machine, or reuse the existing one if it's already up.
Retrieve the VM's SSH connection details automatically, so no address or port is ever copied by hand.
Ensure an SSH key exists and install the public half into the VM for passwordless login.
Add a dedicated non-root user and grant it sudo and docker access.
Hand off to the provisioning tool, which installs packages, language tooling and system tweaks in declarative, ordered tasks.
Saved VM snapshots for instant rollback are left as future work — ambitious builds are never quite finished.
How it runs
Bootstrapping is the whole point. The promise of the build is that the entire path from nothing to a working dev box is a single command — and the result is reachable by a single alias:
In my rebuild I focused on the provision-and-connect path: one ./setup.sh takes an empty VM to a Docker-and-Python-ready box you reach with a plain ssh.
Reflection