Bug 238226 - Vagrant images: Bootstrap not working / The disk is not being resized
Summary: Vagrant images: Bootstrap not working / The disk is not being resized
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-virtualization (Nobody)
Depends on:
Reported: 2019-05-29 22:56 UTC by Danilo G. Baio
Modified: 2019-06-06 19:17 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Danilo G. Baio freebsd_committer 2019-05-29 22:56:11 UTC

Bootstrap is not working anymore, at least in Vagrant virtualbox 12.0-STABLE and 13-CURRENT.

This started happening after base r346959 (Reduce the default image size for virtual machine disk images from 30GB to 3GB...)

vagrant@freebsd:~ % uname -UK
 	1200510 1200510
vagrant@freebsd:~ % df -h
	Filesystem         Size    Used   Avail Capacity  Mounted on
	/dev/gpt/rootfs    2.9G    2.6G     35M    99%    /
	devfs              1.0K    1.0K      0B   100%    /dev

root@freebsd:~ # pkg info
	The package management tool is not yet installed on your system.
	Do you want to fetch and install it now? [y/N]: N

# pkg bootstrap -y
	Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, please wait...
	Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
	Installing pkg-1.10.5_5...
	Extracting pkg-1.10.5_5: 100%

# pkg install -y firstboot-freebsd-update firstboot-pkgs sudo rsync virtualbox-ose-additions-nox11
	Updating FreeBSD repository catalogue...
	FreeBSD repository is up to date.
	All repositories are up to date.
	The following 8 package(s) will be affected (of 0 checked):

	New packages to be INSTALLED:
		firstboot-freebsd-update: 1.2
		firstboot-pkgs: 1.5
		sudo: 1.8.27_1
		rsync: 3.1.3
		virtualbox-ose-additions-nox11: 5.2.30
		indexinfo: 0.3.1
		libiconv: 1.14_11

	Number of packages to be installed: 8

	The process will require 10 MiB more space.
	2 MiB to be downloaded.
	pkg: Not enough space in /var/cache/pkg, needed 2239 KiB available -29 MiB

root@freebsd:~ # df -h
	Filesystem         Size    Used   Avail Capacity  Mounted on
	/dev/gpt/rootfs    2.9G    2.7G    -29M   101%    /
	devfs              1.0K    1.0K      0B   100%    /dev

root@freebsd:~ # cat /etc/rc.conf
	firstboot_pkgs_list="sudo rsync virtualbox-ose-additions-nox11"

There is no growfs_enable in it, probably that is the issue as pointed out in #232313#c30 .

I am resizing the disk through Vagrantfile.

Comment 1 Glen Barber freebsd_committer 2019-05-30 17:01:45 UTC
This should be fixed (both the default size, and the lack of growfs_enable in rc.conf) in r348439.

Thank you for the report.
Comment 2 commit-hook freebsd_committer 2019-05-30 17:01:56 UTC
A commit references this bug:

Author: gjb
Date: Thu May 30 17:00:57 UTC 2019
New revision: 348439
URL: https://svnweb.freebsd.org/changeset/base/348439

  Increase the size of the Vagrant default image size, as the 3GB
  size is too small to bootstrap the firstboot_pkgs list.

  While here, add the growfs(8) startup script to /etc/rc.conf,
  as Vagrant images can be resized by modifying the Vagrantfile.

  Reported by:	dbaio
  PR:		238226
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Comment 3 Danilo G. Baio freebsd_committer 2019-06-03 01:33:26 UTC
Hi Glen.

I confirm that the bootstrap and growfs are working fine now in 13.0-CURRENT v2019.05.31 image.

Thank you!
Comment 4 Glen Barber freebsd_committer 2019-06-06 19:17:36 UTC
Thank you for the report.  r348439 is now merged to stable/12 and stable/11.