Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Virtualbox
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 204
Location: Philadelphia

PostPosted: Fri Nov 09, 2012 11:24 pm    Post subject: Virtualbox Reply with quote

I installed virtualbox recently, works fine but I have to load three modules before I start it.
I know I could
1. Use rc-update to make them start on boot.
2. make a script to start the modules first (leaning towards this one)

However I am curious of there is a better way to do it. I do not want them to stay in memory when I'm not running VBox. Is there an option with rc-update, or something else to only load them at runtime, and then unload them when the program terminates.
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1479

PostPosted: Sat Nov 10, 2012 1:10 am    Post subject: Reply with quote

Use a script:

this will not work from a menue as sudo requires you to input your password

Code:
#!/bin/bash
# load vbox moduals
sudo modprobe <1>
sudo modprobe <2>
sudo modprobe <3>

# start virtual box
/usr/bin/virtualbox


# clean up
sudo rmmod <1>
sudo rmmod <2>
sudo rmmod <3>


replace the path to virtualbox with the real one, I think that is right but I can't check it. Also replace <1> etc. with the module names.

If launching the script from the menu is important, then you will need to modify the script to use kdesu or gtksu.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sat Nov 10, 2012 1:15 am    Post subject: Reply with quote

Why wouldn't you just list the modules in /etc/conf.d/modules ? Then they get loaded at the boot runlevel, and will be there whenever you start up VirtualBox.

This is just the recommendation in the VirtualBox ebuild.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 204
Location: Philadelphia

PostPosted: Sat Nov 10, 2012 2:20 am    Post subject: Reply with quote

Hypnos wrote:
Why wouldn't you just list the modules in /etc/conf.d/modules ? Then they get loaded at the boot runlevel, and will be there whenever you start up VirtualBox.

This is just the recommendation in the VirtualBox ebuild.


I don't doubt it but I like to keep a slim build. My is really fast and I'd rather not slow it down with excess modules. The VBox modules alone occupy nearly three times as much as all my other modules put together.

If nothing else, I guess I'll go with a script. I was hoping there was something already implemented to streamline this.
.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1155

PostPosted: Sat Nov 10, 2012 2:26 am    Post subject: Reply with quote

Hypnos wrote:
Why wouldn't you just list the modules in /etc/conf.d/modules ? Then they get loaded at the boot
Does not work using init systemd. But I guess this would work (not tried):
/usr/lib/modules-load.d

But we have often heard the years: Sometimes virtualbox modules do have bad quality!
If you have problems with your system, it would be preferable to not have loaded these modules:
You can deny your problems spur from these modules.

As virtualbox is setting up his own group and it is suggested to add a using account to this group, why not add in /etc/sudoers:
Code:
%vboxusers ALL=(ALL) NOPASSWD: /usr/local/sbin/vboxmodules
where these modules are loaded without password when:
sudo /usr/local/sbin/vboxmodules
Code:
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
#PATH: hasn't sudo problems with environment sometimes?
modprobe vboxdrv
modprobe vboxpci
modprobe vboxnetadp
modprobe vboxnetflt

_________________
fun2gen2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum