Have you gotten around to trying out the SharePoint 2010 public beta yet?
In an effort to provide everyone that would want one access to a virtual machine with SharePoint 2010 Beta, Visual Studio 2010 Beta and SharePoint Designer 2010 Beta, I decided to create such VM and put it up on a file share so that anyone can grab a copy and get going and thought I’d blog about how I did it.
I decided to use Windows 7 on the image, just to prove that it works. Now, SharePoint 2010 requires a 64-bit OS, which means that Virtual PC is out unfortunately. But VirtualBox and VMWare Player are both excellent and free. Personally, I created the image using Virtual Box, and then exported a copy in VMWare format so that our developers could choose whichever VM solution they preferred.
Unfortunately, it wasn’t as easy as just running the SharePoint 2010 installation as you would on server OS. As described in this article, you need to extract the setup files and modify a configuration file to allow the installer to run on Windows 7. Another caveat I came across was that the SharePoint Products and Technologies Configuration Wizard would fail on step 8, “creating sample data”, with an error message about “Unrecognized attribute ‘allowInsecureTransport’”. But installing the hotfixKB976462, I could finally run the wizard successfully.
The last thing I had to figure out was the easiest way of renaming the VM after cloning it to avoid name collisions on the network. I found this guide for SharePoint 2007, and it still works, but since SharePoint 2010 includes the PowerShell based Management Shell, I performed some of the steps using it instead.
Here are the steps I took:
- Start the management shell
- Run “Rename-SPServer -Identity
-Name ” - Change the name of the server (in the computer properties dialog)
- Reboot
- Start the management shell again
- Run “Set-SPAlternateURL -Identity
-Url - Run “Set-SPAlternateURL -Identity
-Url - And you’re good to go!
If you run in to access denied errors, try running the management shell as administrator.
Knowing just how lazy we developers are, I created a PowerShell script that performed the entire name change after prompting the user for the new server name and the central administration port and put the script on the desktop on the original VM image. That way, the developer just has to run the script after booting a newly cloned image. Clean and easy.
Here’s the source for the PowerShell script:
Echo "Loading SharePoint extensions..." $ver = $host | select version if ($ver.Version.Major -gt 1) {$Host.Runspace.ThreadOptions = "ReuseThread"} Add-PsSnapin Microsoft.SharePoint.PowerShell $newSrvName = Read-Host -Prompt "Enter new server name" $caport = Read-Host -Prompt "Enter Central Administration port" echo "Renaming server..." $ComputerInfo = Get-WmiObject -Class Win32_ComputerSystem $oldSrvName = $ComputerInfo.Name $ComputerInfo.Rename($newSrvName) echo "Updating alternate access mappings..." Set-SPAlternateURL -Identity "http://$oldSrvName`:$caport" -Url "http://$newSrvName`:$caport" Set-SPAlternateURL -Identity "http://$oldSrvName" -Url "http://$newSrvName" echo "Renaming server in SharePoint configuration..." Rename-SPServer -Identity "$oldSrvName" -Name "$newSrvName" echo "Done! RESTART the server for the changes to take effect" $restart = Read-Host -Prompt "Restart now? [Y/N]" if ($restart -eq "Y") { shutdown -r -t 10 -f -c "Restarting server after name change" }
No comments:
Post a Comment