ScorpioTek Solutions
07-filler-left Information about ScorpioTek Services Offered by ScorpioTek Training Courses Offered by ScorpioTek Technology Blog by ScorpioTek Contact us for more information on training/services 08-filler-right
06-message

Archive for the ‘Windows Server 2008’ Category

How to get Server Core 2008 R2 to Hyper-V in 10 Minutes or Less

Tuesday, May 25th, 2010

Motivation

I need to showcase the capabilities of Windows HPC Server 2008 and for doing so I’ve decided to host 4 VMs that will be part of the cluster.  My VM server only has 4 GB of RAM and I need to make the best usage out of the hardware.  I decided to install Windows Server 2008 R2 Enterprise as the Server Core option, this would give me more RAM for the VMs to run. I wrote this guide to get your base Windows Server 2008 R2 installation to a full Hyper-V server in a matter of minutes, let me know if it works for you!

Procedure

One of the first things you want to do is enable remote desktop connections:

WMIC RDToggle Where ServerName="%COMPUTERNAME%" Call SetAllowTSConnections AllowTSConnections="1"

Then, enable the firewall to allow RDC:

netsh advfirewall firewall add rule name="RemoteDesktop" dir=in action=allow protocol=TCP localport=3389

That’s it in terms of sitting in front of your server core, you can now connect remotely and carry out the rest of the procedures.

If you have not done so already, log-in from a remote computer to your server core box.

Let’s now enable .Net 2.0:

dism /online /enable-feature /featurename:NetFx2-ServerCore

And now, let’s enable PowerShell:

dism /online /enable-feature /featurename:MicrosoftWindowsPowerShell

Download Core Configurator, burn it to a CD/DVD and insert it into the server core box.

Copy all the contents of the DVD to your server core machine, for instance:

xcopy /Y D:\* c:\Program Files\CoreConfiguratorv20\

Open PowerShell:

c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Enable RemoteExecution policy:

Set-ExecutionPolicy RemoteSigned

Change directories to the CoreConfigurator directory:

cd "C:\Program Files\CoreConfiguratorv20\"

Launch Core Configurator:

.\CoreConfig.ps1

Now on CoreConfigurator carry out these steps:

  1. Click “Computer Settings…”
  2. Click Roles and Features
  3. Enable the Hyper-V role and click Apply:
  4. You will be prompted to Reboot, click Restart now

    You machine will reboot and after configuring Windows will reboot once again

    You should now have a full Hyper-V Server Core installation, pat yourself in the back, you deserve it.  Now…how do you do stuff with it?  Well, first and foremost, CoreConfigurator has a Hyper-V settings button:

From that setting you should be able to start/stop VMs:

But what about controlling the Hyper-V settings from a Hyper-V manager from another machine?  The good news is that is possible, and the bad news is that is not straightforwards.  Luckily for us, John Howard was cool enough to write a utility that enables a much easier configuration: the Hyper-V Remote Management Configuration Utility

Read the instructions carefully and you should be able to control your Server Core Hyper-V from a remote Hyper-V machine:

How to Disable Shutdown/Restart as Group Policy

Wednesday, December 9th, 2009

Giovanni recently implemented an amazing system at the Platform Adoption Center at Microsoft to allow remote access to attendees to carry out labs. This is a mix or Terminal Services, System Center Virtual Machine Manager using the Self-Service portal, and lots of patience. The end result works extremely well, and we managed to integrate his solution with a Boot2VHD implementation carried out by yours truly.

The end result is an environment for 40 machines ready for virtualization labs (which cannot be virtualized). By using Boot2VHD, we clean the machines by simply booting to a “Clean Lab” partition that replaces the “dirty” differencing VHD with the “master” differencing VHD. It works extremely well and the beauty of it all is that (at least our solution) was implemented with WIndows Server 2008, no 3rd party tools were involved.

Anyhow, the environment works great – except when students shut down the machines. Since they are in a datacenter, if someone shuts down the machine, we have to contact the IT Admin to turn the servers back up, which can be really tiring. After some research, I found out that you can hide the “Shutdown/Restart” options in an OU, so even though this does not prevent them from shutting down the machines (they can use the shutdown command), it reduces the chances of having someone shut down the server.

So here is what you need to do:

1- Log in to your DC and right click at the OU node where you want the policy applied:

2- Name the policy something like “Prevent Shutdown Display
3- Right click the newly created policy and select “Edit
4- Expand User Configuration –> Administrative Templates –> Start Menu and Taskbar:

5- The right pane will display all related policies, look for one called Remove and prevent access to the Shut Down, Restart, Sleep, and Hibernate commands:

6- Double click the policy and select Enabled and click OK:

7- Your group policy is now in effect and users won’t see the buttons when they log in:


How to backup Microsoft Assessment and Planning Toolkit Databases

Saturday, December 5th, 2009

The Microsoft Assessment and Planning Toolkit (amongst other things) lets you find out information about your current server infrastructure to see which are machines that are virtualization candidates. The software uses SQL to store the information it gathers throughout the process, and it also offers a way to export this info but is not very well documented.

If you look into the following folder:

C:\Program Files\Microsoft Assessment and Planning Toolkit\Help\Support Files

You will find various scripts to backup and restore the MAPS database. However, when you run BackupAllDB.cmd it will fail:

As the error implies, it cannot find “Backupall.sql” which is in the same folder as the script. This happens because the script runs under c:\windows\system32\cmd.exe and is looking for the SQL script in that directory (great job testing this feature, BTW)

To fix this, just copy the whole Support Files folder to your documents, open the BackupAllDB.cmd script and enter the complete path to the BackupAll.sql file, in my case:

osql -E -S %computername%\MAPS -E -i “C:\Users\v-csabor\Documents\Support Files\BackupAll.sql”

Run the modified script once again and it will backup your files…in the following directory:

C:\Windows\System32\DBBACKUP\

Which is the last place on earth you would look for it.


Will Hyper-V Images from Windows Server 2008 R2 Work with Previous Versions of Hyper-V?

Saturday, January 17th, 2009

All the buzz these days is around Windows 7; but its big brother, Windows Server 2008 R2 is the one that should be stealing all the attention (IMHO).  I’ve been using it for a while, to the point (don’t try this @ home) of using it as my main Hyper-V solution because of a problem I faced with regular Windows Server 2008 a couple of weeks ago.

Today I thought about what would happen if I ever needed to move the images from R2 to 2008 and the obvious question arose: Will it blend work?

I searched a bit on the web and no one has reported on this (it’s a hard search query to formulate).  Anyhow, to save you some time and headaches in the future, I have carried this procedure for you :)  I am right now in the Server Manager console, opening Hyper-V and about to select import and point to the machine I exported from Hyper-V R2.

After pointing it to the folder, it successfully imported the machines with ALL respective snapshots.  When I started the machine it failed to start.  This machine was exported with a saved state, so after deleting the Saved State and trying again, the machine booted up.

After this, I was immediately blue screened by the host, but this is something that had happened before and was the reason why I switched to R2 (no blue screens after upgrading to R2 – ironically, the beta of  R2 is more stable than the release of 2008 on my HP machine).

So in a nutshell, Hyper-V images exported from Windows Server 2008 R2 can be successfully imported to previous versions of Windows Server 2008 given that they do not have saved states.  Hope this helps!

How to Create Startup Items on Server Core

Wednesday, December 31st, 2008

Things changed a bit from Windows Server 2003 to Windows Server 2008 when it comes to startup items. In W2K8, the place where you want to put items launched at startup is:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

This works great, but what about Server Core? The path exists and you can place all you want in there, but guess what? When you log into the server core machine, nothing happens and this is most likely because there is no start menu ;)

The fix to this is to modify your registry in Server Core:

  1. Launch RegEdit by typing regedit at the command prompt
  2. Access the following registry key: HKLM\Software\Microsoft\Windows\CurrentVersion\Run
  3. Right click on the right pane and select New -> String Value
  4. Name the String something relative to what you are launching, for instance Launch Notepad
  5. Double click on the key that you just created to edit the string
  6. Enter the path of the executable, script, etc. that you want launched in this key and click OK
  7. Click OK, logoff and the next time anyone logs in, Notepad (in my case) will be launched – easy as pie!

Sources:

http://forum.sysinternals.com/forum_posts.asp?TID=15330

Drivers for Windows Server 2008 on MacBook Pro

Monday, December 1st, 2008
Google Image Result for http___maclawstudents.com_images_mac-windows-logos.jpg.jpg

In order to test some VMs I had in the past, I installed Windows Server 2008 on my MacBook Pro…again. Every time I have to do this, it’s always the same story: look for my older blog posts to see where I got the drivers from.

Well, I have the installation working like a charm, and since I know I am going to be looking for these drivers 3 months down the road, I have created an archive that holds:

  • Nvidia Graphics Driver
  • Ethernet Drivers
  • Bluetooth Drivers (stolen from harbar.net, read the instructions there on how to install them)

Update December 10th, 2009:

Drivers can be found here.

