Windows command line scripts was for a long time the only way for scripting windows. With the Windows PowerShell you have can write scripts more like an program in object oriented way. Starting with Windows 7 it is preinstalled with version 2.0 but can as well installed under Windows XP or Vista. Windows 8 will ship with version 3.0 which adds windows work flow foundation functionality. Windows 7 ships with an IDE for PowerShell called Windows PowerShell ISE”. Scripts stored in files with .ps1 suffix. A sample hello world looks like this:

echo "hello world"

Save the content in a file called hello.ps1. Start the powershell by searching for powershell in the windows 7 search box above the start button and with right click to run as administrator. Change the current folder with cdto the one where you saved your first powershell script. Run your script with

.\hello.ps1

Unfortunately you get a PSSecurityException because powershell script execution is controlled by an security policy. Like Java signed jars you must sign your scripts and set the policy to execute only signed scripts

Set-ExecutionPolicy Restricted

Powershell accepts self signed certificates and can be created by the makecert command. Makecert is part of the windows SDK. Download the installer and run through the wizard steps. At the last screen deselect all parts and check only the tools under first section called Windows Native Code Development. Open a command shell with shift and right click on the folder C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin. Enter the following commands to create a authority:

I have successfully installed Ubuntu 10.04 Beta 1 on my Samsung NC10 with dual boot side by side to windows XP Home. The installation process is very smart and allow you to import settings like desktop background from the installed windows xp home. Printer configuration was a bit complicated. The first thing is to change the workgroup definition in

/etc/samba/smb.conf

workgroup = XYZ

Change XYZ to your windows 7 workgroup name. Next step is to uninstall the “Windows Live Sign-In Assistant” under windows 7 which is the main cause why the windows shares like the printers are not available from ubuntu. After that go to menu item System => administration => Printer. Click on add button and select from the list under network printer the last entry “windows printer via SAMBA”. When you now click on browse will be your workgroup and below your windows 7 pc with the printer shares be available.

Windows 7 Home Premium has no XP Mode Feature like in Pro or Ultimate Edition to run an Windows XP virtual machine seamless. Home Premium can be upgraded by Anytime Upgrade within Windows to Professional or Ultimate (90$* or 140$*). You need at least Professional Version for XP Mode. So i looked for alternatives. Under Windows XP was VMWare server 2.x my first choice without seamless mode. Seamless Mode made VM windows be available in host OS as “normal” windows without the rest of the VM OS. One Alternative is VMWare Workstation 7 with seamless mode (176€*). Paralells has currently an beta version available with Coherence (seamless) feature. Virtualbox as open source alternative has seamless mode too. You need only to install the guest additions of virtualbox, reboot after installation and call from menu “seamless mode”.

So i give Virtualbox a try and installed the current 3.0.10 version under Windows 7. VirtualBox can work with VMware VMDK Hard disks out of the box.

Currently that doesn’t seems to work with windows vista. Another VM in virtualbox with windows XP Professional works as expected in seamless mode.

Keep in mind that such a migration with Windows Vista as guest os needs another activation because of changed multiple hardware components.

Another possibility is to install the unofficial Virtual PC 6.1 for windows 7 from the knowledge base (32bit / 64bit). As described here you see in the windows 7 start menu the entries of the installed programs under the xp vm to start them directly in seamless mode. Comparing to the windows 7 XP mode their is the requirement for a separate windows xp license for a windows home or starter host os. Windows 7 professional or ultimate include such a license for a virtual windows xp on the same machine. Virtual PC needs a Virtualization hardware support like intel VT-X or AMD-V. The installation of Virtual PC fails if the processor and mainboard don’t fit to this requirement.

Startmenu entry of Virtual PC

Start installed Apps inside XP VM from Windows 7

Seamless started XP VM Application under Windows 7

*Price are only snapshots from the manufacturer websites without any guarantee and only provided to compare the possibilities.