Setup Guide - My Linux Environment

Complete setup and verification instructions for the QEMU Alpine Linux environment.

Pre-Flight Checklist

Before you start, verify:

Windows Setup

Step 1: Verify Installation

  1. Open Command Prompt (cmd.exe)

  2. Navigate to this directory:

    cd "D:\Haleem\Books\23052025\Added 23072025\my_linux_environment"
  3. Verify QEMU exists:

    dir qemu\bin\qemu-system-x86_64.exe

    You should see:

    Volume in drive D is ...
    Directory of D:\...my_linux_environment\qemu\bin
    
    qemu-system-x86_64.exe    XX,XXX,XXX  date
  4. Verify Alpine disk image exists:

    dir machine\vm_disk\alpine_disk.qcow2

Step 2: Launch the VM

Option A: Double-click the launcher - Simply double-click start_linux.bat - Wait for QEMU window to appear - Alpine Linux will boot

Option B: Command prompt launch

start_linux.bat

Step 3: Alpine Linux Boot

You’ll see output like:

Starting Minimal Alpine Linux Environment...
(Press Ctrl+A then c to toggle QEMU monitor. Ctrl+A then x to exit QEMU forcibly.)

Alpine Linux 3.x.x
...
(boot messages)
...
Alpine login:

Step 4: Login

Default credentials for Alpine Linux:

Username: root
Password: (empty - just press Enter)

Or if password is set:

Username: alpine
Password: alpine

Step 5: Verify System

Once logged in, run:

uname -a

You should see:

Linux (hostname) ... x86_64 GNU/Linux

Troubleshooting - Windows

Error: “QEMU executable not found” - Verify qemu\bin directory exists - Check file permissions on qemu-system-x86_64.exe - Antivirus may have quarantined QEMU - check security software

Error: “Alpine Linux disk image not found” - Verify machine\vm_disk\alpine_disk.qcow2 exists - Check file size is > 100MB (compressed QCOW2 format) - Verify no spaces or special characters in path

VM runs but no output appears - This is normal on some Windows configurations - Try pressing Enter multiple times - The VM is likely running but displaying issues


Linux/Mac Setup

Step 1: Verify Installation

  1. Open terminal

  2. Navigate to this directory:

    cd "D:\Haleem\Books\23052025\Added 23072025\my_linux_environment"
    # Or on Linux with different path syntax
    cd "/path/to/my_linux_environment"
  3. Make the launcher executable:

    chmod +x start_linux.sh
  4. Verify QEMU exists:

    ls -lh qemu/qemu-system-x86_64
  5. Verify Alpine disk image:

    ls -lh machine/vm_disk/alpine_disk.qcow2

Step 2: Launch the VM

./start_linux.sh

Or with explicit path:

bash start_linux.sh

Step 3: Alpine Linux Boot

You’ll see boot messages in your terminal. Wait for:

Alpine login:

Step 4: Login

Username: root
Password: (just press Enter)

Step 5: Verify System

uname -a
cat /etc/os-release

Troubleshooting - Linux/Mac

Error: “qemu-system-x86_64 not found” - Ensure start_linux.sh is executable: chmod +x start_linux.sh - QEMU binaries may need to be built for your system - Try: which qemu-system-x86_64 to see if QEMU is globally installed

VM exits immediately - Check available disk space: df -h - Check available RAM: free -h - Try allocating less memory in start_linux.sh (change -m 512M to -m 256M)

Serial console freezes - Press Ctrl+A then x to force exit - Try again - may be temporary issue


Post-Installation Verification

Quick Performance Test

Once logged in, run:

# Check system info
uname -a

# Check disk usage
df -h

# Check available memory
free -h

# Check CPU
nproc

# Check network (if configured)
ifconfig

Alpine Package Manager

Test Alpine’s package manager:

# Update package lists
apk update

# Search for a package
apk search vim

# Install a package
apk add vim

# List installed packages
apk info

File System Test

Create a test file:

# Create directory
mkdir /tmp/test

# Create file
echo "Hello from Alpine Linux" > /tmp/test/hello.txt

# Read it back
cat /tmp/test/hello.txt

# List directory
ls -la /tmp/test/

Common Commands Inside Alpine

# System information
uname -a                 # Kernel info
cat /etc/os-release     # OS info
lsb_release -a          # LSB info (if installed)

# Package management
apk update              # Update package cache
apk search package      # Search for package
apk add package         # Install package
apk del package         # Remove package
apk info                # List installed packages

# File system
ls -la                  # List files
pwd                     # Current directory
cd /path                # Change directory
mkdir dirname           # Create directory
rm -rf path             # Delete

# System administration
ps aux                  # Running processes
top                     # System monitor
ps aux | grep process   # Find process

# Network
ifconfig                # Network interfaces
ping 8.8.8.8           # Test network
curl https://example.com  # Fetch URL

Exiting the VM

Graceful Shutdown

From inside Alpine:

# Shutdown cleanly
shutdown -h now

# Or reboot
reboot

The VM will shut down and you’ll return to your command prompt.

Force Exit

If VM is unresponsive: - Windows: Close the QEMU window or press Ctrl+C in command prompt - Linux/Mac: Press Ctrl+A then x in the terminal


Optimization Tips

Allocate More RAM

Edit start_linux.bat or start_linux.sh and change:

-m 512M

To a higher value like:

-m 1024M    # 1 GB
-m 2048M    # 2 GB

Note: Don’t allocate more than half your system RAM.

Enable Hardware Acceleration

Windows: Already enabled with WHPX Linux: Edit start_linux.sh to add: -enable-kvm Mac: Add: -accel hvf (if using Apple Silicon)

Network Configuration

To enable networking: - Add: -nic user parameter to startup scripts - This creates a user-mode network without host network access


Backup & Restore

Creating a Snapshot

The QCOW2 format supports snapshots:

# Create snapshot
qemu-img snapshot -c mybackup machine/vm_disk/alpine_disk.qcow2

# List snapshots
qemu-img snapshot -l machine/vm_disk/alpine_disk.qcow2

# Restore snapshot
qemu-img snapshot -a mybackup machine/vm_disk/alpine_disk.qcow2

Backup the Disk Image

# Create backup
cp machine/vm_disk/alpine_disk.qcow2 machine/vm_disk/alpine_disk_backup.qcow2

Next Steps

  1. Verify your setup works with the steps above
  2. Read USAGE.md for detailed usage instructions
  3. Read ARCHITECTURE.md for technical details
  4. Start experimenting with Alpine Linux!

Questions? Refer to: - Alpine Linux Wiki: https://wiki.alpinelinux.org/ - QEMU Documentation: https://www.qemu.org/documentation/

← Back to Environment Hub