Running Multiple Linux VMs in Your Browser for Cross-Browser Testing

Running Multiple Linux VMs in Your Browser for Cross-Browser Testing
Photo by Daniil Komov on Pexels

Running Multiple Linux VMs in Your Browser for Cross-Browser Testing

A developer just demonstrated something that would have seemed impossible a decade ago: three full Linux virtual machines running simultaneously in a single browser tab, each executing a different web browser. The project, called “Side by Side,” showcases the remarkable convergence of WebAssembly, containerization, and modern JavaScript—but more importantly, it hints at the future of cross-platform testing and development environments.

For Linux administrators and DevOps engineers, this isn’t just a cool tech demo. It’s a glimpse into how we’ll be validating software across different environments, testing configurations, and debugging platform-specific issues without maintaining expensive infrastructure. Let’s dig into the technologies making this possible and, more practically, how you can leverage similar approaches in your daily workflow.

Table of Contents

WebAssembly and In-Browser Virtualization

The Side by Side project relies on v86, a x86 virtualization engine compiled to WebAssembly that runs directly in your browser. While you won’t be spinning up production workloads in a browser anytime soon, understanding the underlying concepts helps you grasp where virtualization technology is heading—and how lightweight it’s becoming.

WebAssembly (Wasm) has matured from a curiosity into a legitimate runtime environment. Major cloud providers now offer Wasm-based serverless platforms, and projects like Wasmtime and WasmEdge are bringing containerization-level isolation with microsecond startup times. If you’re exploring modern deployment strategies beyond traditional VMs and containers, platforms like Coursera offer specialized courses on cloud-native architectures that cover these emerging technologies.

But let’s get practical. The real lesson here isn’t about running VMs in browsers—it’s about ephemeral, reproducible testing environments that you can spin up instantly and discard just as quickly.

Practical Cross-Platform Testing with QEMU

While the browser-based approach is novel, most Linux administrators need something more robust for real validation work. QEMU remains the workhorse for running multiple lightweight VMs for testing purposes, especially when you need to validate configurations across different distributions or kernel versions.

Here’s how to quickly spin up multiple Linux VMs for testing without the overhead of a full hypervisor stack:

# Create a lightweight Alpine Linux VM for testing
# Download Alpine virtual ISO
wget https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-virt-3.19.0-x86_64.iso

# Create a 2GB disk image
qemu-img create -f qcow2 alpine-test.qcow2 2G

# Launch VM with 512MB RAM, forwarding port 2222 to guest's SSH port 22
qemu-system-x86_64 -m 512 -hda alpine-test.qcow2 \
  -cdrom alpine-virt-3.19.0-x86_64.iso \
  -net nic -net user,hostfwd=tcp::2222-:22 \
  -nographic -enable-kvm

This gives you a functional VM in seconds, not minutes. The key is using the -enable-kvm flag for hardware acceleration and the lightweight Alpine distribution that boots in under two seconds. Once configured, you can clone the disk image and run multiple instances simultaneously, each bound to different forwarded ports.

💡 Pro Tip: Use QEMU’s -snapshot flag when testing potentially destructive configurations. This runs the VM entirely from RAM without writing changes to disk, giving you a truly disposable environment that resets with each reboot.

Automated VM Provisioning with Cloud-Init

For repeatable testing scenarios, cloud-init eliminates manual configuration. Create a simple cloud-init configuration that sets up your test environment automatically:

# Save as user-data.yml
#cloud-config
users:
  - name: testuser
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-rsa YOUR_PUBLIC_KEY_HERE

packages:
  - nginx
  - curl
  - strace

runcmd:
  - systemctl enable nginx
  - systemctl start nginx
  - echo "Test environment ready" > /var/www/html/index.html

Pass this to your QEMU instance with the -smbios option or via a NoCloud data source, and you’ll have a fully configured test VM in under a minute. For teams managing complex testing matrices across distributions, learning infrastructure-as-code approaches through platforms like DataCamp can dramatically improve your workflow efficiency.

Docker-Based Browser Testing Environments

The Side by Side project demonstrates browser testing across different environments, which is exactly what many QA and DevOps teams struggle with daily. Docker provides a more practical solution for this specific use case than full VMs.

Selenium offers official Docker images with browsers pre-installed, but you can also roll your own lightweight testing containers. Here’s a minimal approach using Alpine Linux with Firefox:

# Dockerfile for lightweight browser testing container
FROM alpine:3.19

# Install Firefox ESR and X virtual framebuffer
RUN apk add --no-cache firefox-esr xvfb dbus ttf-freefont

# Create a non-root user for security
RUN adduser -D -u 1000 tester

# Set up Xvfb to run Firefox headless
ENV DISPLAY=:99

# Entry point script runs Xvfb and Firefox
CMD Xvfb :99 -screen 0 1024x768x24 & \
    firefox --headless --no-remote --screenshot /tmp/screenshot.png https://example.com

Build and run this container to capture screenshots of web applications across different browser versions without maintaining separate physical or virtual machines. For parallel testing across Chrome, Firefox, and WebKit, orchestrate multiple containers with Docker Compose, each exposing a different debugging port.

⚠️ Common Mistake: Don’t map privileged ports (< 1024) directly when running browser containers in parallel. Use high-numbered ports like 9222, 9223, 9224 for Chrome DevTools Protocol endpoints to avoid permission issues and port conflicts.

Real-World Applications for Sysadmins

Beyond the novelty of browser-based VMs, the core concept—ephemeral, isolated environments for testing—has immediate practical applications. Configuration changes that could break production systems can be validated in throwaway VMs. Security patches can be tested against realistic workloads before deployment. New employees can experiment with potentially destructive commands in sandboxed environments without risk.

The trend toward lighter-weight virtualization isn’t just about resource efficiency. It’s about reducing friction in the development and testing cycle. When spinning up a test environment takes 30 seconds instead of 30 minutes, you test more often and catch issues earlier.

Building a Multi-Distribution Test Lab

Use libvirt and virt-install to maintain a personal test lab with minimal overhead. Modern NVMe drives make running dozens of VMs practical on a single workstation:

# Quick Ubuntu Server test VM
virt-install --name ubuntu-test --ram 1024 --vcpus 1 \
  --disk size=5 --os-variant ubuntu22.04 \
  --network bridge=virbr0 \
  --graphics none --console pty,target_type=serial \
  --location 'http://archive.ubuntu.com/ubuntu/dists/jammy/main/installer-amd64/' \
  --extra-args 'console=ttyS0,115200n8 serial'

Combine this with snapshot functionality, and you have a reusable testing matrix. Create a base snapshot after initial setup, then fork temporary snapshots for each test scenario. When done, delete the snapshot and your base image remains pristine.

The Side by Side project reminds us that the barriers to running multiple isolated environments are disappearing. Whether you’re validating Ansible playbooks across different distributions, testing kernel configurations, or debugging platform-specific issues, the tools for rapid, reproducible testing are more accessible than ever. The question is whether you’re taking advantage of them.

Stay in the loop — join 125,000+ IT professionals following Networkyy: Instagram · Facebook · Threads · Medium
🔥 RECOMMENDED FOR YOU

Master Cloud-Native Virtualization Strategies

Learn advanced container orchestration, infrastructure-as-code, and modern deployment patterns that reduce testing friction and accelerate your DevOps workflow with hands-on guided projects.

Start Learning on Coursera →

Scroll to Top