-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos-install/nixos-rebuild fails with "Out of memory" on systems with 512MB RAM #85148
Comments
Have you tried using swap? |
@eadwu, fair enough. Documenting the minimum requirements for building a NixOS configuration is still worthwhile IMO. |
Thanks for the detailed description. I agree we should have some documentation on the minimum system requirements for evaluating a normal NixOS config. However there are ways around this. You can actually install NixOS without running a rebuild on the target.
Future rebuilds can be done with |
https://discourse.nixos.org/t/adding-nixos-entry-to-libosinfo-recommended-resources/6441/ somewhat related to system requirements documentation |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
I'm having this issue with 16 gb of ram, probably a bug |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/building-nixos-on-lower-end-systems/51914/1 |
Depends what you're building and what your nix settings are. |
Describe the bug
512MB of RAM seem to be insufficient for a successful NixOS installation via the installer. Bumping the memory size of the VM from the steps to reproduce below ends up in a successful installation, but bringing the memory back down to 512MB renders the VM unable to do
nixos-rebuild switch
(fails witherror: unable to fork: Cannot allocate memory
).Even though 512MB is quite low by today's standards, there are still use cases where you don't really need more than that (e.g., I discovered this while building a VM that will act as a Wireguard VPN endpoint for a couple of boxes doing just routing between them).
I didn't find any requirements in the NixOS Manual regarding the amount of memory needed. I would suggest adding this in the documentation at minimum. (I can try to submit a PR if the project maintainers agree with my suggestion.)
(Apologies if this is a known problem, I couldn't find an existing issue describing it.)
To Reproduce
Steps to reproduce the behavior:
qemu-img create /tmp/nixos.img 8G
qemu-kvm -m 512M -drive file=/tmp/nixos.img -cdrom ~/Downloads/nixos-minimal-19.09.1957.57c35c63004-x86_64-linux.iso
sudo fdisk
sudo mkfs.ext4 /dev/sda1
/mnt
:sudo mount /dev/sda1 /mnt
sudo nixos-generate-config --root /mnt
/mnt/etc/nixos/configuration.nix
uncomment theboot.loader.grub.device
settingsudo nixos-install --root /mnt
Actual behavior
The installation fails with:
Expected behavior
The NixOS installer completes successfully.
Metadata
The text was updated successfully, but these errors were encountered: