Aloha!

Late last week I decided to set up an Ubuntu box in Azure with the intention of installing SQL Server for Linux and VS Code on the same box. VS Code is necessary because there is no Management Studio shipped with SQL Server for Linux (command line only, see?) I know, I could use the command line, but I’m lazy and there’s an extension for VS Code called mssql, which funnily enough is exactly what you think it is. It also feels a bit bloody minded to ignore the whole VSCode and mssql extension and just use command line. And furthermore, I would like to get familiar with VS Code and SQL Server for Linux (there must be a shorthand for that by now?!)

So, I set about creating a Linux VM in Azure. And whilst the documentation is well written, it assumes some prior knowledge of using Linux, so I thought I’d link to the relevant “how-to” pages and fill in the blanks here, so that those of you who have never had to use Linux/PuTTY/vi will have an easier time of it.

Creating a VM: How Hard Can It Be?

I used Ubuntu exclusively for 18 months some 8 years ago, and used RedHat in university (over 10 years ago now), and also dabbled in it sometime before. I also worked a little bit on the Firefox OS that was released some years ago, which required building on Linux. [1] But it’s a bit of a dichotomy to use Linux as an OS when working with Microsoft technologies. And using Ubuntu when working with Microsoft products is not easy: I had to use MONO to develop and also the precursor to .NET Core, whose name escapes me right now. This was back in the day when Novell supported MONO, not Microsoft/Xamarin like today. And SQL Server? Forget about it. WINE had nothing of any use. And so after a while of making life extremely difficult for myself I gave up and used Windows 7, which frankly was a huge improvement on Vista.

Anyway, during this time I got acquainted with with apt get and package management and just the whole “how do I” when working with Linux. And Ubuntu moved on a lot from when I first installed it to where it is now. No longer do you have to trawl for drivers across the web. Which I think is one reason why Linux is a legitimate option for less tech-savvy people these days. And so being very familiar with creating VM’s in Azure I thought it would be the exact same process.

No.

Not at all. Not by a long shot. Let me be clear in that whilst creating an Ubuntu VM is not hard, there’s considerably more steps than setting up a Windows VM.

Software You Will Need

Before you create an Ubuntu VM, do yourself a favour and download two things:

Now when you come to create your VM, select authentication type as Public SSH Key and enter the public SSH key in the text box.

The guide here is over-complicated, but useful: ignore the fraff about git bash.

This here is a good guide on creating your Linux VM. Follow only the “Create Virtual Machine” guide and ignore the rest of that page.

Now you’ve created your Linux VM, follow this guide on how to connect using PuTTY.

We’re on the home straight now, but we have to install xRDP and the Linux Desktop to connect to the machine and get a nice pretty UI. The steps are well documented, but there are two key things missing:

If all this results in a VM that doesn’t work, leave a comment.

 

[1] I was a big fan of that project, and was really sad when it got dropped. Just a shame that Mozilla don’t have a bottomless well of cash to throw at a project, because I felt that the idea behind it made sense and would’ve got off the ground were it not for the lack of funds.