I installed WSL Ubuntu 20.04 on Windows 10. I also installed VcXsrv (Xlaunch). I use the command as follows to start VcXsrv:
"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
At Ubuntu terminal, I am not able to start terminator. Please help.
$ export DISPLAY=0:0
$ terminator
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
You need to run terminator in an X environment. Make sure $DISPLAY is properly set.
Below is the output of netstat
C:\Windows\system32>netstat -abno|findstr 6000
TCP 0.0.0.0:6000 0.0.0.0:0 LISTENING 42548
TCP 127.0.0.1:6000 127.0.0.1:65381 ESTABLISHED 42548
TCP 127.0.0.1:6000 127.0.0.1:65382 ESTABLISHED 42548
TCP 127.0.0.1:6000 127.0.0.1:65383 ESTABLISHED 42548
TCP 127.0.0.1:65381 127.0.0.1:6000 ESTABLISHED 42548
TCP 127.0.0.1:65382 127.0.0.1:6000 ESTABLISHED 42548
TCP 127.0.0.1:65383 127.0.0.1:6000 ESTABLISHED 42548
TCP [::]:6000 [::]:0 LISTENING 42548
Get-NetFirewallApplicationFilter |? { $_.Program -like "*vcxsrv*" } | Get-NetFirewallRule
Name : TCP Query User{81BBD37C-DC9F-4C50-B2C6-A1B58CABD66C}C:\program files\vcxsrv\vcxsrv.exe
DisplayName : VcXsrv windows xserver
Description : VcXsrv windows xserver
DisplayGroup :
Group :
Enabled : True
Profile : Domain
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : DeferToUser
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses :
Name : {14B2C126-9C6A-42CA-B496-62F2D88ED067}
DisplayName : VcXsrv windows xserver
Description : VcXsrv windows xserver
DisplayGroup :
Group :
Enabled : True
Profile : Public
Platform : {}
Direction : Inbound
Action : Block
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses :
Name : UDP Query User{87720067-4851-485C-A9B1-ABE74E6BE131}C:\program files\vcxsrv\vcxsrv.exe
DisplayName : VcXsrv windows xserver
Description : VcXsrv windows xserver
DisplayGroup :
Group :
Enabled : True
Profile : Domain
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : DeferToUser
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses :
Name : {1B4ABAF3-28C3-42F8-8C62-3AE54EFFC97C}
DisplayName : VcXsrv windows xserver
Description : VcXsrv windows xserver
DisplayGroup :
Group :
Enabled : True
Profile : Public
Platform : {}
Direction : Inbound
Action : Block
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses :
DISPLAYvariable that you'll need to use under WSL2 with VcXsrv. – NotTheDr01ds Aug 03 '22 at 20:48export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0or my answer withexport DISPLAY=$(hostname).local:0. Let me know (via edit) if that doesn't work for you. – NotTheDr01ds Aug 03 '22 at 20:50$ export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 $ export LIBGL_ALWAYS_INDIRECT=1 pluo@PerryLuo-PC:~$ terminator Unable to init server: Could not connect: Connection refused Unable to init server: Could not connect: Connection refused You need to run terminator in an X environment. Make sure $DISPLAY is properly set
– Gary Aug 03 '22 at 22:03Get-NetFirewallApplicationFilter |? { $_.Program -like "*vcxsrv*" } | Get-NetFirewallRule. – NotTheDr01ds Aug 04 '22 at 00:10Name). Make sure each one isEnabled (True),Profile (Public), and points to the correct path forvcxsrv.exe. – NotTheDr01ds Aug 04 '22 at 17:41export DISPLAY=192.168.1.10:0(or whatever the host IP is). You aren't using a VPN or any sort, right? – NotTheDr01ds Aug 04 '22 at 18:09export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0didn't work for you. That may indicate some other sort of name resolution issue that could cause you other problems down the line, but worry about that if/when it happens. Just keep this comment in mind if you do run into future problems. – NotTheDr01ds Aug 04 '22 at 19:29