Ubuntu HowTo: Are there any limitations in working in Ubuntu in Windows Subsystem for Linux on Windows 10? [closed]

Original Source Link

Are all of Ubuntu’s capabilities including support for GUI applications available in the latest version of Windows Subsystem for Linux installation of Ubuntu or are there any limitations in working in Ubuntu in Windows Subsystem for Linux on Windows 10?

GPU Compute, WSL Install and WSL Update arrive in latest Insider build for WSL

GPU support for WSL arrived in the Dev Channel preview of Windows 10 build 20150 under Microsoft’s reorganized testing structure, which lets it test Windows 10 builds that aren’t tied to a specific future feature release. Microsoft announced upcoming GPU support for WSL a few weeks ago at Build 2020, along with support for running Linux GUI apps. The move on GPU access for WSL is intended to bring the performance of applications running in WSL2 up to par with those running on Windows. GPU compute support is the feature most requested by WSL users, according to Microsoft. The 20150 update includes support for Nvidia’s CUDA parallel computing platform and GPUs, as well as GPUs from AMD and Intel. It also supports DirectML (Direct Machine Learning), Microsoft’s Windows 10 API for hardware-accelerated machine learning. Slashdot


What’s coming to WSL

Install WSL with a single command

One common complaint about WSL is that it’s not easy to find and enable. Microsoft is working on some improvements to the wsl.exe command-line tool to help you install WSL. Soon you will be able to simply install WSL by entering: wsl.exe --install in your command-line.

Install WSL with a single command

This command will be added to every Windows machine so that all you need to do is open a Terminal window elevated with administrator privileges and run wsl.exe --install. From there the WSL optional components will be enabled, and your specified distro will be downloaded and installed for you automatically upon restart.

You can expect to see initial releases of this feature in the next few months in the Windows Insiders Fast Ring.

WSL 2 will be the new default when installing for the first time

We’re also introducing the change to make WSL 2 the new default distribution type when installing WSL for the first time. WSL 2 brings significant improvements and we found that the majority of our users on Insider branches are using WSL 2 distros. When developing wsl.exe --install it made sense for it to default to what people are using: WSL 2, and we’ve included this as well for any new installations of WSL when enabling the ‘Windows Subsystem for Linux’ optional component. You’ll see these changes in the Insiders Fast ring in the next few months alongside the wsl.exe --install improvement.

WSL will support GPU Compute workflows

Adding CUDA and/or GPU Compute support to WSL has been our #1 most requested feature since our first release! Over the last 3+ years, the WSL, Virtualization, DirectX, Windows Driver teams, and our silicon partners have been working hard on a complex engineering feat to deliver this capability.

This is why we’re thrilled to announce that we will start previewing GPU compute support for WSL in Windows 10 Insider builds within the next few months.

Initially, the GPU compute capability will support two scenarios:

  • NVIDIA CUDA
    • Supports existing Linux tools & workflows used by professionals
  • DirectML
    • Initially targeting beginners and students, leveraging DirectX 12 capable GPUs from several vendors
    • The team will be releasing a preview package of TensorFlow with a DirectML back-end enabling hardware agnostic acceleration of AI & ML workloads across the breadth of Windows hardware – DirectML will also support native Windows too, including TensorFlow on Windows.

Once this preview is released, you will simply need to ensure that you have the latest Windows Insider Fast build, WSL 2 installed, install the correct driver for your GPU from the hardware vendor, and then you’ll be ready to start developing, training and testing your machine learning and AI models inside of WSL.

WSL will support GPU Compute workflows

This change will be released to the Windows Insiders Fast ring in the next few months. For all the details of what this change means and how it was made possible, please read the DirectX Developer blog post.

Adding Linux GUI app support to WSL is on our roadmap

One of our other most prolific requests is to support not just command-line apps, but Linux GUI apps as well. For example, some users want to run their preferred Linux GUI text editor or IDE in a Linux environment and work on their code stored locally within their distro’s filesystem, or simply develop Linux GUI apps on their Windows machine.

Our goal is for you to be able to run Linux GUI apps on your desktop seamlessly alongside your Windows apps. This will enable you to use Linux apps to edit, build, and run your code, visualize data plots in Python, or even use applications that are optimized for a Linux environment.

At BUILD we demonstrated an early version of this work, running a few GUI sample apps directly from WSL such as Eye of Gnome, gedit and the mpv media player. These apps connected to a wayland server running inside of WSL, which communicated with a RDP client on the Windows host. You can see a screenshot of this in action below where we’re running the GNOME file manager in WSL and Outlook side by side.

