rodrigosantosbr

[Fedora Remix] Setting DISPLAY / opening Gui apps

Feb 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

We need to configure WSL to send the display of its graphical apps over to Windows.
If we skip this step, then our graphical apps will attempt to load natively inside of WSL and nothing will show up.

To do that, we need to set the DISPLAY environment variable within WSL and we’ll do it in our .bashrc file so it’s always set whenever we open a terminal.

Run nano ~/.bashrc and then add this to the bottom of the file and save it:

export DISPLAY=:0

The syntax is HOST:NUMBER. In our case we can omit the host and it will bind the display over a local Unix socket. WSL knows how to make this work, so don’t worry about it.

The 0 is the display number which would be the first monitor of the system in the context of WSL. Again, we don’t need to worry about this because once the window is open and running, you will be able to move it across multiple monitors without issues.

To apply the changes run source ~/.bashrc from your WSL terminal.

Add Comment
Please, Sign In to add comment