netlab icon indicating copy to clipboard operation
netlab copied to clipboard

Create Vagrant boxes in /tmp directory

Open ipspace opened this issue 1 year ago • 0 comments

The easiest way to create Vagrant boxes on Ubuntu 22.04 is to create them in /tmp directory. As we're already copying QCOW image to vm.qcow2, we could copy the disk image to /tmp/x directory, do the box creation there, and then copy the resulting box back to the original directory.

We should also:

  • Check the free space in the filesystem providing the /tmp path (hint: shutil.disk_usage) to ensure we don't do something stupid
  • Use tarfile module to prevent unnecessary copying/renaming of disk images.

ipspace avatar Apr 24 '24 08:04 ipspace