Archive for the Windows Category

I was installing win7 on wifey’s new PC yesterday but the CD had been damaged.

I still had the Win7 iso file. I figured if I could dump them all onto a USB thumb-drive to install.

Found instruction here to make the USB bootable: http://www.intowindows.com/how-to-install-windows-7vista-from-usb-drive-detailed-100-working-guide/

I grabbed the beta for Battlefield 3 the other day. The installation complained about the out-of-date graphics drivers, but I went to install them nothing worked.

Solution here: http://www.hardwareheaven.com/windows-7-vista-radeon-display-drivers/205392-new-ati-driver-crashes-my-computer.html

A while ago I got excited about booting Windows 7 using Virtual Hard Drives as the boot media. I have always thought it would be great if I could use differencing disks so I could:

  • create new instances of OS’s super-fast
  • back up changed environments but only have to copy the differences (as opposed to moving 30+ Gigabyte files around the network.

I found a post from the folks over at lost techies that talked about how easy it is to set up a system that boots from VHD’s that are children of other VHD’s.

  1. Set up a “base” VHD
  2. Open an administrative console session:
    • > diskpart
    • > create vdisk file=”C:\vhd\starcraft.vhd” parent=”C:\vhd\win7base.vhd”
  3. I use some tools from NeoSmart Technologies like EasyBCD to put the diff disks as an option in your bootup sequence in your boot menu and – tada booting from a VHD diff disk

Most linux fiends will cry “WHY?” but I think if it makes more wife-friendly than it’s a good thing…

http://www.dawningvalley.com/2008/09/making-ubuntu-look-and-feel-like-windows-xp/

I thought it would be a breeze to create a differencing disk with VPC 2007.

I imagined the process to be:

  1. Create a virtual PC to be used as the parent for all images.
  2. Install <Operating System> onto the virtual PC.
  3. Create new virtual PC – create a virtual disk of type “difference”, and point it to the parent as it’s starting point.

Nope – it does not happen that way. It’s quite a convoluted process.

Luckily the folk at petri.co.il have already figured it all out.

Good work with simple instructions that are easy to follow. So easy, in fact, that I have myself a system where I can try out new ideas that are likely to mess up my PC – without messing up my PC.

I can create a new PC in probably less than a minute now. I can then do all the dodgy stuff I would never dream of doing on my own PC, without having to worry about it. Things like opening unverified executables, installing software I intend to use only once, testing a variety of software…

====

Here is the text from the previously mentioned link (just in case it goes down)

Step #1 – Create and install the base image VM

Without going into great detail here, create a new VM by specifying the name of the VM, the location of the virtual hard disk and the .VMC file, select the type of operating system you’re going to install, and allocate the right amount of memory to the VM. You can read more about creating virtual machines in Microsoft Virtual PC 2007 on my “Creating Virtual Machines with Microsoft Virtual PC 2007″ article .

After creating the VM you need to boot it, and install the required operating system on it. The installation process is as smooth as installing the OS on a real computer, and is only a notch slower (based upon your host’s machine hardware specifications.

If the OS requires entry of a CD-Key (or Product Key) – do it. If not (like Windows Vista), you can leave it to a later phase.

Make sure you install all the relevant components. Also, you might want to leave the ISO image for the installation CD available on the network in order to allow for future additions of OS components. In order to keep the virtual disk as small as possible I try not to copy the i386 (or equivalent) installation folder to the VM.

Step #2 – Customize the base image VM

In this step you will want to customize the base image VM as you want it to appear in all subsequent clones of that VM. For instance, install any file, tweak, addition, program, tool or other item that you want to have on ALL the VMs that are based upon this base VM.

If you plan to clone the base VM many times and you plan to have these machines on the same network (for example when creating an Active Directory-based lab of several servers and a few client machines) do NOT activate the base VM!

If all subsequent clones will work independently from one another (for example when creating a lab of one Windows XP Pro SP2 machine that will have several applications installed on it but none will work together at the same time or will not be part of the same AD domain) then you can activate the base VM.

Remember, cloning VMs is like “ghosting” a real machine. You must use SYSPREP in order to create unique SIDs, computer names and other settings for each cloned machine.

Read the Links section for more info on SYSPREP.

Also, note that you should install the VM Additions on the base VM.

Step #3 – Temporarily enable undo disks for the base image VM

Next comes the nice part. After customizing the base image you need to shut down the base VM. Make sure you do NOT perform the following step unless you are 100% sure that the current state of the base VM is EXACTLY like you want it to be cloned. You will NOT be able to easily modify the base VM AFTER you’re created differencing disks of it, so pay close attention.

In the Microsoft Virtual PC console, click on the Settings button for the base image VM. Click on the Enable Undo Disks checkbox and click Ok.

At this moment you should have 2 files in the base VM’s folder. A VHD file for the virtual disk, and a VMC file for the VM settings.

Step #4 – Boot the base image VM once and quickly shutdown without committing changes

Now you need to boot the base image VM once. Let it boot all the way, log on to the OS if you want to.

If the base image cannot be booted “all the way”, because, for example, you’ve got a SYSPREP unattended script waiting for the cloned machines to be booted and you’d like to keep it that way, do NOT boot it “all the way”, and instead just let the VM boot for a few seconds. When either the logon page has appeared, or you think enough time has passed (and a few seconds is all you need), close the base VM by closing the Virtual PC window for the VM.

Make sure you select Turn Off and Save Changes from the drop-down list, and UNSELECT the Commit Changes to the Hard Disk checkbox. Now press Ok.

If you look at the base VM’s folder you will see 3 files. A VHD file for the virtual disk, a VMC file for the VM settings, and a VUD file for the undo disk. The VUD file is probably very small, but fear not, it will not remain so for long.

Step #5 – Rename the undo disk

Now we need to rename the VUD undo disk to whatever the new cloned hard disk will be called, and change the file type to VHD. Click on the VUD file and either right-click and select Rename or press F2.

Now you have a (small) new VHD that is linked to the base virtual hard disk of the base VM.

You can also copy the original VMC file, or, if you want to, you can create a new one in step #7.

Step #6 – Disable undo disks for the base image VM

Now we need to disable the Undo Disk feature for the base VM. In the Microsoft Virtual PC console, click on the Settings button for the base image VM. Click to UNSELECT the Enable Undo Disks checkbox and click Ok.

Note: You must never re-boot the base VM. If you do so, you might ruin all the differencing disks that are related to it.

Step #7 – Delete the base VM from the Virtual PC console

Since you are not allowed to ever reboot the base VM you can simply delete it from the list of VMs in the Virtual PC console.

Step #8 – Configure the base VM hard disk to be read only

Open Windows Explorer, right-click on the original VHD file, and select Read Only. Press Ok.

Step #9 – Create a new VM by using the renamed undo disk of the base image VM

Now we can create as many new VMs from the cloned VUD file that we renamed in step #5. You can copy that file as many times as you want, and for each time you copy it you can create a VM out of it. Follow the steps outlined in my “Creating Virtual Machines with Microsoft Virtual PC 2007″ article.

Note: Remember the SYSPREP issues mentioned in step #2. Any cloned machine that you want to place on the same network as other cloned machines must be SYSPREPed. Note: The cloned VM hard disks can have Undo Disks enabled on them, if you so please. Note: Remember, you will (probably) need to activate each cloned machine, unless you’re using an OS that does not require activation or has a VLK license. Finally, when you boot your cloned machines they work normally, and when you close them they save their changes to the differencing virtual hard disk that uses the now-unchanged base VM hard disk.

Now that I have installed winXP I think it’s time to back it up.

Summary

[Backup]
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

[Verify backup files]
~$ md5sum /dev/hda1

~$ cat winxpsp2.img-part-* | bunzip2 | md5sum

[Restore]
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Detail

The dd command seems to be the way to go, but it backs up empty space as well, so I am using the compression tool bzip2 to ensure I don’t waste too much space. I’ll be storing the backup files on my network file server share.

First I’ll have to mount my file server shared directory:
~$ sudo mkdir /media/fileserver
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

This command failed with the following error (grrr):
smbfs: mount_data version 1919251317 is not supported

After a quick google session I found that it means the smbfs package is not installed. I installed smbfs via: sudo apt-get install smbfs then executed this again:
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

Now we are ready to backup not just the windows installation, but the entire partition that it is installed on.

The command to back up the partition is:
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

Where sudo time dd if=/dev/hda1 ibs=4096 means:

sudo Super user do. That is, do the following command as the root user.
time Report how long the commands took
dd Disk Dump (as far as I know)
if In file
/dev/hda1 A reference to the partition that has windows on it
ibs Input byte size. That is, read 4096 bytes at a time
   

The results of the above commands are then piped into the bzip2 compression tool where bzip2 -v --fast means:

bzip2 Name of compression program
-v Do verbose logging (a bit pointless when piping – it really shouldn’t be there)
–fast Do fast compression. basically means it’s compressing smaller block sizes, which leads to sub-optimal compression. 7.5GB is still going to take about 2 hours on my AMD 2500+ CPU

The output of the compression tool is then piped (yet again) to a tool called split that splits large files into smaller ones. It uses the following syntax split -a 2 -b 1024m - winxpsp2.img-part- where:

split Name of splitting program
-a 2 The number indicates how many suffixes to use in the output file name. Say I split a large file into 3 pieces. I can use -a 1 to give me three files called filea, fileb and fileb. Using -a 2 would result in three files called fileaa, fileab and fileac.
-b 1024m Indicates the maximum size of each split output file – in this case 1024MB (1 gigabyte)
- winxpsp2.img-part-: The first dash means read from standard input (or piped input – same thing really). Usually you could put the name of a file to split. The ‘winxpsp2.img-part-‘ bit means to name each file winxpsp2.img-part- followed by the specified amount of suffices. In this case winxpsp2.img-part-aa, winxpsp2.img-part-ab, … winxpsp2.img-part-ah.

Eventually I guess I’ll do something silly and trash Windows XP. If that is the case I should be able to restore it by:
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Tada! A brand new windows installation in mint condition.

A lot of steps:

  1. Install WinXP SP2 from CD
  2. Adjust folder settings. I like to see the folders NOT in simple view. I also like to see extensions.
  3. Move ‘My Documents’ to be on another partition
  4. Install motherboard drivers
  5. Turn off firewall, autoupdate and virus protection, then disable security center alerts.
  6. Join my local PC workgroup.
  7. Set up network 10.10.0.x/255.255.255.0
  8. Configure the cmd shell. I like 100 chars wide, 55 deep, black background, light green text.
  9. Install a firewall. Currently using an old version of Tiny Personal Firewall (version 2). Might be time to try something else…
  10. Do lots of Windows Updates and enjoy your Windows Genuine Advantage check.
  11. Set https://google.com/ig as homepage in IE7
  12. Disable autoruns on all devices. (ie usb, CD’s, DVD’s etc)
  13. Install eraser to zero out all the unused HDD space.

It’s at this point that I figured the installation is worth backing up. (See next post…)

Before i re-install windows I thought it would be prudent to ensure that I select the correct partition to install on.

Finding out how your partitions are set up is quite easy in Ubuntu. Bring up a command shell and start the The GNU Parted disk partition resizing program, otherwise known as “parted”. To start it type sudo parted at the prompt.

Then all you have to do is type print all. Here is the output from print all on my PC:

Disk /dev/hda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
.
Number Start End Size Type File system Flags
1 32.3kB 7863MB 7863MB primary fat32 boot
4 7863MB 15.7GB 7863MB primary ext3
2 15.7GB 79.5GB 63.8GB primary fat32 lba
3 79.5GB 80.0GB 526MB extended lba
5 79.5GB 80.0GB 526MB logical linux-swap
.
Disk /dev/hdc: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
.
Number Start End Size Type File system Flags
1 32.3kB 200GB 200GB primary ntfs

You can see I have two hard drives. Ubuntu references them as /dev/hda and /dev/hdc.

/dev/hdc is just a single partition of 200GB that I use to stash data on (My Documents, family pictures, mp3′s etc).

The other one – /dev/hda is a smaller drive I use to hold my operating systems. The logic here is that I can re-install Windows/Ubuntu as often as I like and my data will remain intact on the PC.

hda: [80GB] First hard drive

  • hda1: [7.8GB] Windows installation (C:\)
  • hda2: [63.8GB] General dumping ground – shared between operating systems. (G:\ in windows. Known as /media/hda2 in ubuntu).
  • hda3: [0.5GB] extended partition for holding logical partitions
  • hda4: [7.8GB] Ubuntu installation (\)
  • hda5: [0.5GB] linux swap partition

hdc: [200GB] Second hard drive

  • hdc1: [200GB] Data drive. (D:\ in windows. Known as /media/hdc1 in Ubuntu).

At home the study PC is used by the entire family. We all share the same account. I’ve been getting quite into Ubuntu for quite some time now, the only thing stopping me from moving entirely to Ubuntu is the wife factor.

  1. Email clients are different.
  2. Everything looks different.

Our windows email client is Eudora. While it’s in the process of being open-sourced there is still no linux client. The reason we don’t just switch is due to the history. We’ve got 5+ years of emails, attachments and addresses stashed away in Eudora that I am not sure how to port over to something like Thunderbird.

So, in the meantime I’ve installed Ubuntu 7.04 (aka Feisty Fawn) – desktop edition to another partition and have settled on dual-booting until I can get these things sorted out. I am slowly working on problem 2 – Everything looks different…

I found a post on whirlpool that mentioned some of the things I was thinking – like xpde an xp theme for Ubuntu. But I didn;t like xpde, and figured I could come up with something that was more like the theme we use at home.

One guy mentioned replacing the Ubuntu menu icon with a more windowsy start icon.

 

The Ubuntu logo icon is called ‘distributor-logo.png’ and right now 95% of themes and icon sets are unaware of it as it has just been introduced. This will change. But for now, just replace it. Either globally (/usr/share/icons/hicolor/48×48/ap­ ps/distributor-logo.png) or per-user (~/.icons/name_of_your_current_ico­ n_theme/somedir/apps/gnome-main-menu.ext).

So I made one. Tada:

You can probably guess that I am a fan of Windows 2000 themes. We still use Windows 2000 at home, and I dislike the XP theme enough that I switched my work PC back to the Windows 2000 look’n'feel asap.

Update (7 March 2008)

I managed to get linux and windows reading the same profile information so they could share the same emails and address books. One way to do is outlined here, but I found an even easier way:

  • Install Thunderbird on first OS
  • Make sure your profile is stored on a partition that can be read by both windows and linux (ie a FAT32 partition).
  • Check everything is still AOK in first OS
  • Reboot into your other OS and open Thunderbird using the “-P” parameter to ensure the profile is asked for.
  • Point it to the funny named directory (something like 1a2s3d4fg5.default).
  • Tada! Your alternate OS can read and share the same email  and address book.

Worked a treat for me.

Last night I downloaded the new free versions of:
- VMWare server last night.
- MS’s Virtual PC 2004.

I’d played with a free (then warezed) version of Virtual PC 2004 before and was pretty impressed.

Well, I am writing this in virtual (VMWare) version of the the latest Ubuntu offering. I must say it’s even better than MS’s offering.

I can’t really offer too much in the way of insight into the newer version of Ubuntu as I’ve only just installed literally seconds ago. But the way VMWare cranks along – yeah I like it. And free is good too. And this is on an ancient machine with only 512MB of RAM.

The only problem I had was that it installed the virtual HDD as a SCSI rather than IDE. No biggy though – took all of 1 minute to find and fix.

Must go – world of warcraft awaits…