Scott Hanselman

Using a Surface 2 (RT/ARM) to get actual work done + Remote Desktop + Visual Studio + Azure

November 01, 2013 Comment on this post [35] Posted in Azure
Sponsored By
Using Visual Studio in the Cloud running in Azure

I'm using just a Surface 2 today for work. Remember that the Surface 2 runs Office plus any apps in the Microsoft Store. It doesn't support installing desktop apps like Visual Studio or QuickBooks. It comes with Outlook, PowerPoint, Word, Excel, etc.

I didn't plan on this experiment this morning. In fact, I was supposed to go on a field trip with my son but the bus was full. Because I was going to be out all day I didn't bring my laptop. I had only my Surface 2 in the car, so when I wasn't able to go on the field trip, it was either go home and get a "real" computer or see what I could get done on the Surface.

NOTE: If I had my iPad and a Bluetooth keyboard and a stand, plus a remote desktop client for iOS I could do something similar.

I use it for Hulu, Netflix, Halo, email, Twitter, Facebook, Trello, Calendaring, etc and for that it's great. Split screen is cool, as I did email while watching a show on the plane yesterday. (What I really want is a full Surface 2 Pro but with the same exact size and weight of the Surface 2 proper.)

Surface remoted into Azure running Visual Studio

Anyway, I went to a bagel shop and figured I'd be limited to email today. I had my heart set on working on an project today (hacking on Project Kudu in Azure) and that was nagging at me. I also forgot my power adapter so I had only the battery life that I started with in order to get a day's work done.

I remembered that the Azure team recently added Visual Studio 2013 Virtual Machines to Azure accounts that are hooked up to MSDN. If you connect your Azure to your MSDN you get as much as US$150 in Azure Credits, and I never use all mine.

REMINDER: There are lots of Linux Virtual Machines (hundreds, in fact, if you include the VMDepot gallery of images) as well as a number of good SSH clients in the Windows Store that work on Surface. I use the "Remote Terminal" app. Here is a screenshot of me running htop on my Ubuntu machine where my mailing system runs in Azure. It's usually full screen, but I have the menus open here.
SSH'ed into my Linux Machine from my Surface RT

Here's some of the VMs to pick from. Soon the MSDN ones will move into an MSDN section on the left.

e Visual Studio in Azure

You can pick a VM from a small shared-core with less than a gig to a crazy 8 core 56 gig machine. I picked a "Medium" because it seemed similar to my laptop. It's got 2 dedicated cores and 3.5 gigs of RAM. There's also a 4 core 7 gig one, but since I'm not going to run Outlook or anything BUT Visual Studio (and some other small tools) I figured it would save money if I went a little small.

I named it "VSinTheSky" and noted that both PowerShell and RDP (Remote Desktop Protocol) ports were open in the firewall. I also put the new VM in a datacenter near me, so in the Western US region.

NOTE: Virtual Machines are billed when they are running, and you only pay for storage when they are shut down. Make sure to shut them down if you're not using them.

My friend Javier uses a Large VM for 10 hours a day and says it costs him about $3.60. I am cheap, so I'm using a Medium, so at 18 cents an hour, that will be $1.80 for the day if I work for 10 hours.

Remoting into Azure from a Surface 2 (RT/ARM)

There's a full-screen Remote Desktop client in the Windows Store that works nicely, but I like the sense of control I get from the "MSTSC.exe" desktop client, plus I can resize it a little more. You can run this on a Surface 2/RT with WindowsKey+R, then "mstsc" and enter. You can also save RDP files, as I have, on the desktop of my Surface 2. You can see in the screenshot at the top that there's a "Connect" button that lets you launch your Remote Desktop session directly from within the browser. It'll download and open the RDP there as well.

Optimizing the Azure VM for Performance

Azure Virtual Machines are allocated, I'm told, 500 IOPs (IO operations) per second, per disk. However, a great (and important) optimization is to add a data disk (or several) which gives you 500 more IOPS since each disk gets its own.

Make sure to get an empty disk for your Azure VM

In the Azure Portal, click Attach Empty Disk.

TIP: To save time, if you have a lot of files, a large data disk, or a large project, make a VHD locally on your machine, mount it as a disk (you DID know that was built into Windows since Windows 7, right?) and get it ready. Then upload it to a Storage Blob in Azure and attach it to your VM.

When asked how big you want the disk, pick a large size. Some size you wouldn't think you'd need. Why? Turns out that Azure VHDs are "sparse." You are only billed for actual usage. If you make a 1TB disk but it only has 5 gigs used up, you're only charged for 5 gigs. I made my data disk 64 gigs since I'm just putting code on it for building in Visual Studio.

Remote into your Azure VM now, log in, and hit WindowsKey+X. Click Disk Management and partition and format your new drive. It may end up being your F drive as C is the system and D is for temp space. That temp disk is where the Windows swapfile goes,etc. That disk may go away so don't put anything on Temporary Storage.

I added a DATA VHD in the Azure VM

I also moved my %TEMP% environment variable to D:\TEMP. I haven't measured if this was useful, but it feels more correct.

I moved TEMP to D:

Here's "My PC" on the remote machine now:

My optimized Azure VM drives

It came with Visual Studio installed, I also pinned IE to the Taskbar, installed Github for Windows, Chrome, and VS Web Essentials, as well as Windows Live Writer that I'm typing in right now.

Speed, both Local and Remote

The Surface 2 is just SO much faster than the original. At least twice as fast, to me. It has a 1920x1080 screen plus I was remoted into a VM running also at 1920x1080 and I often forgot which was the host and which was local. There's really no lag when connecting to this machine in Azure. Perhaps it's because I'm using the Windows 8.x Remote Desktop client to connect to a Windows 2012R2 Server? I don't know. It's fast and clear, and I'm doing this from a café. SpeedTest.net says this café has 16Mbs down measured running on the Surface. I get 7Mbs on my LTE device it was also fast, so this tells me that if the VM is near you (the one I made in Azure is just one state over from where I live) then you should see similar speeds.

I thought perhaps the Azure VM had slow internet. Um. No.

Azure VM reporting 381 Mbps down and 72 Mbps up

Not Just a Dumb Terminal

I didn't use the Surface 2 exclusively as a dumb-ish terminal. Since it has IE11 and Outlook, I also did email while builds happened in the Remote Session. In this screenshot I'm setting up the remote machine, and installing Chrome after installing GitHub for Windows. I've got Outlook running there, The Verge, plus Twitter docked to the right. The remote session is the window in the middle. It was also cool to run Music in the background tethered over bluetooth to my new headphones.

Surface2

imageImportant Productivity Tips for using Remote Desktop on a Surface 2 (RT/ARM)

There's a number of small but extremely useful things to remember when using RDP on a Surface.

  • You aren't limited to the Remote Desktop app that’s in the Microsoft Store.
    • Run mstsc.exe and you’ll get the full desktop version of the Remote Desktop Client.
    • This means you can use .RDP files and keep them on your desktop.
    • You can copy/paste files (like I have with the images in this blog post) between your remote session and your host session. For example, I took screenshots from "outside" and pasted them to the desktop of my remote session.
  • The Surface Type Cover has a row of Function keys that are also Charms keys. Invert their function to speed up your hotkey usage.
    • However, if you want to do something like ALT-F4, you're expected to FN+ALT+F4 which is unacceptable to a keyboard focused developer like myself. You can toggle (invert) FN usage with FN+CAPS on a Type Cover.
  • Know your basic hotkeys. Keep calm and use your keyboard.
    • Win+X is something you'll use a lot in both the Remote and Local sessions. You can run command prompts, check device manager, setup disks in disk management, launch apps, and much more. Use it.
  • Find a balance between your touchscreen and keyboard. If you haven’t brought an actual mouse, accept that you'll never be fast on the Surface Touchpad. It’s just too small and too felt-y. It's there for emergencies.
    • Move quickly between touching the screen and your keyboard. Most times – even over a remote desktop session – using touch to drag a file or click an icon will be faster than the touchpad. Touch isn’t a replacement for input, it's an augmentation for what you’re already using.
    • I have found that touch is the fastest way to get the text insert cursor (I-bar) pretty close to where I want it when editing text. I touch, then move one or two to the left or right. I've found this is WAY faster than using the mouse and WAY faster than cursor-ing around with the keyboard.
  • While I made it through the day without a mouse, I think having an Arc Mouse or some small bluetooth mouse would have made things nicer. That said, it wasn't a huge deal as I'm mostly a keyboard + touch person. YMMV.

All in all, I'm impressed. I'm going to keep this VM around. This isn't a setup I will use every day as I have an X1 Carbon Touch, but it's comforting to know that I can go 7+ hours with a Surface in a café if it comes to that.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
November 01, 2013 1:05
I'll be honest, I saw your twitter photo of you setting it up and then immediately logged into my azure account and did the same on my surface RT, pretty neat!
November 01, 2013 1:20

