Friday, July 27, 2007

Attaching to network printer without directory or dns assistance

If you visit another company's office and connect your laptop to their windows network, you'll find that you aren't a member of their domain which can make a lot of typical office activities a bit more difficult to achieve. Printing is a biggie.

First step is to find out from someone on the domain what the ip address of the printer is. Get them to bring up the Printer Properties dialog and go to the Sharing tab. The printer will have a sharing name. Pinging the sharing name from the command prompt will give you the ip address.

Now you can Add Printer. Here's where is gets a bit counterintuitive: you select Local Printer (not Network Printer - I always thought local meant directly connected to your PC, but there are more options in this wizard path than I realised). Select Create a New Port and choose Standard TCP/IP Port. Enter the IP address (the port will be completed for you).

Then you have to select the Manufacturer and Model. My experience has been that if I choose something in the ballpark then plain old document printing will usually work. e.g. the model HP Laserjet 4000 Series PS provides printing for a HP Laserjet 4345 mfp printer, but its other fancy features may be unavailable.

The guidance out there on the web is to choose PS first followed by PCL6 followed by PCL if confronted with multiple similar choices.

SSIS development notes

Mirror any settings you change in the package in your development package configuration. Otherwise you risk the config values blatting your changes.

Click OK to save transformation changes, don't just close the editor!

When tidying up the dtsConfig xml formatting, don't put newlines and tabs between the ConfiguredValue tags.

This error:

Error at Create x Table [DTS.Pipeline]: The index is not valid.ADDITIONAL INFORMATION:Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap)

just means that SSIS is playing up. Recreate the offending data source (I wonder if any of the service packs fix this?)

When copying and pasting data flow elements, unselect the copied elements before pasting.

You've added a dozen package variables in the wrong scope, and the scope can't be edited in the variable view. Aaargh! Do you have to delete and recreate them? No, you can open the code designer view of the package, find the xml for the variables and move them to the appropriate place. It's not really much easier I'm afraid.

When columns are added to the data source, the Union All transformation fails to recognise their existence. This transformation has to be recreated.

If you're developing on a virtual machine that has been created by restoring from a windows backup, the first tab of the Regional and Language Options control panel may revert back to US English. Changing all the settings on the front tab will get your usual desktop apps behaving properly, but SSIS may still be confused! If you have a SQL task that calls a stored procedure with a date parameter, you may find that the sp will receive a date in the wrong format. The way to fix this is to select the Default User Account Settings tick box on the Advanced tab of the Regional and Language Options control panel.

When executing solutions or packages within Visual Studio I get duplicate designer windows opening up. The icons for these dupes are the same as for miscellaneous files. The main nuisance is if after execution I decide to make further changes and I mistakenly change the dupes instead of the originals. What are these windows for?

Thursday, July 26, 2007

Restoring windows backup didn't restore all regional and language options

Strange, restoring into a vanilla os from a backup file didn't bring across the regional settings on the first tab of Regional and Language Options.

I only noticed this because I hit a documented SSIS error.

Wednesday, July 25, 2007

SQL Server 2005, Visual Studio 2005 and Visual Studio 2005 SP1

If you have installed both SQL Server 2005 and Visual Studio 2005 then probably both of the following will be installed:

Microsoft Visual Studio 2005 Premier Partner Edition - ENU
Microsoft Visual Studio 2005 X Edition - ENU

Sure it's untidy that the VS2005 X install doesn't detect and replace Premier, but it hasn't caused any problems (so far). If you're like me, you haven't dared remove Premier because you're worried about regression, and probably you just use X because it is a superset of Premier anyway.

However now it's time to put Visual Studio 2005 SP1 on. What's it going to do?

It asked me if I want to install on Premier. But I don't use Premier! Oh no, it's chosen the wrong one! I cancelled the installation and to my surprise it then asked if I wanted to install on X? Phew! But now I'm not sure if I need to install on Premier also. Considering it's supposed to take a minimum of 90 minutes, do I really want to sit through that twice?

I decided to install only on X, and hit a "digital signature check" error. This post describes the fix for a software stack that's very similar to mine.

More P2V travails

Before restoring from backup I changed the registry for intelppm.sys as per previous posting. The settings didn't revert on restore so the stop error went away.

Since stop errors that require registry fixes are a nuisance to sort out, it's tempting to preemptively disable intelppm.sys and processr.sys as part of the basic steps, immediately after firing up the restore vmc.

The runtime error I posted about previously was solved by repairing dotnetframework2.0. Not really sure why it broke. Probably for the same reason I was prompted for the dotnetfx install during the Win2K3 repair.

