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

Failed to install Parallels Tools on first boot with Bento Ubuntu 22.04 image #458

Closed
mpdude opened this issue Aug 25, 2023 · 3 comments
Closed

Comments

@mpdude
Copy link

mpdude commented Aug 25, 2023

Hey there,

I have a problem to bring up a box with the following Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-22.04"
  config.vm.box_version = "202303.13.0"
  config.vm.provider "parallels" do |prl|
    prl.update_guest_tools = true
  end
end

The box_version is given for stability/reproducibility. It's this one.

Here is the abbreviated result from vagrant up:

Bringing machine 'default' up with 'parallels' provider...
==> default: Registering VM image from the base box 'bento/ubuntu-22.04'...
...
==> default: Checking if box 'bento/ubuntu-22.04' version '202303.13.0' is up to date...
...
==> default: Machine booted and ready!
==> default: Checking for Parallels Tools installed on the VM...
==> default: Parallels Tools installed on this VM are outdated! In most cases
==> default: this is fine but in rare cases it can cause things such as shared
==> default: folders to not work properly. If you see shared folder errors,
==> default: please update Parallels Tools within the virtual machine and
==> default: reload your VM.
==> default: Installing the proper version of Parallels Tools. This may take a few minutes...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ptiagent-cmd --install

Stdout from the command:

ptiagent-cmd progress 3
ptiagent-cmd progress 15
Started installation of Parallels Guest Tools version '19.0.0.54570'
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
[... lots of usual apt-get update / apt-get install output ...]
E: Package 'linux-headers-5.15.0-67-generic' has no installation candidate
m linux-headers-5.15.0-67-generic
o dkms
o libelf-dev
Error: failed to install mandatory packages.
Error: failed to install or upgrade Parallels Guest Tools!


Stderr from the command:

This is the kernel currently running in the VM:

vagrant@vagrant:~$ uname -a
Linux vagrant 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Also, a manual install attempt fails:

vagrant@vagrant:~$ sudo /mnt/install --install-unattended-with-deps --verbose
Started installation of Parallels Guest Tools version '19.0.0.54570'
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists...
Return code from apt-get update is 0
E: Package 'linux-headers-5.15.0-67-generic' has no installation candidate
m linux-headers-5.15.0-67-generic
o dkms
o libelf-dev
Error: failed to install mandatory packages.
Error: failed to install or upgrade Parallels Guest Tools!

My guess is that this base image was built with a kernel version that is not the one of the original Ubuntu 22.04 distribution, but rather from an intermediate (security?) update. However, the linux-headers package is no longer available in a matching version. I don't know for sure, but maybe the Ubuntu "security" APT repositories provide only current versions of updated packages?

When I run a full apt-get -y dist-upgrade, the 5.15.0-79-generic kernel version will be installed, the current security version as of today. And upon vagrant reload, the installation of Parallels Tools will proceed.

The problem is that there is no clean vagrant up way of bringing up this box: Before installing Parallels Tools, we'd need to install the latest updated kernel package and reboot – and that would be necessary as part of the initial bootstrap process.

Is there anything we can do about this from the vagrant-parallels side of things?

Is this something that needs to be addressed by the box providers, e. g. bento? Would they need to provide a base image with a (possibly very outdated) kernel version that always has a linux-headers version available?

@mpdude
Copy link
Author

mpdude commented Aug 25, 2023

When I set prl.update_guest_tools = off, the inital boot works. But, as soon as the updated kernel gets installed, the next reboot will be stuck since the prl_fs filesystem type is unknown (no matching kernel module for new kernel version?). I cannot even use a provisioning script to re-build the tools, since the boot process aborts before that is run.

When I set prl.update_guest_tools = on, the initial boot fails since there is no linux-headers package matching the kernel version used by the base image.

@cjlapao
Copy link
Contributor

cjlapao commented Aug 29, 2023

@mpdude This image seems to be running a very old version of the QEMU hypervisor, you could try to build your own vagrant box using this packer recipe found here https://github.com/Parallels/packer-examples/tree/main

We are in the process of creating our own vagrant images in VagrantCould, meanwhile, you can also join our Discord Server to discuss any doubts or check when this will be released

mpdude added a commit to mpdude/bento that referenced this issue Sep 6, 2023
When using [this Ubuntu Vagrant box](https://app.vagrantup.com/bento/boxes/ubuntu-22.04/versions/202303.13.0) with Parallels Desktop, the `vagrant-parallels` plugin upon boot detects  that the version of Parallels Tools installed in the box is outdated and tries to update it.

The problem is that a due re-compilation of Parallels Tools depends on `linux-headers-5.15.0-67-generic`, with the package name/version matching the version of the currently running kernel.

However, the Kernel version included in the box image has since then replaced with a newer version (in the upstream Ubuntu repositories), and 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.

By keeping the `linux-headers-*` package during/after installation, also a freshly booted box should be able to perform the update. The package is, in fact, installed automatically when Parallels Tools are added, but after that is is removed by the `cleanup_ubuntu.sh` script.
mpdude added a commit to mpdude/bento that referenced this issue Sep 6, 2023
When using [this Ubuntu Vagrant box](https://app.vagrantup.com/bento/boxes/ubuntu-22.04/versions/202303.13.0) with Parallels Desktop, the `vagrant-parallels` plugin upon boot detects  that the version of Parallels Tools installed in the box is outdated and tries to update it.

The problem is that a due re-compilation of Parallels Tools depends on `linux-headers-5.15.0-67-generic`, with the package name/version matching the version of the currently running kernel.

However, the Kernel version included in the box image has since then replaced with a newer version (in the upstream Ubuntu repositories), and 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.

By keeping the `linux-headers-*` package during/after installation, also a freshly booted box should be able to perform the update. The package is, in fact, installed automatically when Parallels Tools are added, but after that is is removed by the `cleanup_ubuntu.sh` script.

Signed-off-by: Matthias Pigulla <mp@webfactory.de>
@mpdude
Copy link
Author

mpdude commented Sep 9, 2023

Fixed in chef/bento#1526

@mpdude mpdude closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants