As part of the Windows Subsystem for Linux (WSL), users can experience the WSL Error code: wsl/service/createinstance/createvm/e_invalidarg. This error occurs when the WSL receives an invalid argument (e_invalidarg) when creating a new Linux virtual machine instance (createinstance/createvm).
Users can troubleshoot the errors by resetting, uninstalling and reinstalling the subsystem. This article details the steps to resolve the error.
How does the Windows Subsystem for Linux (WSL) work?
Using a Windows Subsystem for Linux (WSL), users can run both Windows and Linux on a Windows computer without needing a dual-booting system or a full virtual machine (VM).
With the WSL installed, users can run a Linux command-line tools like BASH and Linux GUI apps like GIMP, VLC, and Nautilus, and utilise a Linux file system, on their Windows computer while maintaining access to Windows apps. WSL is especially useful for developers who want to run a Linux environment on a Windows machine.
Also read: How to install Ubuntu on Windows?
Possible causes for the e_invalidarg error
The wsl/service/createinstance/createvm/e_invalidarg occurs when the WSL runs into an invalid argument when creating a new instance for a virtual machine. Once you identify the exact cause of the error, it might be easier to narrow down its fix. Here are some specific reasons for the error occurrence:
Outdated Windows OS version
Ensure that the installed WSL version is compatible with the Windows version on your computer. If you are using Windows 10, it needs to be of the correct version and build to successfully run WSL 2, which is the updated version of WSL with more capabilities.
To check your current Windows version, type Win+R to open Run. Type winver and tap OK. You will then see your Windows version and OS build in a dialogue box.
Disabled virtualisation parameters
WSL requires virtualisation parameters to be enabled on your computer to run without error. If your system doesn’t have virtualisation enabled in BIOS/UEFI, firmware interfaces used to configure hardware and to start the operating system, you might encounter an error when running WSL.
Additionally, users must enable the virtualisation software called Hypervisor or Hyper-V and Virtual Machine Platform from the Windows Features tab in the Control Panel.
Incorrect WSL configuration
If your WSL is incorrectly configured, this could cause the error. The issue can be fixed by reinstalling WSL or resetting the WSL distro through command prompts.
Lack of processing power
Ensure that your computer has enough resources to run WSL. WSL requires resources like RAM, CPU and memory when it is running. However, WSL 2 uses a dedicated, lightweight virtual machine with assigned CPU and memory. WSL requires x64 and Arm CPUs to run.
Also read: Wslregisterdistribution failed with error 0x800701bc: Quick Fix
Steps to fix Error code: wsl/service/createinstance/createvm/e_invalidarg
Check whether the system specifications are compatible with the WSL version you are trying to install and run. Next, check that all parameters required for the virtualisation to perform correctly are installed and enabled. Lastly, update the WSL or reinstall to try and resolve any configuration issues with the the WSL feature. Browse the sections below for detailed steps.
Update Windows OS
Check if your Windows version is compatible with the WSL version installed on your computer. WSL 2 requires the following specs to run:
- Windows 10 – Version 1903 or later, with Build 18362.1049 or higher for x64 systems. Version 2004 or later, with Build 19041 or higher for ARM64 systems.
- Windows 11 – 18362 build or higher.
You must upgrade your Windows version to the above-given specs to run WSL2.
Update the latest Windows 10 version
Download the latest Windows 11 version
Enable virtualisation in BIOS/UEFI
The method to access BIOS on your computer varies from manufacturer to manufacturer.
- Step 1: Restart your computer and enter BIOS/UEFI settings.
- Step 2: Locate CPU Configuration settings in the menu (terminology might vary for different systems) where you can locate Virtualization Technology.
- Step 3: Enable the setting since it is disabled by default and reboot your system.
View our detailed guide on how to enable virtualisation in the BIOS
Enable virtualization in Windows Features
Step 1: Type Control Panel in the Windows Start menu search bar at the bottom of the screen. Or type Win+R and type control panel in the Run dialogue box and press OK.
Step 2: In the Control Panel navigate to Programs > Programs and Features > Turn Windows features on or off.
Step 3: In the Windows Features dialogue box check boxes for Virtual Machine Platform, Windows Hypervisor Platform and Windows Subsystem for Linux.
Restart WSL distro
Assuming you already have WSL and a Linux distributor installed on your computer, you can shut down and restart your WSL with command prompts.
Step 1: Type Command Prompt or Windows PowerShell in the Start Menu search bar and select Run as administrator.
Step 2: In the Command Prompt or Windows PowerShell window, type the command to shut down:
wsl --shutdown
Step 3: Then type command to specify the Linux distribution:
wsl -d Ubuntu
Step 3: Restart or reinstall WSL distribution with command:
wsl --install -d <Distro Name>
For instance, if the distro is Ubuntu, type command: wsl –install -d Ubuntu.
Note that you would have to reboot your system for the changes to be effective.
Reinstall WSL
Further issues with configuration can be resolved with the classic ‘uninstall and reinstall’ method.
To do so, follow the below steps and commands:
Step 1: Type Command Prompt or Windows PowerShell in the Start Menu search bar and select Run as administrator.
Step 2: In the Command Prompt or Windows PowerShell window, type command to uninstall:
wsl -uninstall
Step 3: Then type command to reinstall:
wsl -install
Reboot the system to ensure the changes are applied before performing other functions.
Also read: Fix: Error: 0x80040326 error code: wsl/service/0x80040326