[Nix-dev] VirtualBox won't start VMs after kernel update

phreedom at yandex.ru phreedom at yandex.ru
Wed Apr 22 01:09:43 CEST 2015


On Tuesday, April 21, 2015 22:30:54 Matthias Beyer wrote:
> (@ phreedom: You forgot to CC the list, so I re-send with inline
> reply, so others can see your message text as well):
> 
> On 21-04-2015 22:19:07, phreedom at yandex.ru wrote:
> > On Tuesday, April 21, 2015 17:39:58 Matthias Beyer wrote:
> > > I did a kernel update recently. I run 3.18.7 now. I just re-installed
> > > VirtualBox in my User Env (I had to build it, actually - why?) with
> > > 
> > >     `nix-env -i virtualbox -j 8 --cores 8`
> > > 
> > > but I still cannot start my VM. It tells me to
> > > 
> > >     `/etc/init.d/vboxdrv setup`
> > > 
> > > but of course, this is not possible :-)
> > > 
> > > What do I do?
> > 
> > I'm very surprised that it ever worked like this. VirtualBox needs kernel
> > modules installed and you can't install them via nix-env at all.
> 
> I have services.virtualbox.enable = true; in my configuration.nix, so
> this should pull the configuration you listed below into my
> configuration as well, shouldn't it?
> 
> > boot.extraModulePackages = [ config.boot.kernelPackages.virtualbox ];
> > environment.systemPackages = [ config.boot.kernelPackages.virtualbox ];
> 
> I see my problem now, as I installed virtualbox again as a user, which
> cannot work, of course, as the kernel needs to be modified. Put then,
> I wonder why my kernel update did not pull a new virtualbox into my
> machine setup?
> 
> > You need to load modules: vboxdrv, vboxnetadp, vboxnetflt
> > And make sure the user you run as has access to /dev/vbox* devices.
> 
> Shouldn't Nix keep track of these points automatically?

I didn't notice someone already made a nice module for virtualbox, but it's 
called services.virtualboxHost, and enabling it does seem to make everything 
just work, so uninstalling virtualbox via nix-env is what you need to use the 
virtualbox installed via configuration.nix


More information about the nix-dev mailing list