Issue with wsl-integration.sh script causing slow start of Ubuntu shell with WSL2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wslu (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Users of Ubuntu on WSL experience long delay in starting the Ubuntu shell when the Windows Firewall is turned on.
[Test Case 1]
* Install Ubuntu in a WSL2 instance
* Enable Windows Firewall for Pubic Network
* (rm -f $HOME/.
* run time . /etc/profile.
[Test Case 2] ()
(This should be run for (WSL1,WSL2) x (X and PA server running, X and PA server not running) combinations)
* Install Ubuntu in a WSL2/WSL1 instance
* Disable Windows Firewall
* (rm -f $HOME/.
* run:
$ unset DISPLAY
$ unset PULSE_SERVER
$ time . /etc/profile.
$ echo $DISPLAY $PULSE_SERVER
[Regression Potential]
* The added timeout may be too low for slow/loaded systems making X/PA server auto detection fail. I've picked the timeout value by testing the successful detection attempts in a KVM VM.
Pactl commands are consistently slower than xvinfo and WSL1 is consistently slower than WSL2:
max. | WSL1 | WSL2
-------
pactl info| ~0.5s |~0.1s
-------
xvinfo | ~0.3s |~0.07s
The CPU used in testing: i5-7300U CPU @ 2.60GHz
[Original Bug Text]
$lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Today I ran an apt update of my WSL2 Ubuntu 18.04.2 LTS installation on Windows 10 insider build 19037.1. I then noticed when I launched the WSL2 Ubuntu shell that it took about 38 seconds to get a shell prompt. This was not an issue until after I did the update. After some troubleshooting I found out this delay was because of wsl-integration.sh, that the wslu update appears to have added. The following two commands:
env DISPLAY=
env PULSE_SERVER=
in this script are both timing out on my computer. Because both commands are timing out, that accounted for the 38 seconds it took to get a shell prompt.
In my case, my WSL_HOST IP was 172.24.144.1 and so I ran these two commands:
env DISPLAY=
env PULSE_SERVER=
and sure enough it took a combined time of about 38 seconds for them to timeout. This is only an issue when running Ubuntu in WSL2, not WSL1. WSL1 launches fine. In the case of the my WSL1 instance, the WSL_HOST appears to be null when running your script, so it assigns localhost to WSL_HOST, and both of these commands timeout without delay.
Related branches
- Sebastien Bacher: Approve
-
Diff: 51 lines (+24/-5)1 file modifieddebian/wsl-integration.sh (+24/-5)
Changed in wslu (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → High |
description: | updated |
description: | updated |
tags: | added: regression-update |
tags: | added: id-5def8ed4ce54f7142244d331 |
I should also point out that the IP of 172.24.144.1 was pingable from the shell.