Skip to content
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

Increase Virtualbox disk image size #46649

Merged
merged 1 commit into from Oct 6, 2018
Merged

Conversation

brainrake
Copy link
Contributor

Motivation for this change

10G is not enough for a desktop installation, and resizing a disk image is a pain.
Let's increase the default disk size to 100G. It does not use more storage space.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

10G is not enough for a desktop installation, and resizing a Virtualbox disk image is a pain. 
Let's increase the default disk size to 100G. It does not require more storage space, since the empty bits are left out.
@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 2, 2018

+1 on increasing the default demo VBox disk size!
Maybe 50GB would be enough, but 10G is clearly too small. I just tested the upgrade from 18.03 to 18.09beta in a demo VM and I had to nix-collect-garbage -d and nix-store --optimise to be able to nixos-rebuild in 18.09. And still I was left with 93% used space on / after the upgrade.

@brainrake
Copy link
Contributor Author

There is no drawback for having a larger virtual disk, the on-disk size does not increase noticeably.

@matthewbauer matthewbauer merged commit 751dc01 into NixOS:master Oct 6, 2018
@srhb
Copy link
Contributor

srhb commented Oct 10, 2018

Ah, I missed the ongoing discussion here before filing #48149

It looks like 100GB is indeed untenable with the default timeouts. We can try some changes to the timeouts and a slightly smaller size, but it looks like the increase in time is not linear with the size increase, but way worse.

@srhb
Copy link
Contributor

srhb commented Oct 10, 2018

(I also missed that the purpose was indeed to bump the demo image size, making the PR less ideal, but we do need to unblock the channel asap.)

@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 10, 2018

Reverted to get out of troubles first.

Now: I'm not sure I understood why the build took much longer yet.
But yes the initial goal was to extend the volume of the official demo VM so that users get more free space out of the box.

@brainrake
Copy link
Contributor Author

Well, that's sad. I'll try to reproduce the timing issue, maybe submit another PR.
Thanks!

@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 10, 2018

I wonder if there might be a way to ship a VBox OVA with a native VDI disk... At least it would be easier to extend it afterwards.

@obadz I think I understand the motivation behind commit 80660f8 but what do you think would be the consequences now of converting the raw disk to VDI given that the raw disk is later deleted?

Or to put it in code :

echo "creating VirtualBox pass-through disk wrapper (no copying invovled)..."
VBoxManage convertfromraw $diskImage disk.vdi --format VDI
[...]
rm -v $diskImage

Using the native commands of VBox.

@matthewbauer
Copy link
Member

matthewbauer commented Oct 10, 2018

You can set max-silent-time to reproduce this. For instance:

nix-build -A ova '<nixpkgs/nixos/release.nix>' --option max-silent-time 7200

It actually looks like it is able to make the .vdmk file. It just fails somewhere else down the line. Perhaps there's a verbose option to one of these commands that will solve it?

@obadz
Copy link
Contributor

obadz commented Nov 4, 2018

Is resizing an image really such a pain?

VBoxManage modifyhd X.vdi --resize Y

@c0bw3b
Copy link
Contributor

c0bw3b commented Nov 4, 2018

But we don't use a VDI or VHD image by default and VBox can only resize those.
Since NixOS OVA ships with a raw disk wrapped inside a VMDK container then one would first need to convert the disk... And that is a pain.

But #49317 pushed the VM disk to a max of 50GB without changing anything to the disk format so we found a middle ground solution to this problem.

Thanks for replying, still.

@obadz
Copy link
Contributor

obadz commented Nov 4, 2018

Sounds good. Sorry for delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants