Network Administrator Knowledgebase: June, 2009 archives

Network Administrator Knowledgebase:

June, 2009

Jun 25 2009   7:00AM GMT

Windows Preinstallation Environment (Windows PE 3.0 - based on Windows 7)



Posted by: Michael Khanin
WinPE, winpe 3.0

Windows® Preinstallation Environment (Windows PE) is a minimal operating system designed to prepare a computer for Windows installation (and not just for Installation). Windows PE is available as a stand-alone product to customers with the proper licensing agreement. It is an integrated component of many Windows Setup and recovery technologies, including Setup for Windows® 7and Windows Deployment Services (WDS).

Windows PE 3.0 is the latest release based on the Windows 7 operating system.

I’ve changed few scripts that I’ve found on MSFN Forum and now I’d like to share a script, that will create a WinPE 3.0 ISO just by one click :)…

I called this script _WinPE-3_Builder.bat. here is a content of _WinPE-3_Builder.bat:

@Echo off
%SYSTEMDRIVE%

CD “C:\Program Files\Windows AIK\Tools\PETools”

Set Architecture=x86
Set PEDest=c:\winpe_x86
Set ISOName=winpe_x86.iso
Set removeboot=true

pushd %cd%

call copype.cmd %Architecture% %PEDest%

Dism /Mount-Wim /WimFile:%PEDest%\winpe.wim /index:1 /MountDir:%PEDest%\mount
Dism /image:%PEDest%\mount /Get-Packages

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-hta.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-hta_en-us.cab”

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-legacysetup.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-legacysetup_en-us.cab”

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-mdac.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-mdac_en-us.cab”

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-pppoe.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-PPPOE_en-us.cab”

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-scripting.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-scripting_en-us.cab”

REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup.cab”
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup_en-us.cab”

REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup-client.cab”
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup-client_en-us.cab”

REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup-server.cab”
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup-server_en-us.cab”

Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-wmi.cab”
Dism /image:%PEDest%\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-wmi_en-us.cab”

copy “C:\Program Files\Windows AIK\Tools\%Architecture%\imagex.exe” %PEDest%\mount\Windows\System32\

Dism /Unmount-Wim /MountDir:%PEDest%\mount /Commit
Copy %PEDest%\winpe.wim %PEDest%\ISO\sources\boot.wim

IF “%removeboot%”==”true” del /q %pedest%\iso\boot\bootfix.bin

oscdimg -n -b%PEDest%\etfsboot.com %PEDest%\ISO %PEDest%\%ISOName%

popd

Jun 24 2009   7:00AM GMT

Hyper-V: Step-by-Step Guide to Using Live Migration in Windows Server 2008 R2



Posted by: Michael Khanin
Microsoft Hyper-V Server 2008 R2

Microsoft released Step-by-Step Guide to Using Live Migration in Windows Server 2008 R2


Jun 23 2009   7:00AM GMT

SSH in vSphere 4i



Posted by: Michael Khanin
SSH, vSphere 4i

To enable SSH in vSphere 4i we should do the following steps (similar as esx 3i):

1. First, press Alt + f1 then type “unsupported” and press enter.
2. At the prompt for password, provide the credentials, previously configured, and we will be able to log in to the service console.
3. Do a vi /etc/inetd.conf and look for #ssh. Remove the # and save the file after this.
4. Go to /sbin, and run this command ./services.sh restart

Now, we will have SSH enabled.


Jun 22 2009   7:00AM GMT

Install Windows updates on the command line and in scripts



Posted by: Michael Khanin
windows updates, wsus, Command line

Everybody knows that i’m a real fan of scripting :).
I was really happy to read post of Michael Pietroforte about WuInstall 1.2 Pro

Continue at http://4sysops.com


Jun 21 2009   3:50PM GMT

The Windows 7 Upgrade Advisor Beta



Posted by: Michael Khanin
Win7, Windows 7, Advisor

Want a quick way to check if your PC can run Windows 7? In general, if your PC can run Windows Vista, it can run Windows 7. But if you’re not running Windows Vista, or are just not sure if your system is ready to run Windows 7, download the Windows 7 Upgrade Advisor Beta. The Windows 7 Upgrade Advisor Beta is a pre-release version, and is available in U.S. English only.


Jun 21 2009   3:41PM GMT

How To Shrink VMware Virtual Disk Files (.vmdk) (Windows OS installed as Guest).



Posted by: Michael Khanin
vmdk, virtual disk, shrink

Recently I worked on building VM Appliance and when I was ready to convert my VM to appliance I’ve figured out that virtual disk is too big. So, I did what I usually do in this situation. And now I’d like to show how you can shrink the virtual disk files of your VMware virtual machines so that if you zip them, they will use much less space. It is then easier to upload and share them with other people.

Yes, I know, many of you now said “Misha is going to talk about Shrink”. You know what, you pretty true, but …

Everybody knows What the “shrink” does. Shrink removes an empty space from .VMDK file.

However, the problem is this: What is empty space?

When Windows deletes a file, it doesn’t actually delete the data on the disk, it just deletes the references/pointers in the file allocation table. So when “Shrink” is processing a vmdk and is looking at the raw disk, it’s seeing values that aren’t empty (non-zero), and exports them as such.

You can easily test this out. Create a new vmdk on a VM. Export the VMDK right after you’ve created it. The exported files will be very small. Now fill the vmdk up with files and export; it will be very big. Now, delete all the files in the vmdk and export; it’ll still be big! If you will try to do a “Shrink”, you will see that the vmdk file is still big.

So, before doing a Shrink, I’m always using a really cool command line tool developed by Mark Russinovich, SDelete. Simply, execute SDelete with parameter -c inside running Virtual machine, then shut down the Guest and do a Shrink.

Last note. Just in case you forget how to do a shrink ;). From command line go to C:\Programme\VMware\VMware Server\ and execute the vmware-vdiskmanager.exe as shown in following example:

“C:\Programme\VMware\VMware Server\vmware-vdiskmanager.exe” -k “ITSTUFF-SRV-1.vmdk”