How to Try NixOS on Windows - Complete Guide

This step-by-step guide shows Windows users how to run NixOS virtual machines without installing any Linux tools or complex setup. Perfect for exploring NixOS safely alongside your existing Windows installation.

Why NixOS Virtual Machines?

Method 1: Download Pre-built VMs (Easiest)

Step 1: Choose Your Virtual Machine Software

Best for: First-time users, free option, works on all Windows versions

  1. Download VirtualBox: Visit virtualbox.org
  2. Install VirtualBox: Run the installer with default settings
  3. Install Extension Pack: Download and install for better performance

Option B: VMware Workstation (Professional Users)

Best for: Better performance, professional use

  1. Download VMware: VMware Workstation Pro
  2. 30-day trial available for testing

Option C: Hyper-V (Windows Pro/Enterprise)

Best for: Windows Pro users, native Microsoft virtualization

  1. Enable Hyper-V: Open PowerShell as Administrator:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    
  2. Restart computer when prompted

Step 2: Download Your NixOS VM

  1. Visit Releases: Go to GitHub Releases

  2. Choose Your Template:

    Template Best For File to Download
    Desktop New users, general use nixos-desktop-virtualbox.ova
    Gaming Gaming, Steam nixos-gaming-virtualbox.ova
    Development Programming, coding nixos-development-virtualbox.ova
    Server Learning Linux servers nixos-server-virtualbox.ova
    Minimal Learning NixOS basics nixos-minimal-virtualbox.ova
  3. Download the appropriate file for your VM software:

    • VirtualBox: .ova files
    • VMware: .vmdk files
    • Hyper-V: .vhdx files

Step 3: Import and Start Your VM

VirtualBox Import

  1. Open VirtualBox
  2. File MenuImport Appliance
  3. Select your downloaded .ova file
  4. Review settings (can adjust memory/CPU if needed)
  5. Click Import (takes 5-10 minutes)
  6. Double-click the VM to start it

VMware Import

  1. Open VMware Workstation
  2. File MenuOpen
  3. Select your downloaded .vmdk file
  4. Create new VM and use the VMDK as the hard drive
  5. Adjust settings as needed
  6. Power on the VM

Hyper-V Import

  1. Open Hyper-V Manager
  2. Action MenuNewVirtual Machine
  3. Use existing virtual hard disk
  4. Select your downloaded .vhdx file
  5. Complete wizard and start VM

Step 4: First Login

  1. VM will boot to login screen

  2. Default credentials:
    • Username: nixos
    • Password: nixos
  3. IMPORTANT: Change password immediately:

    passwd
    

Step 5: Initial Setup

  1. Update system:

    sudo nixos-rebuild switch --upgrade
    
  2. Install VM Guest Tools (for better integration):
    • VirtualBox: Menu → Devices → Insert Guest Additions CD
    • VMware: VM → Install VMware Tools
    • Hyper-V: Integration services auto-installed
  3. Connect to internet (should work automatically)

Method 2: Build Custom VMs with Docker

Prerequisites

Step 1: Install Docker Desktop

  1. Download: Docker Desktop for Windows

  2. Install with default settings

  3. Start Docker Desktop

  4. Verify installation: Open PowerShell and run:

    docker --version
    

Step 2: Create Workspace

  1. Open PowerShell and create a folder:

    mkdir C:\NixOS-VMs
    cd C:\NixOS-VMs
    

Step 3: Build Your VM

  1. Pull the VM builder:

    docker pull olafkfreund/nixos-vm-builder:latest
    
  2. Build a desktop VM:

    docker run --rm -v "${PWD}:/workspace" olafkfreund/nixos-vm-builder:latest virtualbox --template desktop
    
  3. Wait for build (30-60 minutes depending on template)

  4. Find your VM: Check the output folder for your VM file

Advanced Build Options

# Build for Hyper-V with custom specs
docker run --rm -v "${PWD}:/workspace" olafkfreund/nixos-vm-builder:latest hyperv --template server --disk-size 40960 --memory 4096