If I had my iPad and a Bluetooth keyboard and a stand, plus a remote desktop client for iOS I could do something similar.


Splitting the screen is a big advantage. I tried to use my iPad for that purpose and every time I wanted to use browser to Google something or check my twitter, or email I lost focus. That is frustrating.
November 01, 2013 1:27
Most temporary dumpings seems to happen into the temp folder in the user's AppData folder these days. I guess to get that going to the D drive you'd have to replace it with a link. If the D drive doesn't count towards what you have to pay it could save you a few bucks over time.
November 01, 2013 1:33
Thanks for the shout out! :)

One thing I've tried and has worked pretty well is using Dropbox as a sync for code along with using Git. As you've shown, the Internet connection is pretty awesome, so the "heavy" use of Dropbox just works. I can make changes to projects, settings, etc. and know that it will get synced. So when I pull the code in a different VM, it just works.
November 01, 2013 1:56
What a cool idea! I think id have to gauge how much credit I normally get but its one of those little nuggets of knowledge that could get you out of a fix one day.

Its a pity you have to put caveats everywhere (like the iPad one) but I understand why.
November 01, 2013 2:16
Tip: although not marked as function keys, the charm/control keys on the Type Cover actually are and the Cover app can set them to be fn keys first and control keys only when you press Fn. Totally agree on using touch instead of the tackpad (no, not a typo ;) even on the new Covers
November 01, 2013 2:31
Wow, this is a seriously nice setup. Wish I'd known/seen about VS VMs in Azure when it came out! However, there are two things that occurred to me though...

1) It would be nice to have a link to the Azure pricing calculator from the dashboard, so that you can gauge what you're considering might cost at that time. I know it's counter intuitive to sales, but as a non-millionaire consumer, I like seeing the price tag of what I'm shopping for.

2) When reviewing VM costs in the bandwidth calculator, it made me wonder what impact does remote desktop access have on bandwidth, and VHD on storage costs? Or any other services that may be needed?
November 01, 2013 2:33
Very cool, I didn't know about the Visual Studio VMs!

It's worth noting that Microsoft recently released an official remote desktop client for iOS.
https://itunes.apple.com/us/app/microsoft-remote-desktop/id714464092
November 01, 2013 3:13
I do Windows Phone development and it is making my tablet decision far more expensive. WP requires 64bit Windows because the phone emulator runs in HyperV. I'm going to guess that you can't run a HyperV VM inside an Azure VM although I hope I'm wrong, I'd do this in a heartbeat.
November 01, 2013 11:06
Hi Scott,

Have you tried - or know if it's possible - to set up software striping on two attached VHDs?
November 01, 2013 17:59
I have the Pro and I am awaiting the shipping of my pro 2, as I had held out for the more robust 256 and 8 GB of ram. I have noticed a distinct advantage in this approach with VMs and the surface line. I will not this though. If for some reason you do not have your peripherals, such as a keyboard and mouse, then don't bother trying. though it can be don't the productivity is so greatly reduced it is excruciating. Of course these environments were not meant for touch so that has a major part of it and I under stand that. I am just saying if you get a surface then get yourself a good mouse and keyboard if you are planning on this level of work.

As a side note does Azure have a solely based VM environment that is handled from a browser? I guess what I am asking is this. Does azure allow for a HTML5 interface to access the cloud VMs? if not this would be a solid for them to create.

November 01, 2013 19:35
How does it work if you want to span two monitors?
November 01, 2013 20:24
I'd be interested in reading a follow-up in 1 or 2 months. If you use it enough to warrant one. Just to see if the cost stays constant and within your expectations.

I'm asking not just for myself, but because we utilize a lot of off-shore developers that currently use VM's that we provision in our data center. And we get charged out the WAZOO for the storage and maintenance. Some of these VM's are set up with very specific parameters and pre-loaded with the apps and code that the devs will work on.

We also have a few legacy applications that require some old third-party tools and apps be installed (Crystal Reports ugh.) and it would be nice to have a small VM's in Azure that we could spin up.
November 02, 2013 14:37
Hi Scott,

Great tip, really love it and already have a beautiful Dev environment in Azure.

One question. You moved the %Temp% to point to the temporary drive. However, you are not sure what happens there, so azure could as well remove the Temp folder. What happens if you have your %Temp% point to that location and after a reboot this location is gone?

