Installing VBoxAdditions for PhotonOS. Kernel not found

Discussions about using Linux guests in VirtualBox.
Post Reply
VirtualMountain
Posts: 4
Joined: 11. Apr 2019, 13:15

Installing VBoxAdditions for PhotonOS. Kernel not found

Post by VirtualMountain »

Hi

PhotonOS is a minimal Linux distro made by VMware mainly for DevOPS.

But I cannot install VBoxAdditions to the VM because the installer cannot find the kernel headers even though I have installed them

Here is the error:

Code: Select all

root@photon [ /mnt/cdrom ]# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.1.26 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Kernel headers not found for target kernel
4.4.77-1.ph1. Please install them and execute
  /sbin/rcvboxadd setup
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
I have installed the kernel headers via

Code: Select all

tdnf install build-essential
but rcvboxadd cannot find them.

Where is rcvboxadd looking for the kernel headers? What specific file is it looking for?

Thanks
VirtualMountain
Posts: 4
Joined: 11. Apr 2019, 13:15

Re: Installing VBoxAdditions for PhotonOS. Kernel not found

Post by VirtualMountain »

I've just installed the test build 6.0.5 but the problem persists.

The package for the linux headers is called linux-api-headers-4.19.29-1.ph3 and is installed, but the install script can't find them for some reason.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Installing VBoxAdditions for PhotonOS. Kernel not found

Post by andyp73 »

The output from the guest additions installer says that it is looking for headers to go with the kernel 4.4.77-1.ph1. It looks like you may have updated your kernel headers but not the kernel itself.

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
VirtualMountain
Posts: 4
Joined: 11. Apr 2019, 13:15

Re: Installing VBoxAdditions for PhotonOS. Kernel not found

Post by VirtualMountain »

Good spot, but where is the script getting that lower kernel version?

When I do

Code: Select all

uname -r
I get 4.19.29-1.ph3 which is correct. There is no 4.4.77-1.ph1 directory anywhere on the system
Last edited by socratis on 12. Apr 2019, 15:32, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Installing VBoxAdditions for PhotonOS. Kernel not found

Post by andyp73 »

Not sure why you are getting the discrepancy between 4.4.7-1.ph1 and 4.19.29-1.ph3 but with a clean install of PhotonOS using Full ISO x86_64 fails to build the guest additions out of the box.

The build script is looking for the presence of the directory /lib/modules/"$TARGET_VER"/build where TARGET_VER is derived from 'uname -r'. This is normally a softlink to the kernel headers in /usr/src. In order to get the Guest Additions to build I needed to first run:
tdnf install linux-devel
I did need to reboot the guest as it downloaded a new kernel and the corresponding headers (4.19.32-3.ph3).

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
VirtualMountain
Posts: 4
Joined: 11. Apr 2019, 13:15

Re: Installing VBoxAdditions for PhotonOS. Kernel not found

Post by VirtualMountain »

Andy

Thank you very much for finding the missing link (tdnf install linux-devel) and solving the problem.

Best regards

John
Post Reply