# Build gaming VM for VMware
docker run --rm -v "${PWD}:/workspace" olafkfreund/nixos-vm-builder:latest vmware --template gaming

# Build development environment
docker run --rm -v "${PWD}:/workspace" olafkfreund/nixos-vm-builder:latest virtualbox --template development

# See all options
docker run --rm olafkfreund/nixos-vm-builder:latest --help

What’s Included in Each Template

Desktop Template

Perfect for: First-time NixOS users, general desktop use

What you get:

System specs: 20GB disk, 4GB RAM

Gaming Template

Perfect for: Gamers wanting to try Linux gaming

What you get:

System specs: 80GB disk, 8GB RAM

Development Template

Perfect for: Programmers and developers

What you get:

System specs: 60GB disk, 6GB RAM

Server Template

Perfect for: Learning Linux server administration

What you get:

System specs: 40GB disk, 2GB RAM

Minimal Template

Perfect for: Learning NixOS basics, low-resource systems

What you get:

System specs: 10GB disk, 1GB RAM

Getting Started with Your NixOS VM

Essential First Steps

  1. Change the password:

    passwd
    
  2. Update the system:

    sudo nixos-rebuild switch --upgrade
    
  3. Learn basic commands:

    # List installed packages
    nix-env -q
    
    # Search for packages
    nix-env -qaP firefox
    
    # System information
    nixos-version
    

Desktop Template Quick Tour

  1. Activities Overview: Click top-left corner or press Super key
  2. Applications: Click the 9-dot grid in bottom-left
  3. Terminal: Press Ctrl+Alt+T
  4. Files: File manager for browsing
  5. Settings: System configuration

Learning NixOS

  1. Configuration File: /etc/nixos/configuration.nix
    • This file defines your entire system
    • Changes require rebuilding: sudo nixos-rebuild switch
  2. Package Management:

    # Search packages
    nix search firefox
    
    # Install temporarily
    nix-shell -p firefox
    
    # Edit system config to install permanently
    sudo nano /etc/nixos/configuration.nix
    
  3. Key Concepts:
    • Declarative: Describe what you want, not how to get it
    • Reproducible: Same config = same system
    • Rollback: Easy to undo changes
    • Generations: System snapshots

Troubleshooting Common Issues

VM Performance Issues

Problem: VM runs slowly Solutions:

Problem: Graphics are slow/choppy Solutions:

Networking Issues

Problem: No internet in VM Solutions:

Problem: Can’t SSH to server VM Solutions:

System Issues

Problem: System won’t update Solutions:

Problem: Package installation fails Solutions:

Next Steps: Learning Path

Week 1: Basic Exploration

Week 2: Package Management

Week 3: System Configuration

Month 2: Advanced Topics

Getting Help

Official Resources

Community Support

This Repository

Frequently Asked Questions

Q: Is it safe to run these VMs on Windows?

A: Yes! VMs are completely isolated from your Windows system. They can’t harm your Windows installation.

Q: Which template should I choose as a beginner?

A: Start with the Desktop template. It’s the most user-friendly and includes everything you need to explore NixOS.

Q: Can I run multiple VMs at once?

A: Yes, but ensure you have enough RAM. Each desktop VM needs 4GB, so 16GB+ Windows RAM is recommended for multiple VMs.

Q: How do I share files between Windows and the VM?

A:

Q: Can I access my Windows files from the VM?

A: Yes, through shared folders (VM tools required) or network shares.

Q: Should I use these VMs for production work?

A: These VMs use default passwords and are optimized for learning. For production, change all passwords and apply security hardening.

Q: Can I convert from VM to dual-boot later?

A: Yes! Once comfortable with NixOS in a VM, you can install it directly on hardware or dual-boot with Windows.

Q: How much disk space do I need?

A:

Q: Can I customize the VMs?

A: Absolutely! After import, you can modify /etc/nixos/configuration.nix and rebuild the system. You can also build custom VMs using the Docker method.


Ready to start? Pick a template above and follow the steps. The Desktop template is perfect for first-time users!

Need help? Join the NixOS community or create an issue in this repository.

Built with NixOS - Welcome to the future of Linux!