Virtualbox - modprobe: ERROR: could not insert 'vboxsf': No such device

 - system: `"x86_64-linux"` 
 - host os: `Linux 5.15.43, NixOS, 22.05 (Quokka), 22.05.866.1f8d88087a3` 
 - multi-user?: `yes` 
 - sandbox: `yes` 
 - version: `nix-env (Nix) 2.8.1` 
 - channels(root): `"home-manager-22.05.tar.gz, nixos-22.05"` 
 - channels(usera): `""` 
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

{

    virtualisation = {
        virtualbox = { 
        host  = {
            enable = true ;
            enableExtensionPack = true ;
            } ;
        guest.enable = true ;
        } ;
    };
}

[ 0.670681] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] modprobe: ERROR: could not insert 'vboxsf': No such device


I can find modprobe vboxsf breaks boot · Issue #58127 · NixOS/nixpkgs · GitHub
is

 boot.kernelPatches = [
    {
      name = "vbox-virt-conflict-config";
      patch = null;
      extraConfig = ''
        VBOXGUEST n
      '';
    }
  ];

still the (best) solution?

I do think your error is related to modprobe vboxsf breaks boot · Issue #58127 · NixOS/nixpkgs · GitHub all. Are there any messages in the log before the vboxsf line?

here the lines before the error msg (or do you mean filtered to vbox?)


42825-[    0.581797] zswap: loaded using pool lzo/zbud
42874-[    0.582195] Key type ._fscrypt registered
42919-[    0.582196] Key type .fscrypt registered
42963-[    0.582196] Key type fscrypt-provisioning registered
43019-[    0.582772] Freeing unused kernel image (initmem) memory: 1768K
43086-[    0.591931] Write protecting the kernel read-only data: 22528k
43152-[    0.592300] Freeing unused kernel image (text/rodata gap) memory: 2040K
43227-[    0.592430] Freeing unused kernel image (rodata/data gap) memory: 880K
43301-[    0.592433] Run /init as init process
43342-[    0.592433]   with arguments:
43375-[    0.592434]     /init
43400-[    0.592434]   with environment:
43435-[    0.592435]     HOME=/
43461-[    0.592435]     TERM=linux
43491-[    0.592435]     BOOT_IMAGE=(hd1,gpt1)//kernels/as6k49h3a5w3wzxa6mkfygqiwkk75zs8-linux-5.15.43-bzImage
43596-[    0.603552] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] loading module dm-snapshot...
43686-[    0.614895] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.com
43782-[    0.618831] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] loading module vboxsf...
43867-[    0.656025] vboxguest: loading out-of-tree module taints kernel.
43935-[    0.657715] vboxguest: PCI device not found, probably running on physical hardware.
44022:[    0.670681] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] modprobe: ERROR: could not insert 'vboxsf': No such device
44141-[    0.671091] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] loading module dm_mod...
44226-[    0.671615] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] running udev...
44302-[    0.676389] stage-1-init: [Fri Jun 17 05:24:40 UTC 2022] Starting version 250.4
44385-[    0.703849] rtc_cmos rtc_cmos: RTC can wake from S4
44440-[    0.704992] rtc_cmos rtc_cmos: registered as rtc0
44493-[    0.705003] rtc_cmos rtc_cmos: alarms up to one month, y3k, 114 bytes nvram, hpet irqs
44583-[    0.705118] cryptd: max_cpu_qlen set to 1000

[looks like] vbox is making the boot significantly longer and get Xserver to stop working → tty1 (taking it out of the config and UI is “fine”)

I reproduce too on kernel 6.1.87, despite the commits referenced in the linked issue being merged.

I tested the workaround of boot.kernelPatches, but it didn’t fix it (but it did trigger a full rebuild of the linux kernel).