This post if part of the Student Project Express, a series in which I am showing how to complete a Student project using Microsoft technologies. The table of contents for the series is available here and I will keep it updated as as publish more content.
After the last post, we have all the software we need to setup our production environment. As mentioned in the previous post, we will create a virtual machine that will act as our environment so that we can actually simulate the whole development/testing/deployment process.
Creating a virtual “production” server
Based on the version of Windows you are running you have a number of different choices to make this.
If you are using Windows XP or Windows Vista, you need to download and install VirtualPC 2007.
If you are using Windows 7 you need to download and install Windows Virtual PC.
While the interface for the two versions is slightly different, they work in a very similar way. First of all what we need to do is to create a new Virtual Machine where we will then install the operating system and all the software we need there.
While doing so, we will create a virtual hard drive, which is a file (extension .VHD) which “simulates” a real hard drive and where all the OS and data in the Virtual machine will be stored. It can be partitioned, backed up, etc just like a normal HD. Of course we will need enough storage on a physical disk to store the VHD file but the good thing is that the VHD format is “smart” meaning that it will only use the space it actually needs (i.e. we can create a 100GB VHD and it will start as a very small file which will expand when we actually write into it).
I am now assuming we are running Windows 7 and will use screenshots from Windows 7… if you have XP or Vista the procedure will be very similar!
You can launch Windows Virtual PC by clicking on the Start menu, typing “virtual pc” and clicking on the Windows Virtual PC icon. This will open a folder which will look like this:
Click on the Create virtual machine and this will launch the wizard which will guide us through the whole process (more details on this here):
As mentioned this created two files in the D:\VMs\Production. The .vmc file contains the VM settings and the .VHD file is the virtual hard drive (note that it’s just 257 KB now and it will expand as we keep writing information into it).
Installing the software on the virtual machine
Let’s start our production virtual machine by accessing our Virtual PC folder (or launching Virtual PC on Windows XP and Windows Vista) and double clicking on the PRODUCTION VM. By doing so we are “powering up” the machine, just like if we would switch on a physical one… and of course it will not know what to do as it does not have anything installed into it yet!
To make it access the Windows Server 2008 file we just downloaded we need to click on the Tools menu then settings and from the following window select the DVD drive option and browse to the proper .img file
Click on ok and click on the CRTL+ALT+DEL button on the VM to start again the boot up sequence. This time Virtual PC should recognise the IMG image as a DVD and boot from there and let you install Windows Server 2008.
The process is quite straightforward and I will not go step by step into it. If you need some help you can check this good post on Daniel Petri’s blog. The only one thing to notice is that during the installation process, when we click on the Virtual Machine window it will “capture” the mouse pointer showing the following warning message:
This happens because the OS inside the VM at the moment is not aware of being executed in a virtualised environment… after completing the setup we will install the “integration components” which will fix this.
So, in terms of which version to install we need to select Windows Server 2008 Standard Edition x86 (which is the one Dreakspark gives access to). Also make sure you select Full Installation and not the Server Core. If you are interested in the difference between the various versions, check out the Windows Server 2008 website.
At the end of the process, log into your brand new server and you should the initial configuration tasks window:
This is where we will perform the initial configuration by defining things like timezone, networking options, domain joining, etc. Part of this step is to configure how the system will get its updates. Since this is a production environment, it is actually recommended NOT to perform automatic updates (while I would DEFINITELY recommend you enable that for you own machine!).
Anyway, you should definitely check and install updates at this time as you want to start from a fully patched machine. To do so just select the “Download and install updates link” and then the Check for updates button on Windows Update.
Since we are installing Windows Server 2008 which is a 2 years old OS at the moment I am writing, it will definitely take a while to get, download and install all the updates so allow yourself some time to do this and check the next post once your server is fully patched! In my case I need to download and install about 60 different updates:
Please note that you may require to run Windows Update a few times as updates you receive depend on what is already installed. Make sure you receive no further updates before moving on to the next post.
Also note that while most of the install will be automatic, some will require some user input (such as the installation of Service Pack 2) so… keep an eye on your virtual machine (although you can definitely do other things while the installation proceeds).