RackNerd Billboard Banner

Install Latest NixOS on a Virtual Machine

NixOS is unlike most Linux distributions. It’s declarative, reproducible, and built around the Nix package manager — meaning your entire system configuration lives in a single file you can roll back or recreate anywhere. If you want to try it without touching your main OS, a virtual machine is the perfect playground.

This guide will walk you through installing the latest NixOS in a VM using VirtualBox, though the process is similar for VMware, QEMU, or other hypervisors.


1. Download the Latest NixOS ISO

  1. Go to the official NixOS download page.
  2. Choose Graphical ISO (recommended for beginners) or Minimal ISO (for a bare-bones setup).
  3. Download the x86_64 build unless you’re using ARM hardware.

2. Create a New Virtual Machine

Open VirtualBox and create a new VM:

  • Name: NixOS (or whatever you like)
  • Type: Linux
  • Version: Other Linux (64-bit)

Allocate resources:

  • RAM: 2 GB minimum (4 GB recommended)
  • CPUs: At least 2
  • Video Memory: 128 MB (max in VirtualBox settings)

Create a Virtual Hard Disk:

  • Type: VDI
  • Size: 20 GB+ (dynamically allocated is fine)

💡 Tip: If you ever run out of space, here’s how to enlarge a virtual machine’s disk in VirtualBox or VMware.


3. Mount the ISO

In the VM settings:

  1. Go to Storage.
  2. Under the empty optical drive, select the NixOS ISO you downloaded.

4. Boot the NixOS Live Environment

Start the VM.
You’ll see a boot menu — choose Graphical Install (or the default).


5. Run the Installer

NixOS will load into a live desktop.

  1. Open the installer from the menu.
  2. Follow the prompts:
    • Select your keyboard layout and timezone.
    • Partition the disk (automatic partitioning works fine in a VM).
    • Choose your desktop environment (GNOME, KDE, Xfce, or none).
    • Create a user account and set the root password.

The installer will generate your /etc/nixos/configuration.nix automatically.


6. Install and Reboot

Click Install. Once done, reboot the VM.
When prompted, remove the ISO from the virtual drive.


7. First Boot

You’ll see the NixOS boot menu.
Log in with your username and password, and you’re ready to explore.


8. Updating NixOS

To update everything to the latest packages:

sudo nixos-rebuild switch --upgrade

Why Try NixOS in a VM?

  • Safe environment to experiment.
  • Learn the Nix configuration system without breaking your main OS.
  • Perfect for testing reproducible dev environments.

Pro Tip: Keep a backup of your /etc/nixos/configuration.nix — it’s your entire system config in one file.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
© 2025 Computer Everywhere
Your Everyday Guide to the Digital World.
Terms of Service | Privacy Policy
Copy link