Tuesday, July 24, 2007

Better (but probably not best) practice for Windows/Virtual PC P2V

Basic steps:

Back up the physical system to a bkf file
Create a vanilla vhd using the operating system of the physical system
Make a copy of the vanilla vhd to a restore vhd
Create an empty backup vhd
Mount the backup vhd using vhdmount
Copy the bkf file into the backup vhd (might need to compact or split it)
Unmount the backup vhd
Configure a vmc with restore vhd as disc 1 and backup vhd as disc 2
Fire up the vmc and restore the backup
Reboot, cross fingers and troubleshoot device issues

If there are issues:

Configure another vmc with the vanilla vhd as disc 1 and restore vhd as disc 2

Fire up the vmc and use windows tools to copy required files, edit offline registry etc

Don't faff around with recovery console or utility boot discs more than necessary - it's all a big pain and you'll end up having to juggle various iso's and vfd's.

Monday, July 23, 2007

Getting big files into vhds via vhdmount

Having trouble using or copying big files from shared folders or linked drives because of throughput or memory constraints?

Mount a disc ,and copy in your files, then unmount and commit changes. Vhdmount then takes a loooong time merging undo discs, but at least it works!

Windows explorer integration for vhdmount helps out a lot with this.

I find this a great way to get image or backup files into blank vhds. I partition with the appropriate windows setup cd and then do a quick-format as prompted on mounting the vhd, followed by the file copy.

My experience is that if the file is really big (say 10GB) then at the end of the copy it will sit there saying "5 seconds remaining" for a long time. I haven't been patient enough to let it sit for a day to see if it completes, but there's very little activity of any kind so I think it just dies.

Resetting recovery console password and mounting vhd

Instructions at petri.co.il and http://support.microsoft.com/kb/322672.

Didn't work with login used due to error: 0x32 Request not supported.

Googling for this error returned this page which unfortunately is only available in Italian. Excerpt:

Attenzione: non è possibile modificare la password di DSRM mediante l’utility NTDSUTIL nel mentre si opera in DSRM (Errore: “Setting password failed. Win32 Error Code: 0x32. Error Message: The request is not supported.”). Viceversa è possibile farlo da DSRM mediante la sequenza di tasti Control+Alt+Del e cliccando sul bottone “Change Password...” oppure inserendo il comando seguente: “net user Administrator *”.

Babelfish translated this as:

Attention: Error is not possible to meanwhile modify password of DSRM by means of utility the NTDSUTIL the work in DSRM (: "Setting password failed. Win32 Error Tails: 0x32. Error Message: The request is not supported."). Viceversa is possible to make it from DSRM by means of the sequence of Control+Alt+Del keys and cliccando on the button "Change Password..." or inserting the following commando: "net user Administrator *".

In the end I didn't need to figure this out because loginrecovery.com succeeded in deciphering the local administrator password.

I put a load of command line registry editing tools on a disc and mounted it on the guest. Unfortunately they all page faulted - they're obviously pretty old and haven't been updated to latest windows versions. I'm really surprised that I couldn't find a registry editor that can be used in the recovery console.

So then I decided to try and mount the vhd on the host so I could use the host's regedit to manually fix the guest's registry file.

I downloaded and installed vhdmount (part of Virtual Server) and from the command line I did the following:

cd c:\program files\microsoft virtual server\vhdmount
vhdmount /m /f vhdfile.vhd V:

which gave me the error "Invalid command line parameters."

I then tried just plugging in instead of mounting

vhdmount /p /f vhdfile.vhd

which resulted in error "Failed to plug in the Virtual Hard Disk (VHD). The specified file is not a valid VHD."

I then typed SET VHD_MOUNT_TRACE=1 and tried this command again which gave me:

[Info] Default user locale is 0x1409[Warning] Dictionary VhdMountStrings.dll doesn't exist.[Info] GetSCSIAddress called for VHD: vhdfile.vhd[Info] Verifying file: vhdfile.vhd[Error] Query failed: 0x57[Error] GetSCSIAddress failed. error code = 0x37[Info] MountVHD called for VHD: vhdfile.vhd[Info] Verifying file: vhdfile.vhd[Error] Invalid VHD signature found: 0x00[Warning] Footer of the given VHD is incorrect. Hence checking the VHD's header
The Virtual Hard Disk is successfully plugged in as a virtual disk device.[Info] VHDMount successful.


"Successful", huh. VHDMount is obviously very pleased to come anywhere near my vhd without crashing itself.

The vhd is split so perhaps this explains incorrect footer. I then tried to fire up Virtual PC to compact the vhd, but it hanged on the splash screen. So now I know what VHDMount was successful at: giving itself exclusive access to the vhd without doing anything useful! I had to kill VPC, unmount the vhd and start VPC again.

