Many apt-get installs are failing b/c the system can't determine current runlevel

Background specs:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial
$ uname -a
Linux systemName 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux


I am trying to install virtualbox on WSL and I got the following error:

$ VBoxManage --version
WARNING: The character device /dev/vboxdrv does not exist.
         Please install the virtualbox-dkms package and the appropriate
         headers, most likely linux-headers-Microsoft.

I solved this by following these steps. To dpkg-reconfigure virtualbox-dkms.

But then I got the following:

dpkg: warning: version '*-*' has bad syntax: version number does not start with digit
It is likely that 4.4.0-43-Microsoft belongs to a chroot's host
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
invoke-rc.d: could not determine current runlevel

How can get the invoke-rc.d to return the correct runlevel?

  • 5
    This doesn’t answer your question about the runlevels, but I strongly doubt you’ll manage to load the VirtualBox Linux kernel module on Windows! You’ll probably have to use the Windows version of VirtualBox rather than the Linux one. – Stephen Kitt Apr 13 '17 at 16:19
  • I can confirm the same issues. But running a simulated VirtualBox Ubuntu (in my case) on Ubuntu on Windows, seems to be one inception too much^^ It should be possible to make the virtualbox/vagrant binaries available in bash, I guess. – Armin Jul 22 '17 at 10:17
  • Recently Microsoft introduced WSL2 which runs a complete Linux kernel in a Hyper-V virtual machine. Unfortunately Hyper-V supports nested virtualization only to run Hyper-V inside it so at this moment it is completely uncertain if there will be any efforts to support running other hypervisors inside the WSL2 environment. – pabouk Jun 9 at 21:01

Windows Subsystem for Linux (WSL) is just a compatibility layer for running Linux binary executables on Windows. It does provide almost no functionality beyond that. Especially in your case you encountered two unsupported components / functions:


WSL does not run as a separate instance of an operating system so there is no simple way of supporting bootstrap and service managing systems like init or systemd as they are present on real Linux systems. Consequently today (2019-02) Ubuntu for WSL still does not support runlevels.

Linux kernel

This is the fundamental limitation in your case. VirtualBox as a hypervisor needs to integrate with the operating system's kernel (using kernel modules). WSL is just a compatibility layer. There is no real Linux running (no Linux kernel). Consequently VirtualBox cannot compile its kernel modules for WSL.

If you want to run VirtualBox on a Windows machine, install the Windows version. You cannot run the Linux version in WSL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.