Fix for Error: The Module “foo.dll” was loaded but the call to DllRegisterServer failed with error code 0×8007005

Tuesday, November 25th, 2008

10.0.1.26.jpg

I was running into this problem when running:

regsvr32 foo.dll

on Windows Server 2008 Enterprise x64.

Human Translation: Run the command on a command window with elevated privileges :)

Do as I Say, Don’t Do as I Do

Tuesday, November 25th, 2008

Today I really wanted to kick myself for trying to get around a problem when trying to make a C# console application instantiate a COM DLL. I had created these 2 projects under the same solution, but when I was debugging, a COM exception exploded in my face:

201002251603.jpg
System.Runtime.InteropServices.COMException was unhandledMessage=”Retrieving the COM class factory for component with CLSID {20156CB7-8B2F-4B55-9F79-0DE4E8E04145} failed due to the following error: 80040154.”

I was baffled as the COM component was registered successfully.

After looking for CLSIDs in the registry, and toying around with the OLE COM Object Viewer, it struck me.

I had created the C# and COM projects under the same solution. C++ projects on Visual Studio are created to target x86 by default whereas managed projects are created to target AnyCPU by default.

Since I was running this on a 64-bit OS, the C# app ran as a 64-bit process and was looking under the 64-bit registry section to find info on the InprocServer, which had been registered as a 32-bit component.

I changed the C# application to target 32-bit, and the COM error was gone.

I can only help but feel foolish for stumbling onto this mistake. I think I spent about 2 years training people on how to avoid these pitfalls, and yet, here I was in too deep…tsk tsk.

On to the next thing…

How to Fix Error: Product: Error 26201. Error -2147467259

Sunday, November 16th, 2008

When you uninstall the HPC 2008 Compute Cluster Pack and try to install it again, you might be faced with the following error:

Product: Microsoft Compute Cluster Pack — Error 26201. Error -2147467259: failed to create SQL database: CCPClusterService, error detail: unknown error

This usually happens when for whatever reason, the SQL instance that HPC Server 2008 uses is left behind; thus, when installing the pack for a second time, it will fail because it cannot overwrite the instance. The bad part is that you cannot uninstall it, because you already did. In order to fix this issue here is what I did:

  1. Install SQL Server Express (stand alone, it must NOT be R2, use this one)
  2. Once installed, uninstall SQL Server, it will let you select the instance that did not get uninstalled
  3. It will complain about SQL process running, you MUST kill the sql process\
  4. Uninstall other SQL components
  5. Once uninstalled, install the HPC pack again, the DB will be created and HPC PAck 2008 will be installed without problems

Hope this helps someone in the future.

How to Create an Image of Windows Server 2008 using Norton Ghost

Tuesday, November 4th, 2008

Ever since the introduction of WDS services in Windows Server 2003 R2 SP1, creating images for deployment on the Windows platform is extremely easy and straightforward. In the past, I have managed to create clusters of machines (about 52) in one afternoon by automating the whole process with a single WDS server (without multicast, mind you). We can all agree that WDS is amazing – but what about those ocasions when you want to image something and you do not want to sysprep the source computer?

In case you are not familiar with the process syspreping a machine: sysprepping a machine is the procedure in which you convert a source machine into a generic one, stripping away all SSIDs so that on next boot, it will have a new ’soul’, so to speak. This is a must if you plan to deploy images that will be used in an active directory environment, else you are in for a treat when your DC starts seeing all these machines that have the same properties.

Anyhow, in order to use WDS to create an image, the source machine needs to be syspreped – period, there is (AFAIK) no way around this. So if you have a perfect demo and you want to have an image in case you need to restore – what can you do? You obviously do not want to sysprep a demo machine, who knows what might happen.

You can always use Ghost, like I did. You create the image, restore the image and…

The selected entry point could not be loaded because the application is missing or corrupt.

Whoa…not quite what you were expecting, huh? The problem is that (I think) some of the boot partition is lost during the restore. Repairing with Windows Server 2008 will take you nowhere, trust me.

After looking all over, I decided to give the Windows Vista Repair Disk a try. After booting from the DVD, Vista said that something was wrong with the disk. It then asked me if I wanted to repair, which I said “Yes. Please. Thank You”. After rebooting the machine, I saw the Windows loading green progress bar and everything was back to normal.

Where do you get this magical Windows Vista Repair Disk, you ask? I found them posted on the Neosmart Files web page, it’s a legit torrent download. AFAIK, the download is legit and does not break copyright laws, please let me know if I am wrong.

Let me know if this works for you, I have searched all over and never found a site that documented how to get this working.