I have a Surface RT and going away for a few days, now what??? I have a MSDN subscription :-) (Part 1)

I have a Surface RT and going away for a few days, now what??? I have a MSDN subscription :-) (Part 1)

  • Comments 4
  • Likes

I know many of you have seen the super cool blog post where my fellow team members build a private cloud out of their new Surface Pros. It was a cool idea and people really loved the video.

 

The cool thing about the Surface Pro is that it’s a normal PC and you can run any regular PC program (Silverlight, Java, Live Writer), as well as many other programs.

 

The problem:

I have not bought a Surface Pro yet (my mistake), but I do have a surface RT. I’m really happy with my Surface RT, but it has some limitations that prevent me from doing certain things on it. I recognized this the other day when I was planning on working while away on a trip – but I didn’t want to bring my PC.

Here is what I could not do from my Surface RT:

  • Use live writer (the program I’m using to publish this post)
  • Use Java (this is necessary for several websites I use on a regular basis)
  • Use Silverlight

     

    The Solution:

    I started thinking about how I could solve this problem – and then I remembered that I have a MSDN subscription.

    With MSDN you get the following every month in Windows Azure:

    image

     

    The Scenario:

    I want to build a Windows machine running in Windows Azure, which I can connect to from my Surface RT.

     

    In this first blog post, I will do the setup and configuration (This blog post)

    In the second blog post, I will walk you through how the “gold image” can be uploaded to Azure (Can be found Here)

     

    I want to run the following programs in my gold image

    • Java
    • Silverlight
    • Windows Livewriter

    Just for the fun of this blog post, all of it is written on the Windows machine already running in Azure from my Surface RT (except a few steps), and wanted to capture my learning's in this blog post.

     

    The challenge

    I have been using Windows Azure for a while and started to use a windows 2012 server to connect to form my Surface. One thing that started to irritate me was the entire configuration I needed to do every time. I just wanted to create a gold image that I could use every time I provision a Windows machine.

    So in order to get my own image, I need to do the following:

      1. I need to sign up for Windows Azure (covered in this post)
      2. I need to install App. controller and configure Azure (covered in this post)
      3. I need to build my own image (covered in this post)
      4. I need to move my image to windows Azure from my PC  (covered in the next post)
      5. I need to provision the VM based on my image in Azure (covered in the next post)
      6. I need to connect to the Windows machine using my Surface RT and start writing a blog post (covered in the next post)

     

    Pre-requisites:

    • MSDN subscription with access to Azure
    • AD Domain for App controller
    • Computer running Windows 8 / 2012 with Hyper-V enabled.

     

    Sounds fun, right?  Let’s get started.

     

    I need to sign up for Windows Azure

    With my MSDN I get:

    1500 hours of compute hours

    90 Gb/month

    With this, I have been able to run two small machines in Azure without even getting close to the limit. This, of course, depends on what you do and what you enable, which will be at your own risk and cost.

     

    Here is how you can sign up with windows Azure if you have a MSDN subscription:

    Go to http://msdn.microsoft.com/en-us

    Login with you MSDN Account

    Select Access benefits

    image

    Select ”Activate Windows Azure”

    image

    When you sign up, make sure it says Windows Azure MSDN

    You will be asked for a credit card when activating the subscription. You will only be charged if you use more than you allocated budget.

    NOTE: Any charges that you may encounter in connection with signing up will be at your own risk and cost.

    Go to https://manage.windowsazure.com and sign in with your Microsoft account (same as you use for your MSDN)

     

    I need to install App. controller and connect to windows Azure

    App Controller is a tool that can be used to manage multiple clouds from one console.

    App controller can connect to different cloud environments such as VMM and Windows Azure.

    An App Controller installation consists of the following features:

    • One App Controller server
      • App Controller server hosts a website console for access by using a supported browser.
    • A SQL Server database
    • Windows PowerShell cmdlets

    All these applications can be down loaded from the MSDN download page using the MSDN download area.

    Steps to install App. Controller can be found here:

    http://technet.microsoft.com/en-us/library/gg696046.aspx

     

    Once you have App Controller running following the guidance above, you can sign into App. controller

     

    Configure connection to Azure using certificates:

    On the server where App. controller web server is running follow these steps:

    • First you need to create a Management Certificate:

    To create your own self-signed management certificates, open a Visual Studio command prompt and execute the following command:

    makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My "<CertificateName>.cer"

    E.g. makecert -sky exchange -r -n "CN=WinAzure" -pe -a sha1 -len 2048 -ss My "c:\temp\WinAzure.cer"

    http://msdn.microsoft.com/library/gg551722.aspx

    • Create a Service Certificate for Windows Azure

    http://msdn.microsoft.com/en-us/library/gg432987.aspx

    I used Create a personal Information Exchange Certificate > To Export a .pfx file by using Certificate Manager and place in c:\temp on the App. Controller server

     

    image

    • Select Manage Certificates

    image

    • Select “Upload from the bottom of the screen”
    • Select “Browse”
    • Go to c:\temp
    • Select the *.cer file and click “Ok“
    • Once the certificate is uploaded, select “Subscription ID” in the column and cut this to the clipboard.

     

    Connect App. controller to Azure subscription

    • On the App. Controller server start App controller console as Administrator if not already started
    • In the App. controller console select Settings > Subscriptions and click “Add”
      • Give the connection a name
      • Paste the subscription ID from the clipboard
      • Click browse and go to c:\temp and select the pfx file
      • Give the password used when exporting the file from Cert manager
      • Click “OK”.
    • Click “Ok“
    • Select “Library“
    • Select the newly created Azure subscription
    • Click “Create storage”
    • Give the storage account a name E.g. azurestoragexyz
    • Select “West US” for Region and click “Ok”
    • Select the newly created storage account and select “Create container”
    • Give the container a name and click “Ok“

     

    Build my own Windows 2012 image

    We need to create our own image with Windows update and our programs pre-installed. For virtual images running in Azure, there are a few rules that needs to be followed in order for the image to function correctly. These rules are:

    • Only vhd files can be uploaded and used (VHDX will not work)
    • The image has to be syspreped
    • Only fix-sized images will work.

    As long as these three rules are kept in mind, you should be ok.

    In order to create our own image we will do the following:

    • Download Windows 2012 ISO image from MSDN as well as get a product key and place this image on the server running Windows 2012 Hyper-V
    • Start Hyper-v Manager on the Windows 2012 server
    • Select New > Virtual Machine under “Action Menu”

    image

    • Click Next
    • Give the Virtual Machine a name, e.g. Windows2012Base
    • Select a location for the VM if needed and click ”Next”
    • Assign Memory and click “Next” (Does not need to be more than 1024)
    • Select a network that has connection to the internet and click “Next” (We need internet in order to use windows update)
    • Under Virtual Disk Select Attach a virtual hard disk later and click “Next”
    • Click Finish to create the VM
    • Select New > Hard Disk under “Action Menu“

    image

    • Select VHD and click “Next”
    • Select “Fixed size“
    • Specify the name e.g. windows2012base
    • Give the location where the VM was placed earlier e.g. D:\VMs\Virtual Machines\Windows2012Base, click “Next”
    • Set size to approx. 30 Gb and click “Finish”
    • Select VM created earlier in Hyper-V manager and right click and select “Settings“
    • Select IDE Controller 0 > Hard Drive and click “Add“
    • Click “Browse” and go to the location where the VHD was created
    • Click on “DVD Drive” under IDE Controller 1
    • Select Image file
    • Browse to the location where the Windows2012 ISO file is located (Downloaded from MSDN earlier)
    • Click “OK“

    image

    • Start the VM
    • Double Click on the VM to connect to the console
    • Select language and keyboard, Click next
    • Click “Install now”
    • Paste the license key from MSDN into the field and click next

    TIP: You can use paste from clipboard > Type Clipboard text

    • Select Windows Server with GUI, click “Next”
    • Accept license and click “Next”
    • Select “Custom: Install..”
    • Click “Next”, after some time the VM will reboot a few times after installing the files
    • Specify Password
    • Click “Finish “
    • Wait for the installation to finish
    • Login as Administrator
    • Go to “Control Panel” > “System and Security” > “System“
    • Select Remote settings
    • Select “Allow remote connections to this computer”, uncheck “Allow connections only from…” and click “Ok “

    image

    image

    • Click “Ok” and sysprep will start, when done, the VM will shutdown.
    • Open explorer and go to the directory where the VM vhd is located.
    • Copy the VHD from the Hyper-v server to the App. Controller server. e.g c:\vhdstore
    • Share the folder e.g. c:\vhdstore on the App Controller server

     

    In the next post I’ll explain how you can upload the VHD to Azure, provision a Windows 2012 server to run in Azure, and access it from a Surface RT to write a blog post.

    I have a Surface RT and going away for a few days, now what??? I have a MSDN subscription :-) (Part 2)

    Stay tuned.

    Your comment has been posted.   Close
    Thank you, your comment requires moderation so it may take a while to appear.   Close
    Leave a Comment
    • Hi good idea and fun for diehards, but maybe i have missed something , why not leave you development pc on power and connect to it with RDP ? and program along.

      Michel

    • Hi Anders,

      Why don't you use the pre-configured VMs? Much faster to use and that's what I have been using with my WinRT for months. :-)

      Stefan

    • @Michel

      Hi Michel. You bring up a good point which I did not answer in my two blog posts. YOu could use your home workstation, but here is my reasons why I don't use one. One of the reasons why I don't use my home machine is besause I don't have one (only use my labtop) the other reason is that if I had a Workstation at home I would have to have it running 24-7 and if something happens (power or hardware error) I might not be able to conenct to the machine. In Europe power is quite expensive in some places and if I already have a MSDN subscription I get Azure to pay for the power that the VM is using and I can always replace it or power it on / off.

    • @Stefan

      I could for sure have done that and I did think about doing it, but then I wanted
      to go the extra mile to see what it would take to build my own. I already had a
      local image that had the stuff that I wanted to use, and know it would have the
      latest patches and software I needed.  In addition, if I needed to wipe my
      server I would have to do it all over again, where here I would have an image +
      template where all the basics were already configured and I could re-provision
      it in minutes without losing any work. If you just want the simple solution you
      could follow the blog and skip the section on building image, uploading and
      then install your programs and patches afterwards using a standard azure image.

      Thanks for your feedback