Setting up Linux on Windows 10

First thing is to enable Windows Subsystem for Linux. It doesn’t install Linux but gets Windows ready for it. Linux support is Windows feature and it must be activated from Windows Features dialog.

After installing the feature Windows needs restart.

As Windows is ready to host Linux now it’s time to install one. Windows 10 Fall Creators Update supports more than one Linux. I opened Store app and installer Ubuntu Linux from there.

It takes time to get things up and running as after installation there are some configuring needed. User is asked for username and password and everything else is done by Linux from this point. Just wait until it gets done.

Running Linux on Windows

After installing Linux it is possible to use Windows 10 search to run it.

Those who need to run it frequently can also pin Ubuntu to taskbar or start menu.

Installing .NET Core

As I installed Ubuntu Linux then .NET Core installation commands here are for Ubuntu 16 that came from Windows Store.

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install dotnet-sdk-2.0.2

It takes some minutes to get .NET Core installed as after installation it also initializes things.

Running application from local disk

Linux on Windows uses its own file system and disks on machine are visible through mounting. The following screenshot shows how I moved to project folder on test machine and ran ASP.NET Core application. It’s the same folder where I build application on Visual Studio.

And here is the web front-end of my TemperatureStation solution served by Linux on Windows.

NB! I have experienced some issues this far. Sometimes after running ASP.NET Core web application on Ubuntu it’s not possible to close terminal. When closing it from Task Manager then on next run terminal window opens but nothing happens there. In case of any issues please report problems to Windows team using Feedback app.

Wrapping up

Windows subsystem for Linux is easy to enable and install. It makes Linux available on Windows without hardware level virtualization and there’s no need to install Hyper-V or some other virtualization platform. When building multi-platform apps it is handy to have Linux environment available to test and try application quickly. Although I faced few issues when working with .NET Core on Linux this way these issues were not show stoppers and I got my tasks done. Those who build multi-platform apps should give a Linux on Windows a good try.

Running ASP.NET Core applications on Windows Subsystem for Linux的更多相关文章

  1. [转]Publishing and Running ASP.NET Core Applications with IIS

    本文转自:https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications- ...

  2. Asp.Net Core 自动适应Windows服务、Linux服务、手动启动时的内容路径的扩展方法

    public static IWebHostBuilder UseContentRootAsEnv(this IWebHostBuilder hostBuilder) { bool IsWindows ...

  3. 发布到ASP.NET CORE项目到 Windows server 2012

    原文: https://github.com/zeusro/MarkdownBlog/blob/master/2018/2018-01-17-01.md 发布到ASP.NET CORE项目到 Wind ...

  4. ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成

    ASP.NET Boilerplate 学习   1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...

  5. ASP.NET Core 新建项目(Windows) - ASP.NET Core 基础教程 - 简单教程,简单编程

    原文:ASP.NET Core 新建项目(Windows) - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 新建项目(Windows) 对于任何语言和框架,都 ...

  6. asp.net core 托管到windows服务,并用iis做反向代理

    使用NSSM把.Net Core部署至 Windows 服务   为什么部署至Windows Services 在很多情况下,很少会把.Net Core项目部署至Windows服务中,特别是Asp.n ...

  7. WSL(Windows Subsystem for Linux)--Pico Process Overview

    [转载] Windows Subsystem for Linux -- Pico Process Overview Overview This post discusses pico processe ...

  8. Build SSH for Development on Windows Subsystem for Linux

    It seems that Windows Subsystem for Linux (WSL) is getting much more mature than the time when it fi ...

  9. Windows10上开启WSL2(Windows Subsystem for Linux 2)及Docker Desktop For Windows

    什么是WSL2 WSL2(Windows Subsystem for Linux 2)是适用于Linux的Windows子系统体系结构的一个新版本,它支持适用于Linux的Windows子系统在Win ...

随机推荐

  1. face detection[Face R-FCN]

    本文来自<Detecting Faces Using Region-based Fully Convolutional Networks>,又是腾讯ai实验室的作品.时间线为2017年9月 ...

  2. WebApi测试工具:SAEA.RESTED

    写好一个Api接口不知道怎么测试?试试SAEA.RESTED吧——无需任何代码.不污染主项目.快速上手.不依赖IIS,可供多人共享使用!下面就跟着本文查看如何使用吧:1.下载安装:https://gi ...

  3. UVA - 10931-Parity

    题意:1.输入一个数,将其转换为二进制.2.记录二进制中出现1的次数. 注意:转换二进制后直接输出,不能转换为十进制后输出 #include<iostream> #include<c ...

  4. FineUIMvc随笔(7)扩展通知对话框(显示多个不重叠)

    声明:FineUIMvc(基础版)是免费软件,本系列文章适用于基础版. 这篇文章我们将改造 FineUIMvc 默认的通知对话框,使得同时显示多个也不会重叠.并提前出一个公共的JS文件,供大家使用. ...

  5. Item 19: 使用srd::shared_ptr来管理共享所有权的资源

    本文翻译自modern effective C++,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 博客已经迁移到这里啦 使用带垃圾回收机制语言的程序员指出并嘲笑C++程序员需要遭受防止资 ...

  6. ASP.NET MVC5+EF6+EasyUI 后台管理系统(90)-EF 扩展操作

    上一篇讲了EF直接执行SQL与存储过程的用 法 这次我们来看 EntityFramework-Plus(免费开源) 库的用法相比其他扩展库,这个更加新并且用法更加简单 这是一个对Entity Fram ...

  7. .NET Core 2.1中的分层编译(预览)

    如果您是.NET性能的粉丝,最近有很多好消息,例如.NET Core 2.1中的性能改进和宣布.NET Core 2.1,但我们还有更多的好消息.分层编译是一项重要的新特性功能,我们可以作为预览供任何 ...

  8. Oracle记录表删除操作简单方法

    最近项目中Oracle库中一个表log_gpackage有数据丢失现象,但因为没有启用归档,所以CDC和Dataguard都无法使用.google一下,最简单的方法,增加触发器处理逻辑: ---创建触 ...

  9. SQLSERVER事务日志已满 the transaction log for database 'xx' is full

    解决办法:清除日志 USE [master] GO ALTER DATABASE DNName SET RECOVERY SIMPLE WITH NO_WAIT GO ALTER DATABASE D ...

  10. 多线程系列之七:Read-Write Lock模式

    一,Read-Write Lock模式 在Read-Write Lock模式中,读取操作和写入操作是分开考虑的.在执行读取操作之前,线程必须获取用于读取的锁.在执行写入操作之前,线程必须获取用于写入的 ...