free html hit counter
Posted on: Tuesday, 24 January 2017 by Rajiv Popat

I’ve always been both; a windows and an Ubuntu user. I’m not an OS zealot and I love both operating systems. My work machine runs on Windows and one of my two laptops at home has been on Ubuntu for a very long time. I love windows because it’s convenient. I love Linux because it’s powerful, seriously geeky and free. Which is why when .NET core team announced the ability to run on multiple platforms (including Windows and Linux), the announcement was like music to my ears. This meant that I could be on the OS of my choice (or fancy) and still do development on a language I love (C#).

I had already played around with using Visual Studio Code as a full-blown IDE and had realized that with the right plugins it’s possible to be fully productive on it. The only missing piece now, was SQL server for which I would always need windows. And then the SQL Server team announced that they’ve added support for multiple platforms as well and you can now run SQL Server on Linux.

This meant that I could now use Linux as my primary OS if I wanted; and that was an itch I really wanted to scratch. This of course, meant that it was time to test where Linux was as an operating system when it comes to being a primary operating system for me as a .NET developer. I’ve already had one laptop with only Ubuntu for ages but I just use that machine for surfing, browsing, watching YouTube and sometimes writing books or posts. Using Linux as a daily driver was going to be completely different. This time around, my goal was to find if I can use Linux as my primary operating system.

With this goal in mind, I decided to look at various Linux Distributions and pick one for my work life. This post is more of a running diary of my experience.

Since my organization wasn’t fully ready to move me to Linux (we’re an all windows shop), I decided to get Linux on a VM and spend most of my work hours there for a few days before jumping in fully. Given that I have 8 GB of Ram and over 200 gigs of disk space with an I5 processor I figured I can have substantial horse power in my VM to spend my work life inside the VM. And because this was going to be a work machine I wanted to try out distributions other than Ubuntu – which is what I’ve been using for years. Why? Because I wanted variety and spice in my life.

After looking at various Linux Distros these are what I short listed:

Mint Linux:

Apparently, this seems like the simplest version of Linux that you hop on to when you move on from the Windows world. Under the hood it’s Ubuntu but it looks and feels more like windows. Which is why a lot of windows users who move to Linux and are confused by Unity in Ubuntu like Mint better. For me, if I wanted an OS that looked and felt like Windows, I was already on Windows and I could just stick to it; so, Mint was not something that appealed to me.

Elementary OS:

I went and grabbed a copy of elementary OS and installed it on a Virtual Box VM only to realize that with 8 GB host, and 4 GB on the Virtual Box the OS was still slow and choppy. When I did that however I wasn’t aware how large an impact on performance small settings like enabling 3D acceleration and GPU allocation can have on the overall speed of Linux on a Virtual Machine, so in all likely-hood it wasn’t elementary OS that was an issue but probably bad configuration on my part.

I read a few posts mentioning that Elementary OS works much better with VMWare Player (which is a free product for trying out and personal use) than it does with Virtual Box so I tried it on VM-Player and it was better; but since this was meant to be a work VM, using VM-Player for work related VM’s wasn’t allowed by the VMWare license anyways. So, I dropped the idea and deleted the VM.

At the end of the day, if Mint looks like Windows, Elementary is inspired by Mac and if I loved Mac machines, I would get a Mac. So the choppy performance of Elementary on a Virtual Box and the fact that it’s inspired by Mac, ruled it out as a distribution that I would pick for myself at this point of time. There is a high chance I may have used it if the performance on Virtual Box would have been better and there is a good chance I’ll revisit Elementary sometime in the future because I genuinely liked and appreciated the user interface but for this evaluation I moved on to other distributions.

Fedora:

I grabbed a copy of Fedora and got it installed, up and running in no time. The Gnome based desktop is… for lack of a better word.. extremely classy. The OS was fast and slick and worked extremely well. I was about to settle down with Fedora, when I realized that the chrome installation that I had done on the OS just doesn’t work. No Errors. No warnings. Chrome just doesn’t start. Actually, chrome starts and then disappears. No Windows. No Screens. (I later encountered a similar issue on Ubuntu and fixed this by starting chrome without GPU and then disabling hardware acceleration using chrome settings. For more details on this fix see the ‘Chrome Blackouts’ on Ubuntu section of this post or read on).

I later moved on to .NET installation and realized that DotNetCore keeps giving an initialization error every time I try to do a “dotnet new”. The command fails with initialization errors. This is because Fedora 25 is not supported by DotNetCore. Turns out, there is a bug in .NET Core which makes it require version 52 of ICU Library and Fedora 25 has a higher version. Here is an unofficial fix but I wasn’t able to make it work; and after wasting hours on this I moved back to the familiarity of Ubuntu.

Ubuntu:

After having tried out three different Distributions I ran out of patience (and almost an entire day) and decided to eventually settle down with the known territory of Ubuntu. Unity is a controversial topic. Some folks love the UI, others can’t stand it. I personally have no issues with it since I’ve used Unity for months on my home laptop and am happy with it. But then having tried Fedora, I had also fallen in love with Gnome 3 and because this is Linux, I realized there was nothing stopping me from running Gnome 3 on Ubuntu. So I did just that and grabbed Gnome 3 on top of Ubuntu after I had installed base Ubuntu. Of course, I could have fetched Ubuntu Gnome directly but I like the manual way better because it lets me switch between Gnome 3 and Unity whenever I want to (or at each login!). I also love the Arc theme so I decided to grab that and install that using the Gnome tweak tool. Eventually however with Gnome 3, I settled for the default Adwaita theme.

Note: Version 16.10 of Ubuntu somehow doesn’t seem to play nice with VMWare Player on my machine, and causes Kernel panics and the famous ‘CPU has been disabled by the Guest OS’ error. However, it worked fine with Virtual Box which is nice because Virtual Box was my preference for virtualization to begin with.

Long story short, at this point, I had the familiarity of Ubuntu, and the newness of the Gnome 3 User Interface that I experienced with Fedora. The best of both worlds:

So I was on Ubuntu with Gnome 3, but I was still far away from making this machine my daily driver. There were multiple other hoops that I had to jump to make this machine usable as a daily driver.

Sound Card Issues:

With Ubuntu installed on my virtual machine; I realize that sound doesn’t work with Ubuntu on Virtual Box. Turns out, after a certain version, Virtual Box doesn’t seem to pick up the right sound card drivers to be used for host and guest operating systems and you need to pick them up manually. For me what worked was Windows Direct Sound on the host and Intel HD Audio on the guest operating system.

I then go to the sound settings of Ubuntu and crank up the volume to maximum value allowed. Actually, I crank it up to 140% of what’s allowed:

Sometimes when I want to sound to go louder I have to go to the terminal and crank up the sound even louder with aslamixer command:

And then the sound works fine. The next thing I was going to need if I was going to use this machine on a daily basis was a stable browser like Chrome.

Chrome Blackouts:

I go ahead and grab chrome and am just about ready to work; when I see a blank black screen each time I start chrome. To fix this I start chrome without a GPU using the command:

google-chrome -disable-gpu

From my terminal window and once chrome starts I disable “Use hardware acceleration when available” by going to Chrome Settings and then into Advanced Settings of Chrome.

Note: This same fix works on on Federo where the chrome window disappears after you click on the chrome icon.

Sluggish Speeds:

My Virtual box is now up and running; I have a browser and sound; but the performance is still sluggish. I crank up the GPU to 128 MB and select ‘Enable 3D Acceleration’ from the virtual box settings which considerably speeds up the virtual machine and makes it fast. I also grab CompizConfig Settings Manager so that I can tweak animations and I disable them to make my system move faster. This speeds up my Virtual Box considerably and makes it actually extremely usable.

But What About Email?

With the basic setup of the OS complete, my next concern is email. Because we use Office 365 at my organization and Exchange at my client’s organization, I needed something that works seamlessly with Exchange Web Services and while evolution comes pre-installed in Fedora, Unity comes preloaded with Thunderbird; which, based on what I’ve read doesn’t work with Exchange services as of this writing. So I grab a copy of Evolution in my Ubuntu and configure my Office 365 emails with it.

Configuring Office 365 emails was relatively easier, though Evolution does tend to loose your preconfigured account the first time you configure them. If that happens open your process monitor, kill all threads of evolution and start fresh and there is a high chance you might find your accounts back. I ended up creating the accounts thrice and then found them all when I killed the evolution threads and started evolution fresh. Then I deleted all of them and re-created a single fresh account. This was of course a one-time issue and things have been fine once the accounts are configured.

Configuring Office 365 accounts were easy. With on premise Exchange accounts however things get a little more complex to troubleshoot. Because my client uses NTML based authentication and Evolution detected that as Kerberos; I kept getting the following error message:

The reported error was "No response: SPNEGO cannot find mechanisms to negotiate".

Finding out what the issue here was mostly a hit and try exercise where I tried to use basic authentication and that didn’t work so I moved to NTLM and that worked.

Site Note: the lack of support for Exchange in mature email clients like Thunderbird and the fact that you have to shell out 10$ a year to get an Exchange plugin in Thunderbird is a little disheartening. I have no issues with paying developers for the hard work they put in, but paying to accomplish something as simple as checking email when your entire OS is open source (and free) and every other app on your machine is open source is, for lack of a better word… a little… ironic. So I decided to grab Evolution which supports Exchange free out of the box and battle out the issues. And it paid off. Evolution has been working well both with Office 365 email account and with Exchange email account and I am actually starting to like it a whole lot.

For those of you who haven’t used evolution, the only thing I missed, compared to outlook was free text search. Turns out, Evolution has a very powerful advanced search and you can also turn on expression based searches:

Visual Studio Code:

With everything else configured I set out to load Visual Studio Code (the primary reason why I started to spend a day on making myself a Linux Work VM). Getting Visual Studio Code itself is super easy. You just download the package and you install it using the Application Manager. However, when I start Visual Studio Code I get a blank black screen. This reminds me of the black window in chrome so I go ahead and look for a similar fix. You just start Code without the GPU:

code --disable-gpu

But because we cannot be doing this each time we add this as an alias in our ~/.bashrc file (or in my case I just add it to my ~/.bash_aliases file which bashrc file references which just helps keeps things clean):

alias code='code --disable-gpu'

Once you’ve added the line you need to close your terminal and start it afresh for the alias to kick in. Caveats? First, you can’t open Code from the Icon in Gnome. Second, you can’t do a “Code .” and expect “.” to represent the current folder you are in when working on the terminal. You need to open Visual Studio Code and then do a File / Open… which is not that bad.

Next I follow these instructions to install DotNetCore on Ubuntu 16.10. Then Install the usual plug-ins and I am in business:

And so, with the development environment in place we are now going to need a DB to work with.

SQL Server:

SQL Server installation was by far the smoothest. You just follow the instructions here and then you follow these instructions for installing the client tools. SQL Server claims to require 4 GB RAM but I barely notice any slowdowns post install and the DB has been running blazing fast. I’m actually really impressed with the DB performance thus far.

There are no UI tools like SSMS for SQL Server on Ubuntu so I grab the DBeaver and use that as a visual editor for DB design.

To be honest the performance of DBeaver in a Virtual Box with 4 GB of RAM is extremely sluggish and it tends to slow down the entire VM. At the danger of offending and triggering Eclipse fans, it’s a trend I’ve seen with a lot of other applications that are built on Eclipse. I then move to SquirreL SQL which is light weight but only provides query capabilities and no Drag and Drop DDL capabilities.

I’m still looking for a visual database development tool but for now, between the command line, SquirreL and DBeaver I should be good.

And A Shared Folder with the Host OS:

If you’re going to run in a VM Mode you will probably want a shared folder with the host OS which you can mount automatically so that anything you save there is also available when you are not using Ubuntu. I do that by sharing a specific folder on my host OS with Ubuntu using Virtual Box settings:

And then I run into permission issues where I cannot access this folder from Ubuntu which I solve by adding my current user to the vboxsf group.

And I’m set for now. All ready to take my newly created VM for a spin and because my VM is just 12 Gb, I decide to take a full backup of my VDI file instead of taking a snapshot. My entire disk file size after installing everything I need, is about 12 GB, so it’s still a file I can carry on a 16 GB drive.

My Overall Experience:

I’ve been a happy Linux user on and off on at-least one personal laptop for over 15 years and Linux has come a long way, but even today, every time I decide to spend a day with various Linux distributions to see where they are and play around with them or try to expand the scope of Linux in my life, I encounter some hurdles which I have to jump and I eventually end up learning new things. That is what makes me angry at Linux sometimes. It’s also what makes me love Linux most of the times. Let’s just say it’s a healthy relationship – the kind that you have with your friends, wife or your kids. :)

