RJ's blog - stuff that interests, frustrates and fasinates me RSS 2.0
 Sunday, February 10, 2008

Compacting a VirtualPC harddrive seems pretty straight forward the first time you do it.  Make sure the drive isn't in use, open up the VPC console, File | Virtual Disk Wizard | Edit Existing Drive | Select the drive | Compact it.   However after running you will probably find that its either stayed the same or increased in size!

If you read the wizard messages (who really does that though?), you'll see that they state you need to zero out the free space first.  A quick search on MSDN shows a KB article the describes how to Prepare a VPC hard drive.

To properly compact a VPC instance, you'll want to follow these steps.  For reference I'm using VirtualPC 2007.

  1. Start the VPC instance and defrag the drive to start off.
  2. Next click on the CD option on the menu for the VPC instance, select Capture ISO image, navigate to the VPC install directory (program files\Microsoft Virtual PC), and in the Virtual Machine Additions folder there is "Virtual Disk Precompactor.iso".  Open that and it should auto run, compacting the drive(s).
  3. When its done, select the CD menu option again and Release (unmount) the ISO.
  4. Shut down the Virtual PC instance.
  5. In the VPC console, File | Virtual PC wizard | Select the drive you just precompacted | Compact it | Replace or Save original as you desire, and let it run.

Pretty easy once you have the steps, and it can make a big difference in the size of the virtual drive if you're using dynamic drives instead of a fixed sized one.

Sunday, February 10, 2008 10:34:40 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
utilities

I wanted to copy an existing laptop to a VirtualPC instance.  It's old and had a number of issues (RAM, Win2000, CPU speed, 20gig HD, USB 1.0, to name a few), but I still need to use some of the development tools on the laptop.  Instead of going thru the hassle of trying to find all of the license keys for the software on this laptop (not sure if we even could), I thought the easiest route would be to make a VPC instance and use that on my Dell desktop that has plenty of RAM and CPU. 

We use VPC for archiving build configurations at TIP extensively and it works like a charm. When you have a build environment that you need to save in case you need to patch old source code, instead trying to make the old source work in the new enviroment (new IDE version, updated 3rd party controls, etc), just create a VPC image with that build configuration.  Then if you need to patch any code, its a breeze - start the VPC instance and your off working with a known environment.

I've never tried to clone a whole hard drive before. The research I did lead me to believe that Ghost was the way to go.  However I quickly ran into some problems going down that route - first off you can't be using the drive when you ghost it.  I wasn't able to create a boot disk as the laptop doesn't have a floppy drive, and I ran into issues trying to create a bootable USB or CD with Barts Bootable CD with Networking enabled.   After several hours and much frustration, I came across a newsgroup post that lead me down the correct path, once again I was making it harder than it needed to be.  Here's the easy and cheap (ie. Free) steps I used.  I'm not going to detail the steps as the 2 converters really were quite simple to use.

  1. Attach my external 500gig USB drive to the old laptop so I had a place to put the image.
  2. Convert the existing drive to virtual with VMWare Converter (free version worked fine).
  3. Convert the VMWare image to VPC with VMToolkit converter (free).
  4. Copy the image to my desktop system, and use VPC to crete a new virtual machine using the new VHD drive.
  5. Boot up the image and fix the PNP warnings for new hardware that came up.  I know some people run into problems with blue screens of death and have to use their Windows Install disks to repair the image, but I didn't have that problem.  It booted just fine, and after a couple driver changes & reboots I was off and running.

The only real hassle with the process is that the laptop only supported USB 1.0, so copying 20gig took a LOOONG time. I started the process before I went to bed and it was finished when I got up.  I did run into one problem while running VMWare Converter, it gave me a warning that the Registry wasn't large enough and I had to restart the process.  It allowed 45mb, so I bumped it to 120mb just to be sure there was enough space so I didn't have to restart a 2nd time.


The next step is to clean up the new VPC and remove the unused programs, then compress the VHD down from its 20gig size.
Sunday, February 10, 2008 1:49:55 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
utilities
 Friday, January 25, 2008

A recent article by Symantec warns of a pharming attack (redirecting your web traffic to another, fake website) that went from the "theoretical" to the "It’s being done now" category. For those that have a home network set up and have their own router, you should pay close attention to this. The goal of redirecting your traffic is to allow them to capture your username, password & account information for sensitive accounts (ie. Banks, Paypal, CreditCards, etc). The attack uses security flaws in some routers, or a lack of proper security measures by others, and changes your router settings. The change could occur from either an HTML based email, or by visiting a compromised website. 

Most people don’t change the default password on their routers. I know that by default Linksys routers have no username and a default password of Admin. One of the easiest ways to beefe up security and prevent these sort of attacks is to change these default settings. Assign / Change the username, and change the password. 

  • Username: don’t use the same name as you log into the computer with, use something unique.
  • Password: never use a simple to guess word, like one you would find in a dictionary. Mix letters, numbers and symbols.

The greater the variety, the harder it is to crack. There is a specific model of routers that doesn’t require any username or password to change the router settings, but I haven’t been able to determine that information yet. This would be a huge security risk, so if I find out what it is I’ll pass it along. There are some really good general security suggestions in the Symantec article, well worth reading.

Friday, January 25, 2008 1:58:15 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
utilities
 Wednesday, November 14, 2007