Linux GUI app support on WSL

These changes are on the WSL’s team roadmap and you can expect to hear more about this work by the end of 2020, at which time this answer will be updated.

Source: The Windows Subsystem for Linux BUILD 2020 Summary

Tagged : / /

Making Game: SSH Users Windows 10 Group

Original Source Link

I just noticed an user group I had never seen before in Windows 10 Pro x64 (1607) (look at the last group):

SSH Users Group

Why is this group present? I have never seen it before nor I created it.

I do have Windows Linux Subsystem installed. I am not aware it includes an SSH daemon.

What makes me weary of this is that a search for the group’s description on Google brings 0 results.

Either something is fishy or I am just the first person to notice and comment about this on the internet (unlikely).

Recently I do a hard reaserch about this on google (maybe 2 or 3 hours) and after kicked some bad boys, I had get this info from the windows evil side: Yes OpenSSH Client and Server are now native avalible at the Insiders Preview when you activate the developers mode, by adding the optional featurs, that is, in the configuration menu search “Manage Configuration Manage”, then click in “Add a feature” and then, install OpenSSH-Client (beta) and/or OpenSSH-Server (beta). Well if you’r not familiarized with SSH, it’s a remote manage option in non-graphic mode, very popular on Linux based systems, the group it’s to manage the allowed acounts to get conection in your pc.

Well, if you want to try by yourself, I bring you some links:
https://blogs.msdn.microsoft.com/powershell/2017/12/15/using-the-openssh-beta-in-windows-10-fall-creators-update-and-windows-server-1709/

https://www.youtube.com/watch?v=dqz6auCMqkI

Hope this answer the question, and put the links to many

If you scroll to the bottom of this page, you’ll find, that SSH server didn’t yet hit production:
https://blogs.msdn.microsoft.com/powershell/2015/10/19/openssh-for-windows-update/

You could check if the group has any members. If it has members, you don’t recognize, you should definitely remove them.

Tagged : / / /

Linux HowTo: SSH Users Windows 10 Group

Original Source Link

I just noticed an user group I had never seen before in Windows 10 Pro x64 (1607) (look at the last group):

SSH Users Group

Why is this group present? I have never seen it before nor I created it.

I do have Windows Linux Subsystem installed. I am not aware it includes an SSH daemon.

What makes me weary of this is that a search for the group’s description on Google brings 0 results.

Either something is fishy or I am just the first person to notice and comment about this on the internet (unlikely).

Recently I do a hard reaserch about this on google (maybe 2 or 3 hours) and after kicked some bad boys, I had get this info from the windows evil side: Yes OpenSSH Client and Server are now native avalible at the Insiders Preview when you activate the developers mode, by adding the optional featurs, that is, in the configuration menu search “Manage Configuration Manage”, then click in “Add a feature” and then, install OpenSSH-Client (beta) and/or OpenSSH-Server (beta). Well if you’r not familiarized with SSH, it’s a remote manage option in non-graphic mode, very popular on Linux based systems, the group it’s to manage the allowed acounts to get conection in your pc.

Well, if you want to try by yourself, I bring you some links:
https://blogs.msdn.microsoft.com/powershell/2017/12/15/using-the-openssh-beta-in-windows-10-fall-creators-update-and-windows-server-1709/

https://www.youtube.com/watch?v=dqz6auCMqkI

Hope this answer the question, and put the links to many

If you scroll to the bottom of this page, you’ll find, that SSH server didn’t yet hit production:
https://blogs.msdn.microsoft.com/powershell/2015/10/19/openssh-for-windows-update/

You could check if the group has any members. If it has members, you don’t recognize, you should definitely remove them.

Tagged : / / /

Ubuntu HowTo: WSL: Can’t use git clone on windows mounted folders

Original Source Link

Windows Version: Windows Enterprise 10.0.18363 Build 18363

WSL 1

Ubuntu 20.04 LTS

Issue:

I have 2 machines where I installed WSL but on one the mounted files are set to root:root which doesn’t allow to use git clone. But the other machine has the correct user. What did I screw up while configuring the one machine?

Note:

Both use the same versions.

Tagged : / /

Making Game: When will WSL2 be officially released?

Original Source Link

I want to install docker on my windows subsystem for windows. In order to do that I need WSL version 2

I am not able to upgrade from version 1 to version 2 I believe because the version of windows that I am running. I have OS Build 18363.836.

A lot of websites say that build 2004 was going to be available on May.I searched for wsl twitter account and I ended up here:
https://twitter.com/i/lists/1131397802204864512

