Hands-on Lab

#Lab 01: Linux VM Setup

Set up a Linux virtual machine for DevOps practice.

#🎯 Objectives

  • Install and configure a Linux VM
  • Set up essential tools
  • Configure SSH access

#📋 Prerequisites

  • VirtualBox or VMware installed OR
  • WSL2 on Windows OR
  • Cloud account (AWS/GCP Free Tier)

#Option 1: WSL2 (Windows)

powershell
1# Install WSL2
2wsl --install -d Ubuntu
3
4# Set WSL2 as default
5wsl --set-default-version 2
6
7# Access Ubuntu
8wsl

#Option 2: VirtualBox

#Step 1: Download Ubuntu Server

Download from: https://ubuntu.com/download/server

#Step 2: Create VM

  1. Open VirtualBox → New
  2. Name: "devops-lab"
  3. RAM: 2048 MB minimum
  4. Create virtual hard disk: 20 GB

#Step 3: Install Ubuntu

  1. Start VM
  2. Select Ubuntu ISO
  3. Follow installation wizard
  4. Create user: devops

#Option 3: Cloud VM (AWS)

bash
1# Using AWS CLI
2aws ec2 run-instances \
3  --image-id ami-0c55b159cbfafe1f0 \
4  --instance-type t2.micro \
5  --key-name your-key \
6  --security-groups devops-sg

#Post-Installation Setup

#Update System

bash
sudo apt update && sudo apt upgrade -y

#Install Essential Tools

bash
1sudo apt install -y \
2  git \
3  curl \
4  wget \
5  vim \
6  htop \
7  net-tools \
8  tree \
9  jq

#Configure SSH

bash
1# Generate SSH key
2ssh-keygen -t ed25519 -C "your-email@example.com"
3
4# View public key
5cat ~/.ssh/id_ed25519.pub
6
7# Configure SSH server
8sudo systemctl enable ssh
9sudo systemctl start ssh

#Install Docker

bash
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Logout and login again

#✅ Success Criteria

  • Linux VM is running
  • Can SSH into the VM
  • Docker is installed and working

#🎓 What You Learned

  • Linux VM setup options
  • Basic system configuration
  • SSH key management