[Nix-dev] How to install in NixOS in a KVM virtual machine?

Bjørn Forsman bjorn.forsman at gmail.com
Sat Feb 8 12:35:25 CET 2014


On 8 February 2014 12:18, Colin Adams <colinpauladams at gmail.com> wrote:
> I've defined a virtual machine (using virt-manager running on Fedora 18),
> and booted the live-CD iso image on it. Whilst I've many years experience of
> linux, I don't have any experience of KVM, and I'm puzzled as to how to
> follow the installation instructions in this scenario.
>
> The first item mentioned is using fdisk for partitioning. But I'm not at all
> clear what is available to be partitioned in a KVM environment.

You must create a disk file and attach it to your virtual machine machine.

> Then there is the target file system on which NixOS should be installed. I
> guess this should be one of the partitions created using fdisk. But I'm not
> sure if "/dev/dis/by-label/nixos" is to be taken literally, or if there are
> substitutions needed.

It can be taken literally, but requires you to have labelled your disk
partition "nixos". You can do that with

  tune2fs -L nixos /dev/sdaX  # replace X with the partition number

in the virtual machine.

Hope that helps.

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list