NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.06k stars 14.04k forks source link

VirtualBoxOVA does not work for more than 64gb baseImageSize #59867

Open dfordivam opened 5 years ago

dfordivam commented 5 years ago

Issue description

The standard way to create a nixos virtual box .ova files (config.system.build.virtualBoxOVA) does not work if the baseImageSize is more than 64gb.

Steps to reproduce

Specify baseImageSize more than 64gb

virtualbox = {
    baseImageSize = 65 * 1024; # in MiB
}

Technical details

The VM creation hangs with this output

[ 3.565686] This architecture does not have kernel memory protection. 
[ 3.595800] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: 
[ 6.028488] random: crng init done

This is the strace from cptofs which does 100% cpu usage and does not finish.

timer_settime(0, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=0, tv_nsec=9839123}}, NULL) = 0
timer_settime(0, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=0, tv_nsec=9764387}}, NULL) = 0

Please run nix-shell -p nix-info --run "nix-info -m" and paste the results.

matthewbauer commented 5 years ago

This was encountered in #49317 as well.

dfordivam commented 5 years ago

@matthewbauer I have this workaround #60246 to add an extra disk.

matthewbauer commented 5 years ago

Does the extra disk not hit the 64gb limit?

dfordivam commented 5 years ago

No, the limit is only because of the bug in cptofs, and I do not use this tool. The extra disk is empty with only a filesystem.

flokli commented 5 years ago

@dfordivam could you open a bug upstream about cptofs being broken with images > 64GB? I doubt that's a nix-specific thing…

ambrop72 commented 5 years ago

Why is cptofs being used here (specifically in make-disk-image)? It's anyway running in runInLinuxVM so couldn't we just mount the filesystem and cp?

ambrop72 commented 5 years ago

Oh I see cptofs is part of preVM which is done before the VM is started. But couldn't it be avoided by sharing $root via 9P and copying the contents inside the VM?

matthewbauer commented 5 years ago

Maybe, but cptofs shouldn’t have a 64G limit, right?

flokli commented 5 years ago

cptofs shouldn't just burn CPU when working on >64G volumes, so we definitely should open a bug about that upstream.

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
evanjs commented 4 years ago

This is definitely important to me. Trying to encode sensible defaults into virtual appliances we plan on provisioning, and would love to see this fixed vs implementing more hacky workarounds than we already have regarding ESXi compatibility...

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

evanjs commented 3 years ago

Still important though I’m not sure it makes sense to have this issue open if we’re just waiting on https://github.com/lkl/linux/issues/466.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

evanjs commented 3 years ago

Still quite important, but blocked on upstream