As I mentioned a few days ago, I just updated to dasBlog 2.0. The docs for the upgrade to dasBlog 2.0 don't appear to be up to date, so to help out any one who might be having issues with it (*cough*dan*cough*), here's a rundown of the steps I did to upgrade.  I use Webhost4life as a hosting service and had a previous working install of dasBlog 1.9, so the steps are targeted towards that.

  1. Download the latest version of dasBlog 2.0
  2. Install it on your local pc.
  3. Using something like SmartFTP, copy the xml files in your remote dasblog\content folder to the local directory.
  4. Time for a backup of your contents folder, if you don't have one.. just in case!
  5. Run the content upgrade app : dasblog\upgradedasblog\DasBlogUpgrader.exe
  6. Copy the dasblog\SiteConfig files to a temp local folder and using something like BeyondCompare merge in the few changes that you had made in your old install into the new siteSecurity.config and site.config files.
  7. Copy all of the files in your local dasBlog install up to your host server.   This is everything in the root and subdirectories, there are changes required in the bin, datepicker\themes, etc.  There may be folders you can safely ignore, I just did them all.
  8. Now is a good time to clean up all of the old logs in your remote \logs folder (see my comments dasBlog20Upgrade.aspx">here).
  9. Since I copied everything from the local install to the server, and SmartFTP keeps the modification date the same, I deleted everything in the root and sub folders (excluding content !) that had a date prior to 8/14/2007.  Necessary?  Not sure.. but if they aren't needed why not get rid of them?
  10. Log into your WebHost4Life account.  Select "Site Admin" from the top menu, then "Set .NET App" from the left pane.   Change the root version to .net 2.0.

If you had a previously working install of dasBlog 2.0, this is all it should take to do the upgrade.  If I missed something, leave a comment and let me know.

Wednesday, November 14, 2007 1:07:13 PM (Central Standard Time, UTC-06:00)  #    Comments [1] -
Random | utilities
 Monday, November 12, 2007

I'm using virtual PC on our build machine to keep archives of old development enviroments, every time we upgrade to new versions of Delphi or 3rd party controls I create a VPC archive with source code for that build version of our application.  As I was trying to put together an image for D2006 so I could finalize the update to D2007, I ran into a block because our base XP image was created some time ago and had a max size of 8gb.  Even though we use dynamic instead of fixed HD sizes, you define during the Virtual HD creation wizard what the max size of the drive can be.  I found a tool that lets you resize the VHD called VHD Resizer, but that doesn't do the full job - after you resize it you need to use something like Partition Magic to allocate the partition.  However we don't have a current version of it, the newest I can find is v 4.0 which doesn't support NTFS. 

So I've spent some time trying different things.  #1) Converting the dynamic to fixed size and then back again gives you no opportunity to change the VHD size, though it does take a hell of a long time to convert from dynamic to fixed.  #2) Tried using the freeware tool PartionLogic but couldn't get the iso to run under the virtual PC instance. #3) Dug through the cabnit and found a copy of Norton Systemworks 2001 to see if I could ghost or repartition the drive that way or to Ghost it to another VHD, gave up after 30min of frustration on getting a ghost image to be able to boot under VPC.  #4) Gave up with all the screwing around and wasted hours trying to get my damn VHD resized and dropped the $70 to buy a copy of Partion Magic 8.0.  It took me longer to do the download than to install and resize the partition - total time spent was maybe 15min.

For reference, yes I know I could have just mapped a 2nd drive to my VPC instance but this was a potential problem that I was going to face again in the future so I wanted to resize our base XP image and be done with it.  Also it was going to take some messing around to get all of the build utilities and such working on the 2nd HD, so resizing the main drive really was the best solution to the problem.  I should have just saved myself the time and frustration and purchased Partion Magic up front.  I've used it before, I knew it would work, so I should have known better.

IMO the stupid part about this is that you would think that Microsoft would have this functionality built into VirtualPC.  It can't be that uncommon of a tast to want to do, I found many posts & blogs on the topic during my search.  For the life of me I can't understand why they don't incorporate resizing VHD's.  Oh wait, I know.. because its Microsoft.  No company has made more money using other peoples ideas and doing it worse than they did, often driving the other company out of business in the process (or just buying them up).

Monday, November 12, 2007 2:11:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
utilities
 Saturday, November 10, 2007

Spent some time today upgrading the blog to dasblog 2.0.  The upgrade was pretty simple but ended up stuck because I couldn't log in after the upgrade was completed.  After a whole bunch of messing around poking at things and reviewing the config files I ended up downloading SmartFTP to try and recopy all the files which I had done manually the first time.  Ya, I know I should have done that to start with ... as it was I just used windows explorer and copied over the files that had changed.  Obviously that was a bad idea because it didn't work. 

Spent about 15 min downloading, installing, configuring SmartFTP and recopying all of the dasBlog 2.0 files to the website - bingo, it worked just fine.  So because I was too lazy to download it to start with I spent 1+ hrs messing around copying the files manually and trying get it working once I was done because it failed.  Windows Explorer = stupid FTP, and anyone chosing to use it isn't much better, myself included.

As part of the upgrade I realized I hadn't been cleaning out the old logs that dasBlog keeps.  Ended up writing a simple dos batch file to call an ftp script that will download all of the logs and then delete them from the server - here's the code for it.

CleanupDasblog.bat:
ftp -n -v -i -s:c:\scripts\CleanupDasblog.txt [ftp.yourwebsite.com] 

CleanupDasblog.txt:

USER [username]
[password]
cd [remotepath/log]
lcd [localpath\log]
mget *.*
mdel *.*
close
quit

Saturday, November 10, 2007 5:14:42 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Scripting | utilities
Fundraising for LLS
TeamInTraining - Contribute Now
Archive
<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


About the author/Disclaimer

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

© Copyright 2008
Rich Werning
Sign In
All Content © 2008, Rich Werning
My DasBlog theme is modified from 'Business' created by Christoph De Baene (delarou)