Migrating a Windows Home Server guest machine from VMWare Virtual Server 2.x to Hyper-V

I was running a Windows Home Server under VMWare Virtual Server as a guest machine. It had a dedicated 750GB hard disk to host a fixed size virtual disk spanning entire hard disk.

These days I am migrating this and other virtual machine to the Hyper-V 2008 R2 free server and here is how I did migrate it.

  1. Uninstall Virtual Server Tools from guest machine (this is important at this point in time because later it can’t be done easily through add/remove programs).
  2. Shut down guest.
  3. Copy all VMDK files to a spare (new) 1.5 TB Seagate disk. This step isn’t strictly necessary but it was for me because the source disk had troubles reading some sectors – if I wanted to proceed I had to have all the files on a good disk. This step took something like 4 hours over 1Gb LAN.
  4. Download and run VMDK to VHD Converter.
  5. Convert VMDK files (as input select the one without numbers if your virtual disk is partitioned across many files, i.e. SomeDisk.vmdk). I converted to the same hard disk (it barely fits) and it took something like 7 hours.
  6. Copy the resulting VHD to the Hyper-V server (I could pick the server as target location in step 5. but I felt more comfortable doing conversion locally). This step again took something like 4 hours.
  7. Create a new Virtual Machine on Hyper-V server, attach the resulting VHD file as its disk.
  8. Run the machine, activate OS (it will detect “huge” hardware change and it will require activation).
  9. Install Integration Services (Action/Insert Integration Services Setup Disk on connection window) and that’s it.

Lessons learned:

  • Hard disks are growing fast in size but network speed doesn’t. Thus such transfers will be slower and slower due to the sheer amount of data to transfer between disks.
  • Such operation might take whole day
  • If you use an external disk like I am then you should really stick with e-Sata instead of USB 2 or firmware (it is up to 4x faster)
  • Have enough free space on hard disks

An odd error when adding items to toolbox in Visual Studio 2010

Ever got an error like this when trying to add a toolbox item?

image

Textual representation (for search engines):

---------------------------
Microsoft Visual Studio
---------------------------
Could not resolve mscorlib for target framework '.NETMicroFramework,Version=v4.1'.  This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.
---------------------------
OK  
---------------------------

and here is another one:

error

---------------------------
Microsoft Visual C++ Runtime Library 
--------------------------- 
Runtime Error!

Program: C:\Program File…

R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application’s support team for more information.
---------------------------
OK
---------------------------

The later one is really useful.

Note: It isn’t strictly linked to v4.1 – it happens with earlier versions as well.

Another side effect is that toolbox is somewhat corrupted, only certain tabs are loaded. But fear no more, here is the culprit and the workaround we found.

It turns out that there are problems when .net microframework is installed and its assemblies can’t be loaded.

Update (23.12.2011)

Microsoft wisely broke the link to the thread containing the solution - the solution thread has vanished into the black hole of the internet.
So, here is the solution as far as I remember :-):
Rename the files (or delete them) FrameworkList.xml which are installed in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.x\RedistList. Note that each .NET Micro Framework installs its own file in its own folder.

Comparing heating costs using Silverlight

Out of curiosity I’ve decided to compare actual heating costs versus theoretical heating costs. The calculation shows how much it would cost If I used a modern conditioner instead of a centralized heating provided by city and fuelled by natural gas. Hence I crafted a simple Silverlight application using DevExpress Silverlight components (which helped a lot, but that’s another story).

The default data is my data for January but you can enter your own. While the application is in Slovene you can pretty much understand the huge difference just by looking at the chart below. So much for naively believing that heat provided directly by fire is the cheapest one.

Follow this link to the heating cost calculator

Waiting for a tablet

It has been quite a while since I’ve started thinking about an e-Reader. The primary reason is that I have a bunch of e-books (many of them from Manning). I bought them with an e-reader in mind. However, they are in various formats, PDF among them.

The mainstream e-reader is still a 6” device with a single 9” out there - Kindle DX which is quite expensive and run by Amazon. This could be a worrisome fact – they demonstrated it twice at least: first they removed legally bought books from e-readers just like that (ironically those were Orwell’s) and they denied hosting Wikileaks on their cloud servers because of a single phone call made by a politician. Being at the mercy of such a company isn’t really something good, is it? Anyway, the thing is that 6” devices are suitable for displaying more or less e-books only, not all e-content (think PDF) due to the screen size. And e-readers with bigger screens are not coming yet, are they? During this time iPad happened  which shows that a tablet is a good alternative to e-readers if properly done (plus it can be used for many daily tasks where e-readers simply don+t work). Thanks for that, iPad. Hence I shifted my focus to tablets.