If you’re an average office user who is Installing Linux on a bare metal modern day laptop, Linux has indeed come a long way, is very usable and your learning curve might be minimum. You probably can get started almost as easily as you do with windows. But if you plan on using Linux as a primary work machine (especially in a Virtualized environment because your office is on windows) there is a high chance you’ll hit a few bumps but among the dozen odd distributions of Linux and a couple virtual machine solutions and a couple of dozen workaround, you should not take more than a couple of hours to be completely up and running and that (genuinely; without the slightest tone of sarcasm in my voice) is not such a bad thing at all.

My overall experience after spending a day playing with Linux with the idea of using it as my primary work environment is that it has come a long way and I encourage each one of you to try it for a month as a primary work OS; even if it happens to be on a VM! With Visual Studio Code, .NET and SQL Server all running on it, there should not be any reason why you aren’t taking Linux for a test drive.

On another different note, I am loving the new Microsoft for making things like this even possible. It takes a lot of courage for a company of Microsoft’s size to embrace a truly open world where everything they build from Development platforms to development tools and even databases run on multiple platforms.

Here is a big thumbs-up to both the DotNetCore team and the SQL Server team for embracing openness. When we have open choices like these for developers, everyone wins. I’m genuinely impressed with what I have experienced and I’ve been on this VM as my primary machine for a week and nothing has broken. Pure Awesomeness.

Update: After using the Virtual Machine for a few days I finally took the plunge and decided to move to Linux on my work machine. All the GPU issues I had to work around in this post are non-existent on a bare metal install and the same Ubuntu + Gnome combination has been working really well for me during the past few of days.

Name
E-mail
Home page

Comment (HTML not allowed)  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview