Skip to content

Creating a Template

Once you have VirtualBox installed it is time to create your first virtual machine.  It will become a template for all of the other machines.  I will be using Windows Server 2008 R2, x64.  You can download a 180 evaluation copy from Microsoft. You can download and then mount the ISO, or have a physical DVD.

Once you have some Windows Media available, fire up VirtualBox.  When you do, you will see a screen that looks a little like the following image.  This was not the first time I had fired up VirtualBox, so I had already played around and created a Linux image.  Once the application is open, click the blue icon on the ribbon labled ‘New’.

After you click the “New” icon, you will be presented with the following dialog, that asks for some basic information about the image you are about to create.  Pretty self explanitory.

After clicking the “Next” button,  the next dialog asks how much memory you want to allocate to the VM.  One of the beautiful things about virtualized environments is that you are not locked into this choice, and can easily modify this later.  Having said all of that, I set the default amount of RAM for this image to 1 GB.  As an aside, when I bought a laptop for setting this up, I did make sure I had plenty of memory and disk space 🙂

 

The next step is to create the hard drive for the server image.  There are two choices here.  First, how large will your drive be.  I have chosen 25 GB here.  The min for Windows 2008 R2 is 10 GB, and MS recommends 40.  I have chosen the middle ground of 25 GB.  The second option is whether you want to create the HD now, later, or use an existing one.  I have chosen now.

Once you have made the commitment to create a virtual hard drive, you need to pick a format.  I have not studied the various choices, so I took the native VirtualBox VDI format.

The next choice you have is one that I discovered the hard way. You can choose to create the disk as a fixed size or size it dynamically.  If you choose it as a fixed size, you will create a disk image file that takes all 25 GB from the get go.  If you choose dynamic, the disk image file will only be as large as the actual amount of data stored on it. Although that will save space, whenever you need to add data to your server, the image file needs to expand, and then the data gets written.  That slows things up a lot.  When I created my first template I did specify dynamic sizing, and Windows Updates took hours.  So the lesson is, make it fixed size.

The next screen confirms your settings, and then you are off.  The image files are created, and after a few minutes, you have a brand spankin’ new server. just waiting for you.  However, if you want your VMs to connect to each other, you need to change the networking sessions.   In the VirtualBox Manager, highlight the new image you have just created, and then either click on the settings icon on the top, or right-click the image and select settings.  Once the settings dialog opens, highlight the Network page anc then change the settings to Bridged Networking.Capture

Of course, the server can’t do anything yet, because you have not installed an OS.  To do this, you need to mount the OS disk you have.  In the VirtualBox Manager, highlight the new image you have just created, and then either click on the settings icon on the top, or right-click the image and select settings.  Once the settings dialog opens, highlight the Storage page, highlight the CD drive under the storage tree, then click the CD icon in the attributes pane (see highlighted items below).

You can then either browse to the ISO you have, or if using an actual disk, place that into the CD drive of the host machine, and then select the host drive.  Click OK, and then it is time to fire up your server.  Click the big green start arrow at the top of the VirtualBox manager, and then a window opens, and you can see your server POST, read from the CD, and start installing Windows.

At this point, there is nothing different about the Windows install.  You perform the tasks as you normally would, so I am not going to cover them.

After the server is installed, install all of the windows updates you would need, and change any settings you want to (time zone, Remote Desktop, etc.). Once you have that all set, you want to run sysprep. When running sysprep, make sure to check the generalize option, Select the Out of Box Experience, and under the shutdown options select “Shutdown”.

Once you have this base image established, if you do ANYTHING with it again besides cloning, you will need to rerun sysprep.

You are done.  You have a virtual server template ready for cloning away.

Leave a Reply

Your email address will not be published. Required fields are marked *