On 30 September 2019,  Ubuntu updated the virtualbox-ext-pack package to no longer auto-accept the EULA in order to align with legal requirements and their desire to be very clear about non-open-source software installed through their repositories.

Reference: https://bugs.launchpad.net/ubuntu/+source/virtualbox-ext-pack/+bug/1844654

As such, attempting to install this package via apt-get required user interaction and is therefore not well suited to automation scripts or tools such as Chef.

Here is a workaround.

When you accept the license, the following debconf selection is made.

sudo debconf-get-selections | grep virtualbox
virtualbox-ext-pack     virtualbox-ext-pack/license     boolean true

So, if you set this selection prior to install, then you can go on with your day automating the heck out of things.

# Install debconf-utils if it is not already installed
apt-get install debconf-utils

# Set the debconf selection
echo virtualbox-ext-pack virtualbox-ext-pack/license select true | debconf-set-selections

# Install virutalbox-ext-pack
apt-get install virtualbox-ext-pack -y