Ubuntu – run android studio on windows 10 Subsystem Linux

androidwindows-subsystem-for-linux

In terms of compatibility and IO on files shared between Windows and Linux Subsystem: If I install Ubuntu image for WSL from the Microsoft Store, could this cause any file system problems when I try to run Android Studio from the WSL image?

This is due to the technical issues raised up here Microsoft/WSL, since 2017 up to now.

Best Answer

For running Android Studio in WSL image you need to enable WSL2 which is currently subject of Windows Insider Preview builds.

Please note, that GUI applications are not officially supported by Microsoft, however it works and does not cause any filesystem problems in my case.

You can find a whole guide to start GUI applications including enabling WSL2 here: https://autoize.com/xfce4-desktop-environment-and-x-server-for-ubuntu-on-wsl-2/ All you need is to install VcSrv or any alternative on Windows side (I recommend paid X410 as an alternative with better UX) and xfce4 on Unix side and then configure Unix display to show in Windows by export DISPLAY=[unix ip]:0

After you configure it, you can download and install Android Studio from https://developer.android.com/studio#downloads

You can face an error during installation: "Unable to run mksdcard SDK tool." - see a related question on Stack overflow. However, if you manually install missing libraries, it will complete the installation. I tried it and it works.

Install missing libraries with a recommended answer: sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

For information about connecting to USB device see this issue github.com/microsoft/WSL2-Linux-Kernel/issues/23 refering to this guide: github.com/rpasek/usbip-wsl2-instructions

A limitation is that WSL2 does not support nested virtualization at this time, so you will not be able to emulate an virtual Android device.

Related Question