Mic92 / nixos-shell

Spawns lightweight nixos vms in a shell
MIT License
677 stars 39 forks source link

Easiest way to make an ephemeral VM (reboot to restore)? #55

Open PAI5REECHO opened 2 years ago

PAI5REECHO commented 2 years ago

I'd like to be able to launch my VMs to use an in-memory disk or run in some way as to not commit any changes to my real drive

Mic92 commented 2 years ago

Maybe you can use this? https://github.com/nix-community/impermanence

Mic92 commented 2 years ago

Otherwise just delete nixos.qcow2 after each run.

chrissound commented 1 year ago

I'd like to be able to launch my VMs to use an in-memory disk or run in some way as to not commit any changes to my real drive

I think you can just run this from within a directory that is in a tmpfs/ramfs, so the file being written to is literally in ram. Maybe there would still be some overhead from needing to serialize the file though, but still would give you ephemeral functionality + likely fast IO performance.