Skip to content

Commit

Permalink
Merge pull request #379 from foureight84/wsl2-nestedVirtualization
Browse files Browse the repository at this point in the history
[documentation] WSL2 - added instructions to enable hw accelerated kvm via nestedvirtualization flag
  • Loading branch information
budtmo authored Aug 4, 2023
2 parents 5264221 + 87bebdf commit e268a43
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,37 @@ Quick Start
docker exec -it android-container cat device_status
```

WSL2 Hardware acceleration (Windows 11 only)
-----------

Credit goes to [Guillaume - The Parallel Interface blog](https://www.paralint.com/2022/11/find-new-modified-and-unversioned-subversion-files-on-windows)

[Microsoft - Advanced settings configuration in WSL](https://learn.microsoft.com/en-us/windows/wsl/wsl-config)


1. Add yourself to the `kvm` usergroup.
```
sudo usermod -a -G kvm ${USER}
```

2. Add necessary flags to `/etc/wsl2.conf` to their respective sections.
```
[boot]
command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'
[wsl2]
nestedVirtualization=true
```
3. Restart WSL2 via CMD prompt or Powershell
```
wsl --shutdown
```


`command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'` sets `/dev/kvm` to `kvm` usergroup rather than the default `root` usergroup on WSL2 startup.

`nestedVirtualization` flag is only available to Windows 11.

Use-Cases
---------

Expand Down

0 comments on commit e268a43

Please sign in to comment.