Here are my requirements for a tablet capable of displaying e-books in various formats, reading e-mail, surfing, etc:

  1. Real battery life at least 6hrs
  2. Screen resolution at least 1024x600
  3. Screen size at least 7” (not sure if I rather set it to 9” – have to check them in real world)
  4. Not being at the mercy of anybody for content installation
  5. Applications can be developed on PC (.net is preferred)
  6. A decent chipset (nVidia Tegra 2 looks the best bet right now)
  7. Open architecture with an option to install custom OS (when the manufacturer stops supporting it)

So let’s start with the eliminations.

iPad

I’ll never buy iPad due to the conflict with requirements 4, 5 and 7. My biggest problem with iPad is the Apple politics behind it. If you have it then you are at the mercy of Jobs who decides what are you allowed to run, install, share and read - Apple censors content for no reason, at least they don’t even try to explain it, Wikileaks application was one of them. From the hardware point of view it is a fine device though.

Windows 7 tablets aka slates

There are some and come in various forms and factors. However, none of them makes it over my first requirement. They are slow, too - thanks to Windows 7 not being optimized for tablet format. I could survive slowness but not being able to run over 3hrs straight is a complete showstopper. Imagine, you just boot Windows 7, open Word and your document within it and you have to recharge already. It is beyond me why the manufacturers even bother producing them. The only bright point here is that Microsoft announced support for ARM and SoC with forthcoming Windows 8. I guess I’ll have to re-evaluate Windows based tablets in two years or more.

Chrome

No idea.

Android

Which leaves the Android based tablets as the only alternative. Currently the only decent one is Samsung Galaxy Tab which is heavily overpriced. It is more expensive than iPad even though it features much smaller display (7” compared to iPad’s 9”) and a free open source OS. Furthermore it is running Gingerbread (or is it Froyo) without any upgrade commitment from Samsung (you can’t just use stock Android due to Samsung’s customization).

The real deal are many Tegra 2 based tablets running Honeycomb announced at CES and I guess many more are coming in the near future. I think this spring there will be enough tablets on the market to choose from. I don’t know yet which one I’ll buy but I am skeptic about Motorola and HTC. The first one because of Milestone fiasco .They released the same hardware as Droid in the US which is a Google reference device. Meaning Google support and stock Android. But they released its twin as Milestone in EU as completely closed system with rare and very late updates (requirement 7) as if EU doesn’t deserve and open device. Screw you Motorola. Nor do I trust HTC which, rather than supporting their phones or putting some effort and care into them, releases new and new models almost monthly. Not saying others are better or worse but I just don’t trust these two.

To be honest Samsung is very bad at supporting as well. Just look at their flagship Galaxy S phone which could be much better. Having a top notch hardware is FUBAR slow due to the incredible stupid decision to use RFS as their file system. You have to use one of the lagfixes to see it fly. OS customization bloat named Touch Wiz doesn’t help with upgrades - The OS upgrade speed shown so far is poor – upgrading to Froyo took them around 6 months.

I don’t know about other manufacturers but I assume they can be even worse. Hence I’d really appreciate a tablet running a stock Android or the possibility to install a stock Android. This way updates would be piece of cake. This is valid for phones as well, not just tablets.

I am still optimistic for this spring. Am I too demanding?

Righthand DataSet Visualizer goes 1.0

As a New Year’s gift I’ve fixed few bugs in Righthand DataSet Visualizer and set its version to 1.0.

Here are some changes:

  • uncompressed assembly is a bit larger due to avoiding compression within merged assembly.
  • RowState is visible again
  • some grid drawing related fixes

Read more about Righthand DataSet Visualizer here.

Download the newest and older versions from download section.

2008 version is here.

2010 version is here.

Capture DirectX 10/11 debug output to Visual Studio

Working with default DirectX configuration in a Visual Studio project is like working with a black box. Even more so when you have a managed code project. Mostly you’ll get an ArgumentException saying “Additional information: Value does not fall within the expected range.” or something like that, almost totally not helpful. But fear not, there is a way to capture a ton of useful information right into Visual Studio’s Debug output window. And here is how:

0. I assume you have DirectX SDK already installed.

If not download if it from DirectX Developer Center.

1. Enable debug output in DirectX control panel

a) Go to Start/All Programs/Microsoft DirectX SDK ([Month] [Year])/DirectX Utilities [(64-bit)] and run DirectX Control Panel [(64-bit)]

image

b) Go to Direct3D 10.x/11 tab. Except for the Edit List… button everything is disabled. The reason is that you have to add applications you wish to debug beforehand you can alter the settings (this is not obvious and UI is really clumsy here).

image

c) Click Edit List… and add your application to the List of process or folders. Clicking on […] button and selecting application exe file does the trick. Click OK button to close this window.

d) Next step is to actually enable debugging of the application. This can be done in two ways – either select Debug Layer’s Force On or switch on debugging directly from code (shown later in step 2.). You can select which messages won’t be displayed through Mute settings.

image

2. Alternatively to enabling debugging from step 2d)

You can create the DirectX device in code with CreateDeviceOptions.Debug option, like the code below when using managed code and Windows API Codepack:

D3DDevice device = D3DDevice.CreateDevice(null, DriverType.Hardware, null, CreateDeviceOptions.SingleThreaded | CreateDeviceOptions.Debug, levels);

This option will work with both Applications Controlled and Force On Debug Layer settings but not with Force Off.

3. Enable unmanaged debug output in Visual Studio project

The final step is to allow showing unmanaged debug output in Visual Studio debug output window. This works by default in an unmanaged project but not in managed projects. Note that it is a per-project setting.

Open project properties, Debug tab and make sure that Enable unmanaged code debugging option is checked.

image

Here you go. You’ll see plenty of DirectX messages in Debug output window from DirectX such as:

image

Disabled post comments due to spam

Due to the massive spam amount I was getting these days I’ve opted to disable all comments to my posts for the time being. When I figure out a proper anti-spam system I’ll re-enable them, perhaps through reCaptcha or something.

You can still send me the feedback through the Contact form.

Stay tuned.

A good use of an old Windows Mobile phone

Before owning an Android phone (Samsung Galaxy S) I had a HTC TyTN II which is a Windows Mobile 6.1 device. Until recently it was lying in a drawer because I didn’t know what to do with it. I didn’t want to give it away because I was afraid to turn the new owner into an enemy due the the poor quality of the phone. Anyway I am a so-so happy Android user now.

But recently I had to travel to Italy here and there and I was really lost without an internet connection to my laptop. Sure, I could use roaming, but I am not that rich. I figured out that the cheapest way to get connected in Italy is to buy an Italian prepaid SIM card, from TIM in my case. During the buying process I encountered two peculiarities.

1. The vendor asked me for ID. ID? For prepaid SIM card? I learned that they have this fabulous anti terrorism law in Italy that forbids vending SIM cards to anonymous users. Never heard of it in Slovenia. They even forbid vending more than 4 cards to a single person if I recall correctly. Go figure.

2. The guy asked me whether I want to use internet on my phone or on my laptop. Phone of course, why would I pay a premium price? After all Galaxy S comes with a mobile access point and I though it would be fine. It worked in Croatia just fine. Surprise, surprise, it doesn’t work. It works if I access the internet from my phone but not through an access point. After speaking with a fellow MVP network guru Miha Pihler he figured out that they probably inspect TCP/IP packets for traces of NAT and in such cases block the traffic.

One solution to this problem was to switch my Slovene SIM card in Galaxy S with the Italian one each time I travelled to Italy. There are two shortcoming to this solution. It is annoying to switch them again and again and I still couldn’t access internet from my laptop. Hey, I could buy a cheap GPRS modem. Hm, those aren’t that cheap after all, specially because I don’t need it that often.

At this point I remembered my old crappy TyTN II lying in the drawer. I also remembered that there is a really nice internet tethering application out there called WMWiFiRouter. Combining the two and using Bluetooth PAN feature it was a matter of minutes for connecting my laptop through bluetooth to TyTN II to the Italian internet. It is just that easy - a matter of starting the application and clicking a button. Besides Bluetooth PAN WMWiFiRouter can share cellular internet connection through USB and WiFi and much much more, see the features list.

The bottom line is that I finally found a good use for TyTN II and found a good internet tethering application as well which I’d definitely recommended.