# Set up an Ubuntu VM on Windows
Windows Subsystem for Linux (WSL) is a Windows feature that allows you to run Linux distributions on Windows, without using virtualization software. The following figure shows the tasks involved in setting up WSL on Windows:
>
>
>
>
>
>
> **Figure: Workflow to set up WSL**
Note
You can only compile the Qualcomm Linux build using WSL. To flash the software, see [Flash using the QDL tool](https://docs.qualcomm.com/bundle/publicresource/topics/80-80021-251/upgrade-rb3gen2-software.html#panel-0-VWJ1bnR1tab$flash-using-the-qdl-tool).
## Prerequisites to set up an Ubuntu VM on Windows
Before setting up WSL, do the following:
- [Verify Windows host computer system requirements](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#hopstmachinewin)
- [Turn on Windows features](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#turnonwinfea)
- [Set the default WSL version](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#setdefaultwslver)
### Verify Windows host computer system requirements
Before setting up an Ubuntu VM using WSL, ensure that your Windows host computer meets the system requirements listed in the following table:
Table: Windows host computer system requirements
| **Processor architecture** | **CPU cores** | **RAM** | **Storage** | **Operating system** |
| --- | --- | --- | --- | --- |
| X64 | 8 or more | 8 GB or more | 300 GB of free space | Windows 11 |
### Turn on Windows features
To turn on the *Windows Subsystem for Linux* and *Virtual Machine Platform* Windows features, do the following:
1. Run the following commands in Windows PowerShell with administrative privileges:
| Windows feature | Command |
| --- | --- |
| Windows Subsystem for Linux | Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Copy to clipboard |
| Virtual Machine Platform | Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform Copy to clipboard |
2. Restart the Windows host computer after running the commands.
### Set the default WSL version
To set Windows Subsystem for Linux 2 as the default Linux distribution version for WSL, run the following command in Windows PowerShell with administrative privileges:
wsl --set-default-version 2
Copy to clipboard
**Output**
For information on key differences with WSL 2 please visit [https://aka.ms/wsl2](https://aka.ms/wsl2). The operation completed successfully.
## Install Ubuntu in WSL
Qualcomm Linux uses the Ubuntu-22.04 Linux distribution. To verify if Ubuntu 22.04 is available as one of the distributions on your Windows host computer and then install it, do the following:
1. To list the distributions available for installation, run the following command in Windows PowerShell:
>
>
> wsl --list --online
> Copy to clipboard
2. Verify that the list includes Ubuntu 22.04 as one of the distributions.
>
>
> 
>
> Note
>
>
> If you don’t see Ubuntu 22.04 in the distributions listed, contact Microsoft support.
3. To update WSL, run the following command:
>
>
> wsl --update
> Copy to clipboard
4. To install Ubuntu 22.04 LTS, run the following command:
>
>
> wsl --install -d Ubuntu-22.04
> Copy to clipboard
5. After the installation is complete, set the username and password for the Ubuntu 22.04 Linux distribution you installed.
## Configure global settings for WSL
To configure WSL global settings, such as memory, processors, and the swap storage space for the Ubuntu VM, do the following:
1. Open Windows File Explorer and go to the `C:\Users\` directory.
2. Do one of the following:
>
>
> - If the `.wslconfig` file exists, skip to Step 3.
> - If the `.wslconfig` file doesn’t exist, create a file named `.wslconfig`.
3. To ensure that the values for memory, processors, and swap size align with the specifications of your Windows host computer, open the `.wslconfig` file using a text editor.
4. Copy the following text into the `.wslconfig` file and save it:
>
>
> # Settings apply across all Linux distributions running on WSL 2
> [wsl2]
> # Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
> memory=64GB
> # Sets the VM to use two virtual processors
> processors=16
> # Sets amount of swap storage space to 8GB, default is 25% of available RAM
> swap=64GB
> # Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
> swapfile=C:\\temp\\wsl-swap.vhdx
> # Enable experimental features
> [experimental]
> # Automatically releases cached memory after detecting idle CPU usage. Set to gradual for slow release, and dropcache for instant release of cached memory.
> autoMemoryReclaim=dropcache
> Copy to clipboard
5. To shut down WSL, run the following command in Windows PowerShell:
>
>
> wsl --shutdown
> Copy to clipboard
6. To restart WSL, run the following command in Windows PowerShell:
>
>
> wsl
> Copy to clipboard
## Configure Ubuntu settings in WSL
To set up the WSL environment, configure the following Ubuntu settings in WSL:
- [DNS settings](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#dnssettings)
- [Git settings](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#gitsettings)
- [WSL local settings](https://docs.qualcomm.com/doc/80-80021-41/topic/set-up-windows-subsystem-for-linux-on-windows-11.html#wsllocalsettings)
### DNS settings
To configure DNS settings for WSL, use the `resolv.conf` file.
1. In a Linux terminal window, use the `sudo` command to add the following contents in the `/etc/resolv.conf` file:
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
Copy to clipboard
2. When you close the Linux terminal window, the nameserver automatically reverts to its default nameserver setting. To save the changes you made to the `resolv.conf` file permanently, run the following command:
sudo chattr -f +i /etc/resolv.conf
Copy to clipboard
3. To change the write permissions and update the `resolv.conf` file, run the following command:
sudo chattr -f -i /etc/resolv.conf
Copy to clipboard
### Git settings
To enable long path support for Git, run the following command in the Linux terminal window:
git config --global core.longpaths true
Copy to clipboard
### WSL local settings
To configure local settings for the Ubuntu Linux distribution you installed, use the `wsl.conf` file. The settings in the wsl.conf file are automatically applied every time you open WSL.
1. In the Linux terminal window, use the `sudo` command to add the following contents in the `/etc/wsl.conf` file:
[network]
generateResolvConf = false
[automount]
options = "metadata"
[boot]
command = service docker start
[boot]
systemd=true
Copy to clipboard
2. In Windows PowerShell, run the following command to restart WSL:
wsl --shutdown
Copy to clipboard
## Optional: Change the Ubuntu installation drive
Ubuntu installs on the C drive by default. If the C drive on your Windows host computer doesn’t have enough disk space for builds, you can move the Ubuntu installation to another drive.
To move the Ubuntu installation to another drive, do the following:
1. Open Add or Remove Programs and find the Ubuntu installation in the list.
2. In the Control Panel, select Programs > Programs and Features.
3. Right-click the Ubuntu installation for which you want to change the drive, and select Uninstall or Uninstall/Change.
The following dialog appears.

4. Select Move.
5. Select the drive that you want to move the Ubuntu installation to and select Move.
6. To access the WSL workspace, go to the following path using the Windows File Explorer:
\\wsl$
Copy to clipboard
## Next steps
- [Sync, build, and flash Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-80021-254)
- [Fix network failures in the Ubuntu VM](https://docs.qualcomm.com/doc/80-80021-41/topic/troubleshoot.html#fix-network-failures-in-the-ubuntu-vm)
Last Published: Mar 16, 2026
[Previous Topic
Virtual machine setup overview](https://docs.qualcomm.com/bundle/publicresource/80-80021-41/topics/getting-started.md) [Next Topic
Set up an Ubuntu Server VM on an Arm64 Mac](https://docs.qualcomm.com/bundle/publicresource/80-80021-41/topics/set-up-an-ubuntu-vm-on-an-arm64-based-mac.md)