Andy Crouch - Code, Technology & Obfuscation ...

Getting .Net Core Running (And Working) On Linux

Man In Orange Suit On Building Site

Photo: Unsplash

Sometimes it would be nice if stuff just worked as advertised!

Arch and Antergos were no good for .Net Core development. I was trying to find an option from the supported list of distributions. I should mention that I am creating VirtualBox installations.

The first obvious choice was Ubuntu which still uses Unity by default. Sorry, but try as I might I just can not get on with Unity as a desktop. After installing Ubuntu Gnome (one of the many great community editions) I was set. And then it broke. No real information it would just show a dialog about a “system crash” and the option to report it. Which I did, several times to no avail. Life’s too short …

So then I downloaded Fedora and installed it and then wondered at the tiny square window on my screen. Full Screen did not work out the box. Tldr; you have to add the kernel headers matching your kernel. Then and only then you will be able to install the VirtualBox Guest Additions. At this point, I rebooted looking forward cracking on only to find I could no longer log into the machine. Every time I entered the credentials the screen would return to the user selection screen of GDM. Life is getting shorter …

Based on Fedora I ruled out RHEL and CentOS as I couldn’t face more disappointment at this stage. So that left openSUSE which I haven’t played with since about 2005! Yet, I did remember that they had created a rolling version called Tumbleweed. So I installed it and after a 10-minute installation sat back and basked in the green glow coming from my screen. Finally, I have a working Linux VM and I followed the online instructions to get .Net installed. I cloned my repo and ran dotnet restore and dotnet run and boom. It broke! openSUSE Tumbleweed does not work for .Net Core due to library conflicts. It should work on the non-rolling version of oepnSUSE if you believe some stories. You will only find this out after a lot of Googling and reading of issue tickets in Github.

So losing the will to live I tried a final time with Ubuntu. Installed it and set up .Net, cloned my repo and a dotnet restore and a dotnet run later and I was up and running. I installed Gnome as Unity was worse than I remember it (RIP Unity anyway). I have spent the last couple of days working with it. It is about as good as working with .Net Core on Linux as I previously described before Arch broke the environment.

This really isn’t a name and shame post of non-Arch Linux distros at all. It is however, showing that a number of the beginner friendly distro’s do not work straight out of the box. Using VirtualBox is one way people first play with Linux and try it out. This stuff should be considered during the testing phases. In talking to a number of other developers they have also suffered the same issues in getting .Net Core to work on anything that Ubuntu on Linux. That’s fine but it should be better advertised. The .Net team need to find a way to better support the fast moving package infrastructure of Linux as well if .Net on Linux is to succeed.