Thanks!

Erik
November 02, 2013 14:46
Hmmm that was a stupid question, the Temp folder is created automatically. Sorry!
November 02, 2013 21:13
Well, that is one great idea - I have been trying to Setup Windows 8 on a Macbook Mid 2009 for Windows Phone Development but Apple does not Support Win8 on this machine - I guess the VS in the Sky should work fine on that mac ;D
November 03, 2013 21:39
Is there a way to do the same thing for windows 8 app? Windows server can't create windows 8 app.
November 05, 2013 11:37
Scott, are there PowerShell scripts to spin the VM up and down from desktop icon or command line? Unfortunately, CLI tools won't install on RT although the .net framework an powershell is there.
November 07, 2013 21:08
@Anthyme,

For Windows 8, you can configure a Windows Server 2012 VM with Visual Studio 2012, as outlined in this post by Keith Mayer.

November 08, 2013 12:54
can i use my vmware vhd because that is much customized for me?
November 10, 2013 21:02
Hmm, wondering whether this is doable on a chromebook for a really cheap and portable dev machine?
November 12, 2013 5:49
@Thomas:

MSDN has some info on powershell commandlets that may shed some light on what you want to do.
November 13, 2013 23:12
This might be an extraordinarily silly question.

I was wondering if it were possible to have two profiles for the same VHD. Meaning can I create a Medium instance for use when I don't care about speed...but create a large one for when I do...but only have one OS disk configured...
November 14, 2013 4:44
Software moves fast.

Think this is the soonest that an article went from publish to "outdated" that I've ever seen.

Referencing VS Online, that is.
November 15, 2013 22:07
Scott, do you have tip on shutting down the virtual machine on schedule? I suspect that shutting down the machine from a scheduled job inside the virtual machine is not the same as stopping the machine from the Azure portal. I guess I could schedule a cmdlet from another machine but I wonder if there is a better way.
November 16, 2013 11:04
I have found the question to my own question. After I shut down my virtual machine from within, and wait long enough, Azure will recognize that the machine is stopped and change the status to stopped. So the easiest way to schedule shutting down a machine is to schedule the shutdown command inside the VM.
November 19, 2013 1:47
Scott, you said it costs 1,80$ for full day of work 24 hours, right?
November 19, 2013 21:32
November 21, 2013 6:56
It's worth mentioning that Azure still bills for a VM that is just "Stopped", to stop billing you need to make it go "Stopped (Deallocated)". If you shutdown from the client OS, it only goes Stopped. You need to use the portal, PowerShell or Command line tools to get it deallocated.

http://www.windowsazure.com/en-us/pricing/details/virtual-machines/

For details, have a look at "FAQ How can I check that I have properly stopped a VM and that I am not being billed for it?"
November 27, 2013 21:57
'm also going to move my blog from my Win 2003 VPS to my own dedicated Win 2008 x64 servers on MaximumASP to improve the quality and apply some changes. Installing UrlScan is also the first task in my TO DO list on all my dedicated servers and VPS's.
December 04, 2013 1:28
"It's worth mentioning that Azure still bills for a VM that is just "Stopped", to stop billing you need to make it go "Stopped (Deallocated)". If you shutdown from the client OS, it only goes Stopped. You need to use the portal, PowerShell or Command line tools to get it deallocated."

This caught me out when playing with a config at work, £64 later :(
December 12, 2013 1:55
NOTE: Virtual Machines are billed when they are running, and you only pay for storage when they are shut down. Make sure to shut them down if you're not using them.

I'm pretty sure that is NOT true.
Although I had shut down my 1 VM, "Compute Hours" continued to accrue @48 / day (Medium VM).
You must make sure your VM's staus is "Stopped(deallocated)", not merely "Stopped".
See here: http://www.windowsazure.com/en-us/pricing/details/virtual-machines/#
CB
December 13, 2013 3:48
Great points - I love using my Surface 2. The Fn + Caps combination does the same thing on a Touch Cover.
One thing that is seriously missing on the Surface, and WinRT in general, is a blogging client. Microsoft would do well to port LiveWriter. It's exactly enough blogging platform. Word is too big (and doesn't upload images to Community Server blogs), Notepad is too small, Internet Explorer editing over the web is too remote - inconvenient on the bus, which is where most of my ideas seem to come.
December 13, 2013 12:34
Scott thanks for the article.
But... Would you like to tell me how much per month I should pay for dev environment like above in Azure?

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.