View previous topic :: View next topic |
Author |
Message |
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Fri Nov 09, 2012 11:24 pm Post subject: Virtualbox |
|
|
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 |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Sat Nov 10, 2012 1:10 am Post subject: |
|
|
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.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Sat Nov 10, 2012 1:15 am Post subject: |
|
|
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 |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sat Nov 10, 2012 2:20 am Post subject: |
|
|
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 |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Sat Nov 10, 2012 2:26 am Post subject: |
|
|
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 |
|
|
Back to top |
|
|
|