Xming, Bash on Window System Running from Windows 10 Subsystem for Linux

By Jan 14, 2017

Description:

Xming Bash on Window System Running from Windows10 Subsystem for Linux

Preferencesoft

In this article, we will see how to activate the Windows 10 subsystem for Linux and install the Bash shell. We will see how to install and run certain X-Windows applications.

Installation

If you are a Windows 10 Insider, you have the privilege to install Linux in subsystem on Windows 10.

By default, the Windows 10 subsystem is not enabled, and Bash is not installed.

You can find at the address:

https://blogs.technet.microsoft.com/askpfeplat/2016/05/02/installing-bash-on-ubuntu-on-windows-10-insider-preview

detailed installation instructions.

We give here briefly the steps:

Before, you will need to switch your Windows 10 system in developer mode.

For this

  1.        Open Settings

  2.        Click on Update and Security,

  3.        Click on For Developers and click on the developer mode radio button to enable Developer Mode.

  4.        Close settings.

Next, you need to activate the Windows Subsystem for Linux (WSL)

  1.        Open Control Panel and click on Programs and select Turn Windows features on or off,

  2.        Check the box to the left of Windows Subsystem for Linux (Beta)

  3.        When the installation is completed, click on the Restart Now button.

Then, we ask Cortana to install bash from the Windows Store.

It remains to set up the system.

Enter a username: dark

Enter a password:  *******
Re-enter the password ... 

Once the installation is completed, the C drive is automatically mounted, it displays the command prompt:

dark@pc-atlantic:~$

If you are in the /mnt/c/Windows/System32/ mounted directory, change directory and type:

cd /home/dark
to go in your working directory. In fact, Windows has installed Linux in the C:\Users\TheUser\AppData\Local\lxss directory and we are working in the directory C:\Users\TheUser\AppData\Local\lxss\home\dark

 

Now we can use bash, a Unix shell, in Windows 10.

The basic commands have already been pre-installed, as well as some software such as nano a lightweight text editor (to exit nano type ctrl X).

 

It is possible to launch a Windows application from bash:

/mnt/c/Windows/System32/notepad.exe

 

It is possible to call PowerShell to execute a script in /home/dark.

For example, create with vi the file foo.ps1 containing echo “Hello Linux”.
 Now type the command line:

 

/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe "C:\Users\TheUser\AppData\Local\lxss\home\dark\foo.ps1"

 

The following message appears:

Hello Linux

 

To install a software for example gcc, type its name followed by the Enter key and bash shows information on packages and possibly on their installation.

If you want to install gcc, you would type:

sudo apt install gcc

 

If you have a little too much installed packages, and if you want to reinstall bash then here is how to proceed.

  1.        To uninstall the Linux SubSystem in Windows

    1.        Type cmd in Cortana and right click command prompt (admin)

    2.        Type:
      lxrun /uninstall /full
      And type "y" to continue: y

  2.        To reinstall the Linux SubSystem in windows

    1.        Type cmd in Cortana and right click command prompt (admin)

    2.        Type :
      lxrun /install /y

 

Instalation of the X11 server

To run an X11 app, you must install Xming a X-Window System Server for Microsoft Windows.

You can follow its installation in this video:

https://channel9.msdn.com/Blogs/WinCoder/XMING--Bash-on-Ubuntu-on-Windows--X11-Window-System-Running-from-Windows10-Subsystem-for-Linux

 

After installing Xming, run the application, right click the icon from the bottom menu bar and select "View Log"

Note the IP in this line:

XdmcpRegisterConnection: newAddress 192.168.1.12

In the bash shell, type:

DISPLAY=192.168.1.12:0.0;export DISPLAY

Now, you can type the command:

xterm &

In principle, the X11 terminal appears. But you can try other software like xeyes, xcalc, xclock...

XMing

To play xbill, you must install the corresponding package:

sudo apt install xbill

I tried xview (xloadimage), xpdf and xemacs. It works almost perfectly.

But xemacs does not print anything when you press the print button.

I failed to install a window manager for the X Window System as fluxbox. This is not possible without a change in the configuration files.


Windows

Categories

Share

Follow


KodFor Privacy Policy