Category Archives: Windows

Run Rackspace Cloud Server locally on Hyper-V

Here is how I ran a copy of my Rackspace cloud server locally on my Hyper-V 2008 R2 Server. Why would you want to do that you ask? Well, there are many reasons. For example, I want to run all my applications in a test/staging environment before I push them live. I want to test all updates to my servers before I push them out live, testing large processes out without wasting money on CPU/bandwidth before running them live, etc. It is very nice to have a near exact copy of what you are running on rackspace cloud servers locally.

Part of the problem was I didn’t have any spare servers laying around that I could install linux and Xen on but I already had a Hyper-V server. This would allow me to run a linux VM, but how do you get a Rackspace cloud server backup running in Hyper-V.

Continue reading Run Rackspace Cloud Server locally on Hyper-V

Suspend Hyper-V VMs with PowerShell

I have one Hyper-V R2 server that fights with me on occasion. The VMs are responsive and I can RDP into them. The server itself is sometimes responsive, and I can RDP into it, but it fails to connect to Hyper-V manager. A reboot usually clears up the problem, but I hate to reboot the host machine with VMs still running.

I have noticed, however, that I can still access Hyper-V through the PowerShell API. As the VMs on this machine aren’t critical, I can suspend the VMs using the API. Then I can reboot the host machine, and start the VMs back up again using Hyper-V manager.

Continue reading Suspend Hyper-V VMs with PowerShell

Hyper-V Double Import Error

The type of work I do relies heavily on passing Hyper-V VMs around. When I send a VM to someone, I usually export a copy onto an external Hard Drive. In a perfect world, the VM would get copied off of the external drive to the local machine before being imported, but that sometimes doesn’t always happen. One user imported the VM while it was still on the external drive. Granted the VM would still work, it would probably be considerably slower due to running off of USB. They ran into problems on their host machine, so they decided to swap it out for another host machine. They shutdown the VM, and deleted it from Hyper-V. Then they plugged in the external drive into a new machine, and tried to import the VM again. This time they received an error:

Hyper-V Import Error Message
Hyper-V Import Error Message

Hyper-V Manager

A server error occurred while attempting to import the virtual machine.

Import failed.

Import failed. Unable to find virtual machine import files under location ‘D:\vm-export\test-import\’. You can import a virtual machine only if you used Hyper-V to create and export it.

Hyper-V doesn’t allow you to import VMs multiple times. In order to import the VM again, they would have needed to export the VM beforehand in order to prepare it for being imported on the second machine. The export process basically, cleans up the file structure of the VM and creates a config.xml file similar to the following:


  
  
  
    D:\VMs\test-import\test-import.vhd
    
  
  true

Upon importing the VM, Hyper-V looks for and then removes the config.xml file. If it can’t find that file, you will get an error message.

Now, if you have received this message, there is no need to panic. There are still ways to recover your VHD files. If your VM had 0 snapshots it is actually very easy to bring the VM back online. Dig around through the VM’s folder structure and locate its VHD file. That is the virtual hard disk that your VM uses to store all of its information.

If you have a VM with snapshots, the process will be a little different. Essentially, you will need to use the “Edit Disk” feature in Hyper-V to merge the AVHD disks into 1 VHD file, and then create a new Virtual Machine using that VHD file. There is a good guide located http://www.networkfoo.org/server-infrastructure/recovering-your-virtual-machine-how-manually-merge-hyper-v-snapshots-back-one- that can help you merge your AVHDs back into a single VHD file.

Once you have a single VHD file, in Hyper-V, create a new Virtual Machine. Give it a name and location, and fill out all the other important information it asks. Then once you get to the “Connect Virtual Hard Disk” screen, select “Use an existing virtual hard disk” and then browse and select the VHD file you found from above. Finish creating the VM and turn it on. The VM should work just as it did before.

Server 2008 R2 Hyper-V / Intel I7 – Blue Screen of Death

I was building out a new demonstration laptop. The laptop would be running VMs on Server 2008 R2 Hyper-V. Since the VMs we needed to run were rather large, we picked up a rather powerful laptop to support them.

  • Server 2008 R2 Enterprise
  • Intel i7-720 QM
  • 8GB RAM
  • 640 GB HD

The build went fine. It was simple, enabling Virtualization in the BIOS, installing the OS, adding Hyper-V role, importing a few VMs. Everything went smoothly.

I started a Virtual Machine to make a few tweaks before going home for the weekend. When I came in on Monday morning. I found a wonderful screen telling me there was an unexpected shutdown. Awesome. Thanks Monday…

I checked the Event Viewer and found out that it had been restarting every few hours all weekend.

Continue reading Server 2008 R2 Hyper-V / Intel I7 – Blue Screen of Death

No Remote Desktop License Servers Available

A client we were working with was having issues connecting to one of their servers. When trying to RDP to a Server 2008 R2 machine, they kept receiving this error message:

No Remote Desktop License Servers Available
No Remote Desktop License Servers Available

The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.

Please contact the server administrator.

According to Microsoft’s Website, RDS and the License Server works like the following:

Continue reading No Remote Desktop License Servers Available

Wake-On-Lan Windows 7 / Server 2008 R2

Sometimes, I am too lazy to get up and turn my server/desktop on, when I am using my laptop. So I decided to enable Wake-On-Lan. The network adapter in my desktop will remain on and listen for a Wake-On-Lan Packet. When it receives that packet the machine will turn on. I remember back in the old days you just had to make one change in the bios to enable WOL, but now you need to make a few changes in windows 7/Server 2008 R2 in order to enable it.

There are many different BIOS’ and NICs, so unless you have the same motherboard as me, the changes you will need to make will probably be slightly different, but the process should be the same.

Continue reading Wake-On-Lan Windows 7 / Server 2008 R2

Unable to run Live Update in Backup Exec 2010

This error happens frequently in Backup Exec 12.5 and Backup Exec 2010. Live Update cannot find any installed products to update. Here is the text of the error message:

LU1805: LiveUpdate was unable to find any products to Update

There are no products on this computer than can be updated by LiveUpdate

Continue reading Unable to run Live Update in Backup Exec 2010

Disable / Enable NICs via Powershell

A client I was working with was having an issue with their Virtual Machine (VM) running on Hyper-V. It was an odd one that I have never seen before. The VM was running Server 2008 R2 and had a single synthetic Virtual NIC attached with a static IP. The problem was that when the VM was restored from a saved state, occasionally, the network would not work. This obviously caused issues for users that needed to connect to the VM via RDP. Luckily, this VM did not completely rely on the Internet, so minor downtime when the VM was restored from a saved state wasn’t a major issue. Disconnecting and reconnecting the NIC in Hyper-V did not fix the issue, and ipconfig /renew wouldn’t fix anything since the IP address was static. The only thing the admin was able to do to temporarily fix the issue (until the next saved state restore) was to log into the VM via Hyper-V console and disable and then enable the NIC that was having issues. Unfortunately, time was a factor in finding a solution, and I was unable to physically see the hardware or VM in action. This made it very difficult to figure out what was causing the issue in the first place. A workaround seemed to be a much better use of time than spending hours trying to deduce the problem via E-mail.

The restore action for the saved state was done by via script. So it would be very easy to tie in another script to essentially disable and enable the NIC after the VM was restored. From what I can tell, this can’t be done using the Hyper-V Powershell APIs from the host. Also, since the network was the problem, I couldn’t run a remote script from the host to fix the NIC. Anything that could be done would have to be done within the VM. Granted this is not a solution to the original problem, but a workaround, and given more time we would have looked into what the actual cause was. So, here is the workaround to the problem.

Continue reading Disable / Enable NICs via Powershell

TODO: Remove “TODO:” code comments before RTM

I was tweaking the editmessage.aspx page for OWA 2007 in Exchange 2007 and I noticed some leftover code comments from the developers at Microsoft.

Do code comments like this make it past the QA process often?

< !--LocalizedStrings.GetHtmlEncoded(Strings.IDs.SubjectColon)--> < !-- TODO: OWA: 775: make sure this comment (and any others) are removed in retail --> < !-- For some reason, if this input field is not wrapped in a div, when the user types some text it resizes itself by a few pixels. Go figure.-->