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. Apr 13, 2017 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, 2017 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. Jun 9, 2019 at 21:01

1 Answer 1


Windows Subsystem for Linux 1 (WSL 1) is just a compatibility layer for running Linux binary executables on Windows. It does not provide much more 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 inside WSL 1.

Update for WSL 2

Since the time the original answer was written WSL 2 came into existence. The architecture of WSL 2 is very different. It runs full Linux kernel inside a Hyper-V virtual machine. Unfortunately as of today (2022-01) runlevels are still not supported in the default WSL Ubuntu 20.04.

On Windows 11 nested virtualization (running hypervisor like KVM inside WSL 2) is supported both on Intel and AMD CPUs since WSL build 20175. Maybe with some tweaking it could be possible to run VirtualBox inside WSL 2. It seems this combination is officially supported neither by Oracle nor by Microsoft.

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.