Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple VM template

This repository defines a simple (minimal) Linux VM built with Nix and ran via just commands with qemu.

Features

  • Nix-based build: the image.nix contains the definition of the guest.
  • Overlays: the directory containing this README is overlayed into the /root/[here] in the guest using 9pfs.
  • Shared nix store: the host nix store is overlayed in the guest.

How to use

  1. Enter dev shell with nix develop

  2. Modify nix/image.nix to fit your use case. Especially you may add packages in environment.systemPackages. To change the Linux version in the guest, adapt the kernelPackages variable in the flake.nix file

  3. Build the image with just vm-image-init

  4. Launch the VM with just vm [nb_cpu] [size_mem] where nb_cpu is the number of vcpus given to the VM and size_mem is the memory dedicated to the VM (can be any string valid for qemu: 1024, 2G, etc..)

  5. (Optional) To connect to the VM from another terminal, use just ssh [command].

About

Template to build and run VMs using Nix, Qemu and Just

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages