Enabling WSL-2 on Windows 10 VMWare Workstation (Version 17.0.2 build-21581411) to Run Virtual Machines with Side Channel Mitigations Disabled
Windows Subsystem for Linux version 2 (WSL-2) is a significant improvement over its predecessor, WSL-1. WSL-2 offers better performance, a real Linux kernel, and full system call compatibility. However, enabling WSL-2 on a Windows 10 VMWare Workstation can be a challenge, especially when you want to run virtual machines with side channel mitigations disabled.
Prerequisites
Before you begin, ensure that your system meets the following requirements:
- A 64-bit Windows 10 Pro, Enterprise, or Education edition
- VMWare Workstation 17.0.2 build-21581411 or later
- Hyper-V and Containers features enabled
Enabling WSL-2 on Windows 10 VMWare Workstation
To enable WSL-2 on Windows 10 VMWare Workstation, follow these steps:
- Open PowerShell as Administrator and run the following command to enable the WSL-2 optional component:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart- Next, run the following command to enable the Virtual Machine Platform optional component:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart- Set WSL-2 as the default version by running the following command:
wsl --set-default-version 2Disabling Side Channel Mitigations
To disable side channel mitigations, you need to modify the VMWare Workstation configuration. Follow these steps:
- Open the VMWare Workstation configuration file (.vmx) in a text editor.
- Add the following lines to the configuration file:
vhv.enable = "TRUE"
mce.enable = "FALSE"
hypervisor.cpuid.v0 = "FALSE"
hypervisor.cpuid.v1 = "FALSE"Creating a WSL-2 VM on VMWare Workstation
After enabling WSL-2 and disabling side channel mitigations, you can create a new VM on VMWare Workstation. Follow these steps:
- Create a new VM and select the Linux distribution you want to use.
- On the "Customize Hardware" screen, increase the number of virtual CPUs and the amount of memory to match your host system's resources.
- On the "Network Adapter" screen, select "Bridged: Connected directly to the physical network" as the network connection type.
- On the "SCSI Controller" screen, select "LSI Logic SAS" as the SCSI controller type.
- On the "Virtual Disk" screen, select "Create a new virtual disk" and configure the disk size and storage location.
- Complete the VM creation process and start the VM.
- Ensure your system meets the prerequisites
- Enable WSL-2 and Virtual Machine Platform optional components
- Disable side channel mitigations in the VMWare Workstation configuration file
- Create a new VM with increased virtual CPU and memory resources
- Configure the network connection type and SCSI controller type
- Create a new virtual disk and complete the VM creation process
References
- VMWare Workstation Documentation:
- Microsoft WSL-2 Documentation: