Running an Amazon EC2 Windows Instance

Cloud ComputingHello, first what is Amazon Elastic Compute Cloud (Amazon EC2)? Well you can think of it as having your own server running in one of amazons ever increasing server farms. Or as amazon put it

“Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.”

Basically amazon will rent you a computer, or as they call it an instance, in one of their data centres and charge you by the hour for it, prices range from $0.09 to $2.88 per hour, depending on the instance type you want to use. Once your instance is up and running you can control is in the same way you would any server, via Remote Desktop for Windows or SHH for Linux, depending on how you think. This means you can setup any server from automated remote backup systems to web servers and have it run on Amazons highly efficient infrastructure.

So how about it, you fancy running one of these servers. There’s nothing to lose I’ll talk you through a simple Windows Server setup, and so long as you shut it down after an hour it will only cost you 12 cents, you can’t complain about that.

You will need the following:

  • A Computer running windows (Windows XP onwards)
  • A web browser (Any will do)
  • An Amazon Account

Step 1:

Ok, let’s start, first open your web browser and navigate to When there click the button on the top right saying “Sign Up For Amazon EC2”.

Then you will be asked to log in using your normal Amazon Account, if you don’t have one you can create one here. You will have to go through several screens asking for you contact details, terms & conditions, which debit card you want to use, etc…

Step 2:

Now all this boring account stuff is out of the way, we can get to the interesting bit, actually getting an instance up and running. Click the “Sign in to the AWS Management Console” at the top of the screen to login to the management console. Once signed in you will get a screen that looks like this:

This is the main interface for controlling your Amazon EC2 account, we can control our instances, AMI’s, Key Pairs,  Security Groups  but more on that later. We can also chang the Region we want to use buy changing the menu in the top left of the screen, however for this tutorial leave it at US east.

After having a look around its time to launch and instance, to do this click the “Launch Instance” button in the middle of the screen:

Step 3:

This brings up the window where you select what operating system you want your instance to use. There is a little more to this because you can set up your own operating systems, called AMI’s but for now we will just use one of the provided images. For this tutorial we are going to use the “Basic Microsoft Windows Server 2008” AMI this, we’ll start with windows because its a bit easier to understand once its up and running, to use this click the select button next to it.

Step 4:

The next window is where we choose the hardware settings:

  • Number Of Instances: Here we can choose how many instances to start, for this tutorial leave at 1
  • Availability Zone: For each region there is several data canters, here is where we choose which one we want, for this tutorial leave to “No Preference”
  • Instance Type: Here we choose the hardware to use, “Small (m1.small, 1.7GB)” is the cheapest and smallest therefore we will use it for this tutorial.

Click the Continue button for the next step.

Step 5:

This window is for more advanced setups therefore we are not going to talk about today, just leave everything to “Use Default” and click continue.

Step 6:

Now we have to set up our new Key Pair. A key pair used so we can securely connect to our instance, we wouldn’t want anyone else playing with our server now would we. A key pair consists of two files one will be on the server itself and we will have the other. To make a new key give your new key a name and click “Create & Download Your Key Pair”. This will open up a download window with a .PEM file, download this file to somewhere safe as you will need it later. If you launce a new instance later you can “Choose from your exisiting key pairs” so keeping the key file safe will save you time later on.

Step 7:

Once you have downloaded your Key File you should be directed to the next window, here you will setup the firewall rules for the instance. As default for a windows instance port 3389 will be open, this is so we can connect to it via Remote Desktop, remember if you are using a Linux instance you need to open port 22 for SSH. You may also want to use your server for serving things, shock horror, in witch case you will need to add a firewall exception for these services, for example if you want to run a web server you will need to add port 80 or choose HTTP from the drop down box.

Once you have added all the rules you want,  give the Security group a name so you can use it again later and click “Continue”. Don’t worry too much about this because you can always adjust the rules once the server is running buy going to the dashboard and selecting Security Groups.

Step 8:

Ahh finally we have can launch our instance. This window is just a summary of all the previous steps, when you’re ready to run your instance click “Launch” and now your instance is all running, rite? Well almost, its a bit pointless if we don’t connect to it. To do this we need make sure the instance is running properly, go back to the AWS Management Console and click “Instances” on the right hand side.

Step 9:

Now you will see this window, this is where you can monitor all your instances, connect to them and terminate them. Now you should see your instance is now running (if it says pending wait a minute or two). First of we want to find the address of our instance, if you click on you instance and scroll down in the bottom window you should find a field called “Public DNS:” note down this address.

Now as we are using a windows instance we need to generate a password in order to login, to do this right click on your running instance and press “Get Windows Password”. Oh I forgot to say the crap thing about Widows Instances is that they take 15-30 minutes to power up, just go make a coffee and come back it should be ready by then. After about 15 minutes of clicking “Get Windows Password” will see this window.

Step 10:

Step 11:

You need to open your key file with notepad and copy the entire contents to the text box in this window, then click Decrypt Password. This will then give you the username and password for you instance, note these down. Rite, now you’re really ready to use your instance. You need to open “Remote Desktop Connection”, this can usualy be found under Start>Programme>Accessory’s>Remote Desktop Connection.

Now “Remote Desktop Connection” is open enter the Public DNS address you found and click the connect button.

Hopefully if all goes rite you should see this screen, it’s the lo-gin screen for that remote computer you have just set up, just enter the password we noted earlier and click the arrow. I know it’s one of those annoying passwords (its Case Sensitive) and it won’t let you copy and paste it but I’m sure you can manage ok. Once you’ve logged in that’s it, you’ve got a server running in a Data Center. You can do anything you want with this however no changes are saved if you terminate the server (There will be a later tutorial on how to save the server state), so have fun with it.

Oh yeah, don’t forget to terminate the server when you’re done playing, otherwise amazon will keep charging you, just go back to the “AWS Management Console” then “Instances” and right click on the instance and press “Terminate” this effectively pulls the power from the server and will stop amazon from charging you anymore.

I know this is a long process but next time you run an instance it will be much quicker as you have done all of the setup, you pretty much click Next, Next, Next, Launch. So Well done and I hope EC2 helps you with your computing needs.

Any comments or feedback will be much appreciated.

, , , ,

  1. #1 by Frederick Maryland on October 26, 2010 - 4:38 am

    Great Love your blog thanks for sharing it with us.

Comments are closed.