chef / bento

Packer templates for building minimal Vagrant baseboxes for multiple platforms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation of Parallels Tools in (particular) Ubuntu VMs fails

mpdude opened this issue ยท comments

Hey there ๐Ÿ‘‹๐Ÿผ,

I am using this Ubuntu Vagrant box with Parallels Desktop.

Upon boot, the vagrant-parallels plugin detects that the version of Parallels Tools installed in the box is outdated and tries to update it.

The problem is that, to my understanding, installation of Parallels Tools needs the linux-headers-5.15.0-67-generic package to be installed. Or, more generally, the version of that package matching the currently running kernel version. However, when the Kernel version included in the box image has since then replaced with a newer version (in the upstream Ubuntu repositories), it seems the matching header files can no longer be installed. They probably came from an Ubuntu security update release channel where the package has been replaced with a newer version since the box was built.

Full details can be found in the issue at Parallels/vagrant-parallels#458.

Suggested enhancement

I think when the Parallels versions of the Ubuntu boxes (and maybe the same is true for other distros as well?) come with a suitable version of linux-headers-... installed, the automatic update of Parallels Tools upon first boot should work.

Maybe installation of the linux-headers-generic meta package would be the best way to approach this.

This needs to happen at box build time, so that we get a snapshot of the header files matching the kernel version used at that time.

Current Alternative

Disable Parallels Tools update in the Vagrantfile for the first boot. Update kernel to the latest version, reboot. Enable Parallels Tools update again, reboot to make the update happen.

Can We Help You Implement This

Sure! If you agree the suggested change makes sense, I'd probably need to update some build script for the Parallels provider?

I'm open to reviewing PR's that would help enhance and fix this issue. You'll probably want to start by looking at https://github.com/chef/bento/blob/main/packer_templates/scripts/_common/parallels.sh.

To my knowledge, the installation as in

/tmp/parallels/install --install-unattended-with-deps \

should install the necessary header files package.

So how come thatโ€™s not present in the resulting box? Or how may it happen that the box ships with another (updated) kernel version?

#1526 is my attempt to fix it, by running an extra script for Parallels on Ubuntu/Debian to re-install the necessary package after cleanup_ubuntu.sh has run.

Looking forward to your review!

completed via #1526