Thursday, July 19, 2007

P2V dramas with Virtual PC and NTBackup

I've been following the instructions in this discussion group posting with the exception that I'm using Virtual PC.

Installing a vanilla os on to a vpc is obviously no big deal. But it got harder sooner than I would have liked - restoring the bkf file. I have hit the following problems:

I couldn't restore from a a shared folder due to known issues.

I tried to copy the bkf file from a shared folder to the guest c drive but I kept getting a device i/o error. It appears that the host needs to have almost as much memory available as the size of the file being copied. Obviously this is problematic for bkf files that can be in the multi gigabyte range.

I then split the bkf file into multiple parts with winzip and minimised the amount of guest memory to maximise the chances of the copy completing successfully.

Finally I could restore the bkf file!

However when I restarted, I got an error box at the login screen as follows:

Microsoft Visual C++ 6.0 program

C:\Prog...

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Annoyingly this error box was right in front of the login box and I couldn't move the error box or close it (the mouse stopped working).

I tried entering login credentials blind without success (couldn't see what domain was selected and couldn't see the contents of any dialog boxes that popped up).

Finally I rebooted the image in the hope the error or the mouse failure would go away but I got a boot error on a black screen instead:

Windows could not start because of an error in the software.
Please report this problem as :
load needed DLLs for HAL.
Please contact your support person to report this problem.

Aha! Here was something referred to in the instructions. I booted from the Win2K3 CD and went to the recovery console to replace the hal file but found that it wouldn't take the current administrator password.

It turns out that the recovery console admin password will be the one used when Win2K3 was initially installed, and subsequent password changes don't affect this. I don't have that password and had to use http://www.loginrecovery.com/ to get the password back.

While I was waiting 48 hours (to get the password for free) I impatiently tried to repair the server using the Win2K3 CD to see if that would sort things out.

A required file called cpqteam.hlp could not be found. Who requires a help file?? Cancelled.

The next one was a bit tougher to figure out: install.exe. The default path on the c drive was c:\windows\microsoft.net\v2.0.50727\Microsoft .NET Framework 2.0. So I downloaded dotnetfx.exe, extracted the files, converted them to iso, captured the image as a cd and selected the file.

The repair chugged on a bit further and then crashed dramatically with stop error 0x000000CE DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS for file intelppm.sys.

Virtual PC Guy reckons I should disable the driver in the registry but with a non booting guest and no access to recovery console (at least until I hear from loginrecovery) I think I've hit the wall...

Tuesday, July 17, 2007

More P2V info from some forum

“The Path To Fast P2V” – The Quicksilver Project



We all have tons of physical machines we want to migrate to Virtual Hosts, and we all want to do it in a smooth low administrative cost process.

Well, all we have to do is to use the VSMT right? (Virtual Server Migration Toolkit). The problem is that its too complex to use it, and in the end the hours you spend to run all the VSMT process is maybe even bigger than the one you would take to set it up the hole thing again without VSMT at all!!

This is what I came up after some small researching.

I Managed to P2V in 2 Single Steps, and I would like to share my experience with you.

Suppose you have a nice Windows 2003 Sp1 Machine running on a old Server, and you want to P2V it to Virtual Server. Simply you use your cloning solution of you choise (preferably I use Acronis and Ghost), and deliver the image to the Virtual machine as it was a physical one.

Logical when the Virtual Machine boots you get a “Blue Screen of Death” because of the hardware Incompatibility.

All you have to do is to boot up the Virtual Machine with the Windows 2003 Sp1 CD, choose the R option to go to the Recovery Console, when you just get the famous “Dos Like Console”

This is the amazing part.. you copy from the CD of Windows 2003 Sp1 the hal.dll and ntoskrnl.exe and override in the Windows system32 directory.

In simple Commands you do as follows..

1.boot the Virtual machine with the cd of Windows 2003 SP1

2. Press R for the Recovery Console

3. choose your Windows Installation (usually option 1)

Go to windows system32 folder by typping cd c:\windows\system32

Then enter the drive letter of cd-rom (usually dJ

At d: prompt type cd i386

Then type as follows

Expand ntoskrnl.ex_ c:

Expand hal.dl_ c:

For each command you will take a notification for overwriting the original files.. we choose yes to replace the files.



Then rebout the machine, remove the cd-rom of window 2003 sp1, let the machine boot and press F8 to go to option menu for Safe Boot.

THERE YOU ARE, THE TARGET MACHINE IS BOOTING WITH NO ERRORS.

IT WILL AUTO DISCOVER ALL THE HARDWARE AND IT WILL PLAY OK



100% TESTED, MIGRATED MANY MACHINES LIKE THAT.



PLEASE FEEL FREE TO CONTACT ME FOR ANY INFORMATION YOU MAY NEED.



BEST REGARDS.



ALEXOPOULOS IOANNIS MCSE MCT MVP Candidate.

Ioannis_alexopoulos@hotmail.com (my msn account, feel free to add me)

P2V info from microsoft.public.virtualserver

1. Sylvain Lafontaine fill the blanks, no spam please
View profile
More options Mar 18, 5:40 am
Newsgroups: microsoft.public.virtualserver
From: "Sylvain Lafontaine"
Date: Sat, 17 Mar 2007 13:40:47 -0400
Local: Sun, Mar 18 2007 5:40 am
Subject: Re: Migrating a physical server as VM
Reply to author Forward Print Individual message Show original Report this message Find messages by this author
Yes, there are other tools to migrate a physical machine to a virtual. However, it's not always easy and with some of these tools/methods, you will have to make a reparation step to replace the HAL layer before Windows will be able to boot under its new virtualized environment. The ACPI set up in the BIOS is also another thing that you must check up before making the P2V migration:
http://www.rtfm-ed.co.uk/docs/vmwdocs/whitepaper-upgrading-cpus-on-no...
http://blogs.msdn.com/virtual_pc_guy/archive/2004/11/24/269412.aspx http://blogs.msdn.com/virtual_pc_guy/archive/2004/11/30/272662.aspx http://blogs.msdn.com/virtual_pc_guy/archive/2004/12/10/279667.aspx
Here are some other automated tools or manual methods for doing your P2V (Physical to Virtual) migration:
http://4sysops.com/archives/p2v-for-vmware-migrate-physical-to-virtua...
http://www.invirtus.com/content/view/808/394/
http://www.acronis.com/enterprise/products/ATISWin/universal-restore....
http://www.vmware.com/products/beta/converter/
http://www.rtfm-ed.eu/docs/vmwdocs/whitepaper-ultimatep2v-quickstart.pdf
In the case of VMWare converter, you will have to convert it back to VHD but only after removing the previous VMWare additions; see:
http://vmtoolkit.com/files/default.aspx http://vmtoolkit.com/blogs/paul/archive/2006/12/14/preparing-a-window...
If you want to use an imaging software like Ghost or Acronis, you will have to set up a second virtual environment for the sole purpose of restoring an image directly to a vhd: first you create two empty VHD then you attach them to the virtual environment as second and third virtual hard drives, you copy the image file(s) to the second hard drive and you restore it to the third one. All you have to do now is to detach this last vhd and use it as the main virtual hard drive for creating a new virtual environment. (There are other methods like using a booting DVD or a network connectin but these are often more complicated to set up.)
When using some older imaging softwares, it's also a good idea to partition the target VHD before making the restoration to make sure that the master boot record on the virtual drive has been correctly written or you can take the precaution of imaging the whole physical hard drive which is used as the source instead of just backing/restoring a single partition (and you must do it even if there is only one single partition on it); otherwise the MBR might be incorrectly written on the target virtual drive after the restoration. (Probably that you won't have this problem with a more recent version of these softwares but it's better to be safe then sorry.)
You might have some other problems, for example if your operating system was on the D:\ drive and you want it now to be on the C:\ drive. For a discussion of this, take a look at:
http://help.lockergnome.com/windows/Cloned-Drive-Ghost-10-Log-Drive-f...
http://groups.google.com/group/microsoft.public.windowsxp.hardware/br...
-- Sylvain Lafontaine, ing. MVP - Technologies Virtual-PC E-mail: sylvain aei ca (fill the blanks, no spam please)

Virtual PC P2V and linked disc

Following the process of creating the virtual machine as per KB912826 and starting the ASR Restore to restore the backup to it:

If after pressing F2 to initiate ASR you get the following error:

Setup was unable to restore the configuration of your system because of the following error: The capacity of the replacement hard disk drives is insufficient, and cannot be used to recover the partitions on the original system disk. The replacement hard disk drives must be at least as large as the disks present on the original system.

And you've read KB314686 and tweaked the dynamically expanding disc size but still can't get rid of the error message:

Then you've probably got the vhds the wrong way round! The dynamically expanding vhd is attached to the vm first and the linked vhd is attached second. It's possible to make this mistake if you aren't careful following the instructions in KB912826, because step 5f incorrectly refers to the "expandable virtual disk file that you created in step 3", but it's the linked disc file that's created in step 3.