How To Create Virtual Machine In Windows Server 2008 R2
The Liberty of Virtualization
For awhile now I have been enjoying the freedom of developing with virtual machines. The biggest advantage information technology has given me lately is the freedom to do whatsoever I want to the laptop I use as a workstation. What I mean by that is I don't even blink twice if I want to try a new operating system anymore. Maybe I want to run a version of Debian Linux or Ubuntu to continue my Unix skills polished upward. Or maybe I want to try running a 64bit version of Windows Server as my main operating organization to see if all of my hardware works. To consider doing this previously without virtualization would be nearly unthinkable because of the amount of time it would accept to get everything back upwardly and running.
All of this liberty of option is made possible through virtualization, specifically with VMWare Workstation. VMware runs on a variety of operating systems including Windows, Linux and Mac. Once my operating system is installed along with the needed vitalization tools I tin literally go back to work by just starting up a virtual machine where all of my tools are stored. Compared to setting up a full blown development machine this is huge. Not just that merely virtualization allows developers like myself to try out alphas, CTPs, betas and more than without harming the main development operating system. This ability to test software is made possible through cloning and what is chosen snapshots inside VMWare.
I'grand writing this article about virtualization for two reasons. One because I've spent a lot of fourth dimension tweaking my setup and I wanted to document information technology. And two, I know there are others that tin can benefit from this information equally well. In this article I'thou going to encompass setting upwards a VM (virtual machine) from scratch. Then how to configure the operating system specifically for development in VMWare. The purpose of this setup is to configure Windows Server 2008 as a evolution platform using VMWare. Let'southward get going!
Creating Your Base Virtual Machine
When starting from scratch I always create what I call a base virtual machine (VM). This VM serves as my base epitome for all of my needs and volition be re-used for various setups. There are few things you need to keep in mind when you create a base image. I'll marker these as we continue in the screen shots below. For posterity sakes, annotation that I'm using VMWare Workstation six.
One time VMWare Workstation is installed click File->New Virtual Machine.
Although VMWare supports Server 2008 every bit "experimental" I've found that choosing Windows Vista works just equally well. One time 2008 support is fully supported in a hereafter release of Workstation this will non exist difficult to change.
You'll notice below that I'chiliad storing this VM on the F:\ drive not the C:\ bulldoze. To really get performance out of your virtual machines y'all need to separate them onto a different spindle or disk. I utilise an external Western Digital 500GB MyBook which has a 7200RPM difficult drive. When I travel I sync my virtual machines with my portable 250GB passport drive. This allows me to use a faster disk when I'k in the office which provides more speed and also provides a fill-in of the virtual machines.
I have 4GBs of retention in my laptop of which three.3GB is really accessible. While I could give the VM 2GB of memory, I find that sticking between ane-one.5GB of memory seems to be the sweet spot. If you use too much it slows the host machine down.
For networking I use bridge networking for some VMs and NAT for others. As you'll see afterwards on I will create ii dissimilar setups from this base prototype. Ane volition exist for work, the other for presentations and speaking. For work I use a bridge network since this allows me to separate the VPN connection from my host machine completely. While I'yard at home this allows me to access my local area network from my host machine (printers, abode server, file storage, backups, etc). For the other VM I use NAT.
Doing some reading and research the LSI Logic I/O adapter is supposedly the faster choice for SCSI adapters.
Disk chapters is something you really need to call up about earlier setting this option. I made the mistake of setting upwardly a consummate VM environment just to realize I needed more space. While virtual machines can be resized using the deejay manager utility, they cannot be resized if in that location are clones or snapshots tied to the VM. For me this meant I had to blow away a lot of my work and become back to my base images (which is another reason why I practice full cloning to start with equally you lot'll come across subsequently).
You'll detect I didn't choose "Allocate all disk infinite now". Essentially what this does is it reserves all of your difficult drive space for your VM. Recollect of information technology like formatting your VM epitome files. As noted there is a performance gain. However, this also means you lot are going to take upwards as much deejay space as you enter in the field below. In my case if this was checked, I'd eat upward 50GB of disk space on the drive. Not fun, peculiarly when cloning full images (50GB + 50GB + 50GB). Thus I do not cheque this selection. I exercise withal split the files into 2GB files. The master reason is for defragmentation. If you accept one large image file you demand twice the amount of space to defrag it. With 2GB files you lot'll just need an additional 2GB of infinite.
That's my notes or tips for setting upwards a base virtual auto. After the virtual machine is setup be certain to check your settings and configure your monitors and other peripherals.
Setting Up Windows Server 2008 for VMWare Workstation
Once yous get your settings tweaked launch the VM and become the Windows startup started. I similar using server as my development operating organisation (OS) because it is tuned for speed unlike Vista. At that place is a large difference in developing on Vista and Server 2008. Even comparing XP and Server 2003 there was a huge speed difference. A lot of things are turned off in server that are enabled in Vista and this is what contributes to its speed. This setup volition walk through how to configure Server every bit a workstation along with some specific VMWare things y'all need to practice as well.
In one case the operating system is installed, follow these simple steps to ready the image.
Step 1 – Tools
The very outset thing you need to practise after the OS boots up is install VMWare Tools. This will provide drivers for the Os to run smoother and assistance you go on your sanity. Things like the mouse jumping around randomly for no apparent reason will be fixed once this is installed. Afterward installed, reboot.
Step 2 – Updates
Bank check for updates. This is pretty much something you need to practice on whatsoever operating arrangement you lot install. Install the updates and reboot. Note: at the time of this commodity there are 9 updates for Server 2008.
Step 3 – Time Zone
Using the "Initial Configuration Tasks" screen which should be on the screen afterwards the reboot there are a few things you need to exercise. For starters bank check your time zone. Review the other options while y'all are in in that location and brand sure your computer proper noun is setup the way you want and other things.
Pace four – Shutdown Tracker
If you are familiar with Server you know it annoyingly asks you why information technology was restarted after it reboots. While this might be handy for *existent* servers for a workstation used for development it is simply annoying. To disable this open up Commencement->Run->gpedit.msc. Find the "Brandish Shutdown Event Tracker" equally shown below, right click properties and disable it.
Step 5 – IE Security
In order to use Server 2008 as a workstation inside your VM you lot volition need to remove the baked in security settings for IE. From within Server Managing director as prove here select "Configure IE ESC".
Set both settings to OFF.
Reboot.
Step 6 – Features
Within Server Manager you volition as well need to enable all the features you want.
Here are the options I enable since I know this image is going to be primarily used for .Net evolution.
- .NET Framework three.0
- Desktop Feel – This includes eye candy features from Vista as well every bit allows you to back up the Vista Themes (we'll enable this subsequently on).
- Remote Assistance
- Powershell
- Windows Process Activation Service
In the next screen you lot'll be asked to configure IIS. I ever select a minimal setup but feel gratis to select what y'all know you will need.
Restart to complete installation.
Stride 7 – Roles
In lodge to get fast file searching and other features you lot'll demand to turn on the role for File Services as shown here.
Since this is running in a VM depending on your usage yous *could* leave this off. I am basically going to be working day in and solar day out from this image so having the ability to search and observe emails and files quickly is important.
Footstep 7 – Registry Settings (optional)
Open the registry editor by doing Start->Run->regedit
Add the following keys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters
Add a new DWORD by the proper name of EnablePrefetcher and assign is the value of iii
Add a new DWORD by the name of EnableSuperfetch and assign is the value of iii
What does this practice? It enables Windows to larn which programs yous apply so it can pre-load those applications before you run then. It is a feature that was added in Vista. You can also skip this pace if yous experience at that place is no value in this feature but it is *suppose* to speed things up down the road.
Stride viii – Services
There are several services we need to enable to get Server 2008 to conduct more like a workstation. These are disabled by default.
Within Server Manager select Configuration->Services. Or you tin do Starting time->Run-Services.msc.
Enable the post-obit services:
- Themes
- SuperFetch (only if you enabled the registry setting above)
- Windows Sound
- Windows Sound Endpoint Builder
Step 9 (optional) – Make information technology pretty
Totally optional and something yous may or may non desire to enable since this is running in a VM. I've found that things are still pretty snappy but you may want to meet how your mileage varies. Right click on the desktop and select Theme. Choose the Vista Theme in the drop down to get a Vista look and feel for your virtual motorcar.
Before:
After:
Pace 10 – Setup Sound
When you lot install Server 2008 yous'll notice that sound doesn't work. Vista does the same matter and so this will work in either case. In order to become sound to piece of work you have to install the Creative Labs PCI sound commuter. Information technology is a pita to discover so I am attaching it to this commodity so I can hands find information technology downward the road besides as to ease your setup pains.
Download Sound Driver: Create Labs Driver
Footstep eleven – Activate Windows
We are going to be in the control panel tweaking some things next. While we are here, go alee and activate Windows. Nothing is worse than forgetting to practice this, and so having to practise it on every clone or snapshot downward the line as you build up your VMs.
Note: If you are using a MSDN License, you lot will get a DNS error code while trying to activate after installing Windows. This is because you demand to modify the product key and enter your *existent* production key.
Step 12 – Functioning Settings
Accommodate the processor scheduling which is in Control Console->Arrangement->Advanced Settings->Advanced.
In the side by side tab, turn on DEP.
Step 13 – Defragment
In order to make this the fastest VM we can, we need to defrag the drive. Defragmenting the VM is the primal to keeping things fast.
Afterwards I install a large product like Part, or Visual Studio I defrag the bulldoze. Also remember to defrag the drive the virtual auto is running from! The more you defrag, the more performance you'll go out of your VMs.
Step 14 – VM Optimizations
I'one thousand non a VMWare practiced but at that place are a few things I take found out that work well. For ane since I/O is important because the VMs will be run from an external drive, I disable page sharing. Add this line to your .VMX configuration file.
sched.mem.pshare.enable = "FALSE"
Some other option is memory trimming which doesn't consume upwards host memory and so give information technology back when it needs it.
MemTrimRate = 0
Step 15 – Setup Your User Account
We've been logged into the VM equally Administrator up until this point. We need to create an account that we volition utilise to login with and do work. We desire to create this account now because we want to prepare our desktop settings once and then each VM we clone from this base image we'll already take everything setup. Create your account in the command console, I suggest setting the account as an ambassador. Once the account is created, log out of the ambassador account and then setup that account.
Step 16 – Shrink Deejay
Before moving frontward we demand to shrink our VM deejay. This reclaims unused space on the drive. Annotation, nosotros cannot shrink a disk if it has been cloned or has a snapshot. We also can't compress a disk that has been pre-allocated. If you followed the steps upwards to this signal, none of this should exist a business organization. There are several steps. The showtime is VMWare tools prepares the paradigm and so the 2nd is where Workstation performs the actual shrinking. Remember to defrag everything first!
To shrink the deejay go into Control Panel->VMWare Tools. Select the shrink tab and press the "Set to compress" button. Then await.
In one case this process finishes yous will be prompted with this dialog. Click yes to begin the procedure.
At this bespeak we take a make clean VM paradigm to build other virtual machines from. It has all the updates applied to it, is configured for workstation utilize, is defragged and has been shrunk. The only affair in this virtual machine is the operating system. This is what I phone call the base image. Note: My base epitome is 6.1GB after it has been shrunk.
Step 17 – Create Full Clone
Now that you have this paradigm setup. Create a total clone of it. Using the clone, add your evolution tools like Visual Studio, SQL Server, etc.
UPnP Tip
If y'all are running Server 2008 on a private network and want to connect to UPnP devices and see them via network discovery and then meet this post which enables that.
Strategy For Cloning Virtual Machines
Once I get through the procedure above I split this base image off into 2 full clones. It takes a long time to get this base prototype setup thus it isn't something one wants to repeat often. By using a feature of VMWare Workstation called cloning we can create an exact clone of this base image to build other images.
What I do is create two full clones of this base prototype. I utilise 1 for piece of work since it has to be bound to the domain. The other I use for installing various pieces of software for personal use and for speaking engagements.
For the VM at piece of work I create 1 called work base of operations. This image will serve every bit my base paradigm that I volition install VPN software, Function 2007 and a few other utilities needed for work. Once I get this image setup I create another clone of it that is a linked clone. In this clone I install all of my development tools. This gives me a hard restore / starting point where I tin can install or exam software without development tools. The reason I do all of this is it allows me to go back to points in time and endeavor something dissimilar out without having to build everything from scratch. For example allow's say a new version of Visual Studio comes out I need to test or something like that. To play with that type of software it is of import to start from a fairly clean machine. Here is a nautical chart I put together to testify how I layout my virtual machines.
You'll detect there are no snapshots listed above (another feature VMWare supports). Snapshots are really meant for temporary utilise, not to run for long periods of time. This setup gives me actually expert flexibility. At least to the point to where I oasis't needed to alter it much at all. That'south pretty much information technology. Once this setup is done I don't touch on the "Server Base" paradigm except to start information technology upwards occasionally to apply updates. The only affair I use it for moving forwards is for cloning then I take an optimized image to get-go with no matter the scenario.
I hope this helps someone out. I know I wish I'd had something similar this to refer to when I started out playing with virtualization images for evolution. As I detect new tricks or things I'm sure I'll update this over time thus I consider this commodity a moving target. Ane thing that is for certain is the way you exercise things today will not exist the style you practise things tomorrow. If you haven't explored virtualizing your development give it a try. Here are some Words of Wisdom 'll go out you with:
"When y'all virtualize your development or principal body of piece of work, information technology doesn't thing which operating system you run to host it." – The Elder
Source: http://keithelder.net/2008/06/30/setting-up-windows-server-2008-vmware-virtual-machines-for-net/
Posted by: brownwitheme.blogspot.com

0 Response to "How To Create Virtual Machine In Windows Server 2008 R2"
Post a Comment