This post stated that it was goint to be rolled out on May 28 2020:
https://twitter.com/richturn_ms/status/1265872180396478466?s=20

Where can I find the official release date? Is the release date still unknown?

It has been rolled out since 27th May

https://docs.microsoft.com/en-gb/windows/release-information/status-windows-10-2004

You can download it if it isn’t offered through Windows Update

https://www.microsoft.com/en-gb/software-download/windows10

Tagged : /

Linux HowTo: When will WSL2 be officially released?

Original Source Link

I want to install docker on my windows subsystem for windows. In order to do that I need WSL version 2

I am not able to upgrade from version 1 to version 2 I believe because the version of windows that I am running. I have OS Build 18363.836.

A lot of websites say that build 2004 was going to be available on May.I searched for wsl twitter account and I ended up here:
https://twitter.com/i/lists/1131397802204864512

This post stated that it was goint to be rolled out on May 28 2020:
https://twitter.com/richturn_ms/status/1265872180396478466?s=20

Where can I find the official release date? Is the release date still unknown?

It has been rolled out since 27th May

https://docs.microsoft.com/en-gb/windows/release-information/status-windows-10-2004

You can download it if it isn’t offered through Windows Update

https://www.microsoft.com/en-gb/software-download/windows10

Tagged : /

Ubuntu HowTo: /usr/bin/env: ‘python’: No such file or directory

Original Source Link

I am trying to install Gitlab Development Kit on Windows Ubuntu Bash.

$python3 output

Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

$python output

The program 'python' can be found in the following packages:
 * python-minimal
 * python3
Try: sudo apt install <selected package>

When I try to do this:

sudo apt-get install build-essential 
./configure 
make -j4 # adjust according to your available CPU capacity 
sudo make install

This is the output after ./configure

$ ./configure
/usr/bin/env: ‘python’: No such file or directory

$ python --version 

The program 'python' can be found in the following packages:
 * python-minimal
 * python3
Try: sudo apt install <selected package>

$which -a python

no output

How can I solve this? I am new to Ubuntu.

You do seem to have python3 installed, but it isn’t called python and anyway the script you want to run (configure) requires python 2. So:

  1. Install python2

    sudo apt-get install python2.7-minimal
    
  2. Run it again

    ./configure
    

If that fails again, call it with python2 explicitly:

/usr/bin/python2.7 configure

I had the same problem after installing Ubuntu 18.04 and trying to run some python scripts.

I tried:

sudo apt-get install python2.7-minimal

but I still got the same error. I solved it by:

sudo apt install python-minimal

For ubuntu 20.04 you can use following package to python command. And it is python 3.

sudo apt-get install python-is-python3

I had the same problem, It got solved by linking python to python2.7 with the following commands

cd /usr/bin
sudo mv python python.bak
sudo ln -s /usr/bin/python2.7 /usr/bin/python

Problem scenario:

/usr/bin/env: ‘python’: No such file or directory

Possible Solution #1

If Python 3 is not installed, install it: apt-get install python3

Possible Solution #2

If Python 3 has been installed, run these commands: whereis python3

Then we create a symlink to it: sudo ln -s /usr/bin/python3 /usr/bin/python

Just for reference… I had a similar issue – running a python script from the docker container failed with “No such file or directory”, my solution was to force Unix style line endings on the checkout of the code and in the IDE (as it was bind-mounted from the Windows host to the container).

Check the spelling in the first line. Trailing spaces have been known to prevent the shell from locating the shell…

#!/usr/bin/env tclsh

The training space confused bash.

Tagged : / /

Ubuntu HowTo: “Error: 0x80080005 Server execution failed” while installing Ubuntu on Windows

Original Source Link

While installing Ubuntu app on Windows, I’m encountering this error:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80080005
Error: 0x80080005 Server execution failed

How do I install Ubuntu app successfully on Windows?

Try restarting the manager for the linux subsystem by opening command prompt as admin (cmd) and running:

sc stop LxssManager
sc start LxssManager

and then query it to make sure the state is 4, RUNNING.

sc query LxssManager

Now try to open the Ubuntu app again, if it gives a different error this time, try uninstalling and reinstalling the app.

I encountered the same issue once I installed the Windows 10 May v2004 Update and updated to WSL 2

On running

sc query LxssManager

No output was printed and the solution by @Jsilvermist didn’t work in my case.

So instead I found this answer on Windows Forum Link to OP. It is recommended that you create a backup of the registry before modifying it.

  • Press ‘Win + R’ keys on the keyboard together to open the Run dialog box and type the following into the Run box: REGEDIT
  • Navigate to the following registry key:
  • HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesLxssManager
  • On the right pane, locate Start and set the Value Data to 2.
  • Exit REGEDIT, and reboot the machine to see if it works.

I have also checked on this webpage some solutions as I did not want to do over fixing manipulations.
I have checked if there were some Windows 10 updates on going on my computer and that was the case : my pc has downloaded the latest version but did not install it yet. I did the installation and now Ubuntu works.

Tagged : /

Making Game: Connect to MySQL from WSL2?

Original Source Link

I have installed MySQL server on Windows and I would like to connect to it from WSL2. Unfortunately it seems that WSL cannot reach the MySQL server:

$ /mnt/c/Program Files/MySQL/MySQL Server 5.7/bin/mysql.exe -uroot -p
Enter password: 
mysql> exit
Bye

$ mysql -uroot -p --protocol=TCP
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (111)

On ifconfig I only have two interfaces eth0 and lo, so it seems WSL and Windows share the same local interface. To verify this I’ve started a Python webserver and accessed from Windows on localhost.

How to connect to MySQL from WSL2?

As per the WSL vs WSL2 documentation on how to connect to the host, you can look in WSL2 in /etc/resolv.conf for the nameserver, which happens to be the host:

export WSL_HOST_IP=$(awk '/nameserver/ { print $2 }' /etc/resolv.conf)

As described in this article, you have to use the IP that the WSL ethernet adapter creates.

Create the windows firewall rule if necessary. (Inbound rule for MySQL)

Run ipconfig.exe and look for Ethernet-Adapter vEthernet (WSL). Extract the IP-Address. (If you use the awk-line from the article, I had to change the $14 to $13 for it to work).

Grant the ip-address access in mysql: grant all on *.* to 'root'@'172.0.0.0/255.0.0.0' identified by '<password>' with grant option;
(I found that the IP-Address changes after a Windows restart, therefore I had to use the IP range/mask version.)

Then you can call mysql -uroot -p -h<ip-address> --protocol=tcp

Edit
If you want to skip this -h parameter, you could add the export and an alias to the .bashrc:

export WSL_HOST_IP=$(/c/Windows/system32/ipconfig.exe | awk '/WSL/ {getline; getline; getline; getline; print substr($13, 1, length($13)-1)}')
alias mysql='mysql -h$WSL_HOST_IP'

(If you use /mnt/c/ correct the path for ipconfig accordingly.)

Then you can just type mysql -uroot ...

Tagged : / / /

Linux HowTo: Connect to MySQL from WSL2?

Original Source Link

I have installed MySQL server on Windows and I would like to connect to it from WSL2. Unfortunately it seems that WSL cannot reach the MySQL server:

$ /mnt/c/Program Files/MySQL/MySQL Server 5.7/bin/mysql.exe -uroot -p
Enter password: 
mysql> exit
Bye

$ mysql -uroot -p --protocol=TCP
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (111)

On ifconfig I only have two interfaces eth0 and lo, so it seems WSL and Windows share the same local interface. To verify this I’ve started a Python webserver and accessed from Windows on localhost.

How to connect to MySQL from WSL2?

As per the WSL vs WSL2 documentation on how to connect to the host, you can look in WSL2 in /etc/resolv.conf for the nameserver, which happens to be the host:

export WSL_HOST_IP=$(awk '/nameserver/ { print $2 }' /etc/resolv.conf)

As described in this article, you have to use the IP that the WSL ethernet adapter creates.

Create the windows firewall rule if necessary. (Inbound rule for MySQL)

Run ipconfig.exe and look for Ethernet-Adapter vEthernet (WSL). Extract the IP-Address. (If you use the awk-line from the article, I had to change the $14 to $13 for it to work).

Grant the ip-address access in mysql: grant all on *.* to 'root'@'172.0.0.0/255.0.0.0' identified by '<password>' with grant option;
(I found that the IP-Address changes after a Windows restart, therefore I had to use the IP range/mask version.)

Then you can call mysql -uroot -p -h<ip-address> --protocol=tcp

Edit
If you want to skip this -h parameter, you could add the export and an alias to the .bashrc:

export WSL_HOST_IP=$(/c/Windows/system32/ipconfig.exe | awk '/WSL/ {getline; getline; getline; getline; print substr($13, 1, length($13)-1)}')
alias mysql='mysql -h$WSL_HOST_IP'

(If you use /mnt/c/ correct the path for ipconfig accordingly.)

Then you can just type mysql -uroot ...

Tagged : / / /