running ubuntu cloud image in MS Azure

284 Views Asked by At

I am trying to setup a custom Linux VM in MS Azure. I found a guide, pointing out that there are Azure-ready Ubuntu Images to be found here:

http://cloud-images.ubuntu.com/

What I did so far:

  • Downloaded the Trusty Tahr .vhd.zip file from their website.
  • Unpacked it and uploaded it to a BLOB Storage using Azure Managament Studio
  • Created a new Virtual Disk using the stored .vhd file
  • Created a VM that used the new Disk.

It seems to boot just fine, but when I try to SSH onto its public ip adress it gives me: "Server Unexptectedly closed connection".

If I create a Linux VM from the existing MS-Azure Templates everything works fine, so it doesn't seem to be a network problem on my end.

Anyone done this before? Are there steps that must be done PRIOR to uploading the image to azure?

I've never done this before so a verified step-by-step guide would be highly appriciated.

Thanks in advance!

Regards, Flo

UPDATE:

I updated my resource group with a security group, in which i defined an ssh-in rule. I then linked my VM's Nic to that Group. Heres the inbound rule:

ssh-in rule I am still getting a timeout when I try to connect via putty over ssh.

2

There are 2 best solutions below

4
On

yes, there are some steps you should take - Linux-specific and Ubuntu-specific . Unexpected closed connection can be somehow services-related. You can take some steps from the Linux access troubleshooting guide.

You can take look at what is going on with the Linux boot using Boot Diagnostics and Console. That is the way i would recommend to do first, then try to upload manually.

Then, check if SSH is enabled - go to your VM => Settings => Network interfaces => click on the Network Security Group name => Inbound security rules. Create your 22 SSH rule.

0
On

For anyone coming to this ticket in 2018 please not: you also need to connect the security group to the containing subnet in the security group. It's not enough to do it to the NIC.

Also, do NOT go through this complicated process. There are plenty of Ubuntu images you can use and quickly deploy in the marketplace right from the portal.