2

I have centos 6.6 installed on virtualbox. In order to use features like copy/paste, being able to share folders, etc, I need to install Guest additions on it.

I've clicked Device -> Insert Guest Additions CD Image and then doing the following:

enter image description here

However, when I try to run ./VBoxLinuxAdditions run I get the errors below. I am pasting screenshots because I'm not able to copy/paste since I don't have guest addition.

Error:

enter image description here

Logs:

enter image description here

The /lib/modules/2.6.32-504.e16.x86_64/build and /lib/modules/2.6.32-504.e16.x86_64/source folders are both present.

enter image description here

When I do yum remove kernel-devel and install it again using yum install kernel-devel this is the version that tries to install. Note that it is 2.6.32-573.18.1.e16

enter image description here

What I've done

Following This answer I did sudo yum install "kernel-devel-uname-r == $(uname -r)" which doesn't work

enter image description here

Omnipresent
  • 289
  • 1
  • 4
  • 10
  • No solution but a question. You*re saying that you downloaded `VBoxGuestAdditions_4.3.14_RC1.iso` and are using this. But in the first screenshot above the version number `5.0.14` is displayed. What is more, it would help if you print the output of `uname -a` (although you already printed this 'indirectly'). – mnille Mar 21 '16 at 10:22
  • Thats a good catch. And honestly I don't know why it is saying `5.0.14`. I mounted `VBoxGuestAdditions_4.3.14_RC1.iso` and thats the only guest additions iso I have on my host. As for the `uname -a` this is what is the output `2.6.32-504.e16.x86_64` – Omnipresent Mar 21 '16 at 10:33

2 Answers2

1

Your ls -al /lib/modules/2.6.32-504.el6.x86_64/ command output indicated that the /lib/modules/2.6.32-504.el6.x86_64/source is actually a symbolic link to the build directory at the same level of the directory tree. Furthermore, the symbolic link is displayed in red, indicating that the link is broken, and the link target display (-> build) has a red background, indicating that the link target does not actually exist.

You also seem to have a newer kernel version 2.6.32-573.18.1.el6.x86_64 installed, but not running yet. Although you will usually have multiple kernel versions installed in parallel, the same does not apply to the kernel-devel package: it normally tracks the newest distribution kernel you have installed.

My guess is that as 2.6.32-573.18.1.el6.x86_64 kernel version was installed, the kernel-devel package also got updated to match it. After a reboot, you would be running that kernel version instead of your current one, and then you could again successfully build third-party kernel modules, like the modules of the VirtualBox Guest Additions.

The answer you linked uses the kernel-devel-uname-r == $(uname -r) syntax which was apparently "a stupid hack" according to Thorsten Leemhuis, and may have become obsolete somewhere between Fedora 19 and Fedora 21.

telcoM
  • 87,318
  • 3
  • 112
  • 232
0

Instead of using an ISO, can you not just install the Guest Additions using the "Devices" tab, on the machine that is running?

Install Guest Additions

Kevdog777
  • 3,194
  • 18
  • 43
  • 64
  • This is what I did. I clicked `Devices -> install Guest Additions CD Image` – Omnipresent Mar 21 '16 at 10:50
  • And did that work for you? :) – Kevdog777 Mar 21 '16 at 10:50
  • No. I'm assuming the steps I'm doing are required after I click `Insert Guest Additions CD Image` – Omnipresent Mar 21 '16 at 10:53
  • 1
    My presumption about the ISO was incorrect. When I click insert Guest additions CD Image. I guess `5.0.14` image gets inserted and then I execute the `./VBoxLinuxAdditions run` command. I've updated the question to reflect this. – Omnipresent Mar 21 '16 at 10:58
  • I have just tried doing it as you said, in your updated question, and it is working for me. So not sure what I have that you don't have. Maybe try restarting the system, and see if that fixes the copy/paste issue? Sorry I can't be of any more assistance :) – Kevdog777 Mar 21 '16 at 11:24
  • You tried 6.6 centos? What did you do after you clicked `install guest additions cd image`? – Omnipresent Mar 21 '16 at 11:27
  • Yeah it is CentOS 6.6 (`26.32-504.12.2.el6.x86_64`). As I have the GUI, I cancelled the AutoRun and mounted the cdrom, as your steps showed, through the Terminal. Then ran it the same way you did `./VBoxLinuxAdditions.run`. – Kevdog777 Mar 21 '16 at 11:36
  • `cat /etc/centos-release` > `CentOS release 6.6 (Final)` – Kevdog777 Mar 21 '16 at 11:38
  • And that installed without any issues? Very surprising. did you have to install gcc, make, perl, etc? Can you please provide a link to the ISO or virtualbox image you used for 6.6. I would be OK using the GUI as well. I'll use the same and try a new VM. I've wasted too much time on this. thanks – Omnipresent Mar 21 '16 at 11:38
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/37278/discussion-between-kevdog777-and-omnipresent). – Kevdog777 Mar 21 '16 at 11:41
  • FWIW, where you mentioned that /lib/modules/2.6.32-504.e16.x86_64/build is present, but where does that symlink point to ? – doktor5000 Mar 22 '16 at 07:48