Thursday, March 04, 2010

Setting up a vanilla virtual environment in SharePoint 2010 only once and reuse it forever!

One of the first things you might need to start working in SharePoint 2010 is to set an environment to work with. I personally recommend to work in a virtualized environment so you can take VM snapshots and safely roll back to them if things get.. err a bit messy :)


I've been recently using Sun Virtual Box, it's quite reliable, fast, easy to use and guess what? support 64-bit integration! So you can start by creating a new VM with SharePoint plus any features you want.


Creating a fully opertional vanilla VM with SharePoint is quite a long and tedious process to undertake but fortunately you won't need to do that again if you keep that VM as the main template and then take copies of it whenever you need. To successfully rename a SharePoint 2010 VM follow the steps below. 


 1. Copy the VM to the desired localtion and start it.


2. Change Alternate Access Mappings
Central Admin > System Settings > Configure alternate access mappings
Click on each entry under 'Internal URL' and change to use the new machine name, keeping port number and zone the same
After editing each one, you'll need to change the dropdown 'Alternate Access Mapping Collection' back to Show All


3. Run the stsadm command
stsadm -o renameserver -newservername -oldservername
after running this on RC, I received a CryptographicException in OWSTIMER.EXE, however this didn't seem to stop it working correctly
if you do get the exception, probably best to check the Timer Service is still running after the final restart (below)


4. Rename the machine in the OS
Start Menu, right-click 'Computer' and select 'Properties'
Click 'Advanced System Settings'
In the Computer Name tab, click 'Change...'
Enter the new name, then restart


Your new SharePoint 2010 VM is ready to use.
Happy Programming!

No comments: