Building My Linux Lab & Navigating the WSL 'Docker Trap'

Task 1: Installing Ubuntu

For this project, the goal was to “Build a Personal Linux Lab.” While the instruction suggested a traditional or Cloud VM, I opted for WSL (Windows Subsystem for Linux). However, I immediately ran into a fascinating environment quirk that taught me a very key lesson in Linux distributions.


The Setup: Encountering the “Docker Trap”

Initially, when I launched my terminal, I noticed something odd. My prompt was BENNANDO:~# (indicating I was logged in as root), and basic commands like sudo were missing.

To investigate, I ran:

1
cat /etc/os-release

The Output: PRETTY_NAME="Docker Desktop"

The Lesson: I wasn’t in a full Ubuntu OS; I was inside Docker Desktop’s internal utility backend! This is a common pitfall when Docker is installed on Windows. To fix this, I had to pivot to a dedicated instance.

How I Resolved It:
  1. Opened Windows PowerShell. (You can also use Windows Command Prompt for this)
  2. Ran wsl -l -v to list all installed distros. Unfortunately, I had none installed.
  3. Installed a dedicated Ubuntu instance: wsl --install -d Ubuntu.
  4. Launched the correct environment: wsl -d Ubuntu.

Task 2: Navigating the Linux File System

Once inside the correct Ubuntu environment, I practiced moving through the filesystem without a GUI.

1
2
3
4
5
6
7
# Verify current location
pwd

# Create, navigate into, and delete a project workspace
mkdir -p ~/linux_lab/week1
cd ~/linux_lab/week1
rm -r ~/linux_lab/week1

Task 3: File Operations & Text Editing

Linux revolves around the concept that “everything is a file.” I practiced creating metadata and editing content via the CLI.

1
2
3
4
5
# Create a new file
touch first_entry.txt

# Open the file in Nano (Command Line Editor)
nano first_entry.txt

Inside the editor: I typed “Project 1: Linux environment successfully configured on dedicated Ubuntu WSL." and saved using Ctrl+O followed by Ctrl+X.


Task 4: User Management & Security

Operating as the root user is dangerous. I practiced creating a restricted user and granting them sudo privileges for specific administrative tasks.

1
2
3
4
5
# Add a new user
sudo adduser labuser

# Grant sudo access to the new user
sudo usermod -aG sudo labuser

Security Tip: Using usermod -aG sudo adds the user to the “SuperUser Do” group, allowing them to run admin commands only when explicitly requested.


Task 5: SSH Configuration (Remote Access)

SSH (Secure Shell) is the industry standard for managing remote servers. I configured my lab to accept local SSH connections to simulate remote management.

1
2
3
4
5
6
# Install and start the SSH service
sudo apt update && sudo apt install openssh-server -y
sudo service ssh start

# Test the connection to the local machine
ssh labuser@localhost

Result: Successful login! This confirms the machine is ready to be managed “headless” (without a direct monitor/GUI).


Key Commands Mastered This Week

Command Purpose
cat /etc/os-release Identify the Linux distribution and version.
wsl -l -v List all WSL distros installed on the Windows host.
pwd Print Working Directory (The “You Are Here” marker).
ls -la List all files, including hidden system files.
sudo Execute a command with administrative privileges.
ssh Securely access a remote terminal.

Final Thoughts

This week taught me that the “environment” matters just as much as the “commands.” Distinguishing between a Docker backend and a full Linux OS was a vital first step in my journey toward Linux system administration.