While trying to compile a Linux application on a VPS, I was quickly fed up. I knew there had to be a better way than creating a virtual machine or renting a virtual server to compile these applications on Ubuntu – for Windows. Apparently, Windows 10 introduced Bash on Ubuntu on Windows. A Linux subsystem for native command line integration of Bash in Windows. The install process was pretty easy:
- Open Settings.
- Click on Update & security.
- Click on For Developers.
- Under “Use developer features”, select the Developer mode option to setup the environment to install Bash.
- A warning will pop up; On the message box, click Yes to turn on developer mode.
- Sometimes after the necessary components install, you’ll need to restart your computer. I did not have to.
- Once your computer reboots, open Control Panel.
- Click on Programs.
- Click on Turn Windows features on or off.
- Check the Windows Subsystem for Linux (beta) option.
- Click OK.
- Again, you may have to restart your computer here, mine did not prompt for reboot.
Next we will set up Bash on Ubuntu on Windows
- From here you can open the start menu, open command prompt and type bash.
- Type y and press Enter to download and install Bash from the Windows Store.
- Then you’ll need to create a default UNIX user account. This account doesn’t have to be the same as your Windows account. Enter the username in the required field and press Enter (you can’t use the username “admin” or “root”).
- Input and verify the password you would like to use for the account.
You can now use the command prompt to open bash sessions. I personally use MobaXterm for all of my linux/VNC needs, so I needed to be able to SSH locally to my Bash sessions. To do this, I needed to set up an OpenSSH server on my computer.
Start by uninstalling openssh-server: sudo apt-get remove openssh-server
Then reinstall it:sudo apt-get install openssh-server
From there make changes to the ssh config file:sudo nano /etc/ssh/sshd_config ; disallowed root login by setting PermitRootLogin no Then add a line beneath it that says:
AllowUsers yourusername Make sure PasswordAuthentication is set to yes if you want to login using a password.Disable privilege separation by adding/modifying : UsePrivilegeSeparation no
Then restart the SSH server service:sudo service ssh --full-restart
Your config will end up looking like this:
Then restart the SSH server service:sudo service ssh --full-restart
Congrats, you now have Bash on Ubuntu on Windows set up. You can compile applications , install and run terminal applications and all that fun jazz.
Full native Windows Explorer browsing can be used on the file system by navigating to "%localappdata%\Lxss\rootfs"
To navigate the windows file system from within bash, cd to /mnt/c
For more information and learning resources regarding BOUOW, go here:https://msdn.microsoft.com/en-us/commandline/wsl/about
Otherwise, any Ubuntu 16.04 documentation can be used to troubleshoot and find information on the bash commands and uses itself.
Cool find! Thanks for the info!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit