Information

This is an update for https://trzeci.eu/configure-graphic-and-sound-on-wsl/

New version of WSL brings lots of fixes and updates: https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/.
Unfortunately it’s still impossible to play a sound out of the shelf. The major problem is connected to the lack of direct support for audio devices. The solution is to use PulseAudio, what creates a server on Windows host, and this server plays a sound what is passed from Linux.

The problem with this solution is that it’s not supported:

Thanks to @therealkenk we can pull modified library for Ubuntu 16.04, like it was possible for 14.04: https://github.com/Microsoft/BashOnWindows/issues/486#issuecomment-299682364

Demo

In the following part I will present Base setup, what’s needed to do required steps manually, further you can find “Installation script” what does everything automatically, please choose wisely.

Base setup

After this step it’s possible to enter Linux environment, but it has few pitfalls.

  1. Enable developer mode in settings, or use command line alternative (run as Administrator)
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  2. Enable Windows Subsystem for Linux
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  3. Restart Windows
  4. Run cmd and:
    1. Either execute bash, then follow an installation process
    2. Or, lxrun /install /y to install windows with root user and without password (a user can be added later on)

Enhancement

Fix sudo (might be not required)

// Linux installation inherits Windows host name, but it is not configured fully, sudo needs to have updated /etc/hosts file with a right host name

sudo sh -c "echo '127.0.0.1 `hostname`' >> /etc/hosts"

X11 Server

Export default display

echo "export DISPLAY=:0.0" >> ~/.bashrc

Windows applications

  • xming as X-server – needed to display applications from Linux
  • pulseaudio – as a sound server

 

Installation scripts

  1. Download script from: GIST
  2. Make sure that you understand what it does, what is:
    1. Enabling Developer Mode (It will require reboot)
    2. Installing base WSL component
    3. Apply fixes:
      1. Sudo
    4. Install base packages (unzip, git-core, zsh)
    5. Install development packages

 

Cheers,
P

 
66 Kudos
Don't
move!