# Problems installing virtualbox-guest-additions

## Shimfs

Hi. 

I am rather new to gentoo and have been using it for some days without major problems i couldn't solve myself or through google. However, i have just found one problem i simply cannot find the answer to. 

I am running windows 7 and inside a virtualbox from that, i am running gentoo. So in order to get gfx drivers and the like, i am trying to install: app-emulation/virtualbox-guest-additions. But it won't emerge properly. I have the build.log but i am not sure how to upload it to you guys, since gentoo is running in a console window at the moment. 

help would really be appreciated. And please keep in mind, i am rather new, so please write what commands to use, since i don't know all the commands in gentoo  

EDIT: here is the build.log http://pastebin.com/6qJsXGMG

----------

## Trog Dog

checkout this bug there seems to be a problem with virtualbox 4.1.4 and kernel version 3.2.1 the "workaround" is to unmask and emerge virtualbox 4.1.8

```
emerge =app-emulation/virtualbox-4.1.8 --autounmask-write

etc-update

emerge =app-emulation/virtualbox-4.1.8
```

----------

## Shimfs

Thank you for your answer. I will check it out as soon as i get home.

----------

## Shimfs

I have spotted an error.

You want me to emerge virtualbox.

I am trying to emerge the virtualbox-Guest-Additions.

My main computer (windows7) IS already running virtualbox. I want the virtualbox guest drivers on the guest system (gentoo)

So i assume your solution doesn't work? i have however just installed virtualbox, and am going to try and install the guest additions afterwards, to see if it had any effect.

trying to install virtualbox it comes up with an error. it says i have to add the following to my kernel modules:

vboxdrv 

vboxnetflt 

vboxnetadp

that means i have to go to /etc/conf.d/modules and somwhere in the document add 

modules="vboxdrv"

modules="vboxnetflt"

modules="vboxnetadp"

(in the documentation it says: modules_<kernelversion>="xxxx", in my case, my kernel is just called core in the boot directory. So do i say boot there, or the actual version of my core?)

and then i can just emerge again? or do i have to do something special afterwards?

----------

## Pandaman

Ignore that error, those modules are for running virtualbox, not the guest extensions.  Instead try (as root):

```
echo "app-emulation/virtualbox-guest-additions" >> /etc/portage/package.accept_keywords && emerge app-emulation/virtualbox-guest-additions
```

Last edited by Pandaman on Tue Jan 31, 2012 4:17 am; edited 1 time in total

----------

## Shimfs

Im trying that as we speak. Just to clarify.

What you are asking me to do is: Taking the output (echo) from the emerge. (package name i assume) and adding that to package.use, and then trying to emerge the actual program right?

----------

## Shimfs

Pandaman i have a small problem. After i ran a --depclean (to remove the packages from the virtualbox try suggested earlier) i have run out of space on my box.

And i can see i have 309 files in my /usr/portage/distfiles.

Do i really need those files? can't i just clear it out? or what can i do to improve the space. I have given this virtualbox 8gb of harddisk space

----------

## Pandaman

 *Shimfs wrote:*   

> Im trying that as we speak. Just to clarify.
> 
> What you are asking me to do is: Taking the output (echo) from the emerge. (package name i assume) and adding that to package.use, and then trying to emerge the actual program right?

 

Not quite

```
echo "app-emulation/virtualbox-guest-additions" >> /etc/portage/package.accept_keywords
```

Will print the line "app-emulation/virtualbox-guest-additions" (without quotes) and append it to the file located at /etc/portage/package.accept_keywords.  The next part will emerge the guest additions.  Because we added that line to package.accept_keywords, emerge will use the 4.1.8 version of the guest additions.

 *Shimfs wrote:*   

> Pandaman i have a small problem. After i ran a --depclean (to remove the packages from the virtualbox try suggested earlier) i have run out of space on my box.
> 
> And i can see i have 309 files in my /usr/portage/distfiles.
> 
> Do i really need those files? can't i just clear it out? or what can i do to improve the space. I have given this virtualbox 8gb of harddisk space

 

Eh, I don't know if I'm experienced enough to actually tell others to wipe that folder.... but I've done it before on my laptop to free up space  :Razz:   That's where portage is storing the downloaded files, so if you wipe that folder it will have to redownload the files used in the packages that it's trying to emerge.  

Did you unmerge virtualbox first?  Depclean won't remove it or it's dependencies as it's listed in world.

```
emerge --unmerge app-emulation/virtualbox
```

I don't know what all you've installed so far, but from the sounds of things, not much.  So that's kind of strange though that it's already out of space, even on an 8GB drive.Last edited by Pandaman on Tue Jan 31, 2012 4:18 am; edited 2 times in total

----------

## Shimfs

hmm, it might be because i got 2gb reserved for my swap drive.

I am currently toying with gparted to copy the virtualdrive over to a new virtualdrive with 30gb of space so i avoid this issue. and then i can clear up any thing when i am done with the most basic stuff.

I will return in a little while with the results of your suggested fix, once i have enough hdd space

----------

## Shimfs

i have screwed something up. It can't fetch anything during emerge at the moment. it says:

Unable to resolve host address, no matter the package i try to emerge.

it goes through my list of hosts i have specified during install. So it knows  what to use. And i can ssh into the box. So it has internet connection. But its dns is down. Any idea as to what has happened and how to get it up again

EDIT: okay something major has screwed up. Atleast i got a clone of my harddrive. just a little bit of a setback. But i will go to that instead.

----------

## Pandaman

Check the file "/etc/resolv.conf" and see what it's using for it's DNS server.  It should have a line

```
nameserver *.*.*.*
```

Where *.*.*.* is the address to your DNS server.  If there isn't a line there for the nameserver, or it is commented out, just add a new one.  If all else fails, delete everything there and make the nameserver 8.8.8.8 or 208.67.222.222 (google's and openDNS' namerservers, respectively).

----------

## Shimfs

nah, somehow nano also got screwed up in the process. i just moved over to the security clone i had.

I have tried your solution about echo and then emerge. It didn't work :-/

got any other ideas?

----------

## Pandaman

I'll have to get back to you in a few hours (at work, can't connect to pastebin).  Have you tried installing the guest additions from the Virtualbox CD?

----------

## Shimfs

No, the drivers on the CD is a bit old as far as i can tell. Besides, they are in a .run file format which i shamefully must admit, i have no idea how to interact with.

And its okay. I will reply when i wake up then. Going to be in a few hours.

----------

## Pandaman

It's not hard, and as long as you have the latest version of virtualbox, you should have the latest version of the driver CD.  The easiest way (READ:  Way I would do it) to do it would be to copy the file to /root, make it executable then run it.

(as root)

```
cp /PATH/TO/CDROM/VBoxLinuxAdditions.run ~

chmod +x VBoxLinuxAdditions.run

./VBoxLinuxAdditions.run
```

You could probably just do

```
sh /PATH/TO/CDROM/VBoxLinuxAdditions.run
```

----------

## Shimfs

i think that worked...

It showed some warning signs after the following lines

Removing existing VirtualBox DKMS kernel modules [!!]

and

Removing eksisting Virtualbox non-DKMS Kernel Modules [!!]

and then it continued and everything after that was [ OK ] so i assume that did it.

Still, i wonder whats wrong with the portage version

----------

## Pandaman

Not sure, I'm still at work so I can't look at the error log.  You may wish to submit a bug report:  https://bugs.gentoo.org/

Be sure to link to this thread if you do.  So does everything appear to be working as intended?

EDIT - By the way, I made a mistake earlier.  Remove the line "app-emulation/virtualbox-guest-additions" from "/etc/portage/package.use" and add it to "/etc/portage/package.accept_keywords" instead.  That would probably resolve the issue you were having.  I edited my earlier posts.  -_-*

----------

