How to: Boot Windows Server 2008 R2 or Windows 7 from a VHD

17 02 2010

I have now done this multiple times and was recently requested to write a quick how to on my blog so here it is. Windows 7 and Windows Server 2008 R2 both support being booted and installed as a VHD (Virtual Hard Disk). Rather than being installed physically on the disk – the operating system is simply is stored as a VHD file on your hard drive.

**Please note you will need an existing normal installation of Windows 7 or Windows Server 2008 R2 on your computer for this to work!**

Follow the steps below to get up and running:

  1. Boot from the Windows 7 or Windows Server 2008 R2 DVD
  2. When the first installation dialog appears press SHIFT + F10 to open the command prompt
  3. Type ‘diskpart’ and hit ENTER
  4. When the diskpart prompt appears enter the following command – create vdisk file=c:\vdiskname.vhd type=fixed maximum=20000 (this will create a VHD that is 20 GB in size on your C: drive). Make sure you change ‘vdisknamne’ to whatever you want to the VHD to be called. You can also use type ‘expandable’ instead of fixed if you wish so that the VHD expands automatically.
  5. Next type select vdisk file=c:\vdiskname.vhd – where ‘vdiskname’ is the name of your VHD
  6. Finally type attach vdisk
  7. Exit from diskpart and the command prompt
  8. Continue with the installation – when it comes to selecting the partition on which to install the operating system select the newly created VHD partition. Ignore any warnings like ‘you cannot boot from this partition’ as it will boot fine.
  9. Success – once the installation is finished and you reboot your PC you will see a new option in your boot menu to boot from your new VHD.

Hope this helps :-)!





Powershell scripts for SharePoint 2010 services – ‘Stop & Start’

26 11 2009

We all now know that SharePoint 2010 is resource intensive, especially intensive with its ram usage.

I originally installed full blown SharePoint 2010 on my laptop (which has 4gb of ram) only to see most of that ram being used up and none left for visual studio to run.

I would recommend anyone who wants to install it on their workstation that only has 4gb of ram to install SharePoint Foundation instead which needs much less ram and will be fine for simple SharePoint 2010 dev or just playing around.

After I had installed it on my workstation I went on a search of some powershell scripts that I could use to stop SharePoint’s services when its not in use and start them up when needed.

It turns out Emmanuel Bergerat had created some and posted them on his blog, see here –

http://blogs.msdn.com/emberger/archive/2009/11/16/stop-and-go-with-sharepoint-2010-on-your-workstation.aspx

Thanks Emmanuel!

I have modified these scripts to work with SharePoint Foundation instead of full SharePoint Server 2010.

You can find the scripts on my SkyDrive – link at the bottom of the post.

To get them to work you will need to open them and edit the line –

‘MSSQL$SHAREPOINT’,"SQLWriter",’SQLAgent$SHAREPOINT’ | ForEach-Object

You need to change the name of the SQL Service (in my case MSSQL$SHAREPOINT) to the name matching yours. This name will depend on what your SQL instance is called, if you install SharePoint ‘standalone’ then it will most likely be the same as mine.

Run the scripts in the following order –

1. ‘Manual.ps1’ – Sets services to manual startup (Only need to run this once)

2. ‘Start.ps1’ – Starts SQL & SharePoint Foundation services

3. ‘Stop.ps1’ – Stops SQL & SharePoint Foundation services

Hope this helps! 🙂

 

Link: SharePoint Foundation Powershell Scripts





SharePoint 2010 & FIMSyncronizationService Problems

19 11 2009

**Updated 23/11/2009

Jeremy Thake (@jthake) advised me that this service is required for the ‘User Profiles Synchronization Service’ in SP2010 and that if you disable it then this won’t work. Decide whether you are going to need this feature before you disable this. I am not sure why it slows down the OS so much when booting up.

____________________________________________________________________________________

I recently installed the betas of SharePoint Foundation 2010  on top of Windows 7 and full SharePoint Server 2010 on to Server 2008 R2. One problem I found is that after you have rebooted the machine a couple of times it becomes very slow to startup.

At first I thought it was just because I was running SP2010 on a machine with only 4gb of ram and that was just the nature of the beast. When I opened Task Manager though it told a different story – the service ‘FIMSyncronizationService (Forefront Identity Manager Synchronization Service)’ was still trying to start and slowing the whole machine down. Once this service was stopped the machine continued booting into windows.

The service never seemed to start properly and I am assuming this is only needed if you want to use the full Forefront product with SharePoint.

I have now disabled this service using ‘Services.msc’ and SharePoint 2010 is still working fine. I would recommend anyone with the same issue who is not using Forefront to stop and disable this service from loading.

Hope this helps 🙂





Getting started with Silverlight 3 and SharePoint

12 11 2009

Silverlight Logo Recently I have been focusing on creating some Silverlight charts using the ‘Silverlight Toolkit’ from Codeplex (see the link in the instructions below).

Once I had created my first chart I wondered how to get it to display in SharePoint. It seems there are a number of options for displaying a Silverlight application (xap) in a SharePoint web part.

I found lots of blog posts that described separate bits of configuring I needed to do to get Silverlight working happily in SharePoint. I’ve decided to create a getting started list of what you need to do to get Silverlight installed and how to display your xap file with the built in ‘Content Editor Web Part’. I have linked to other blog posts where necessary.

Configuration

1. Download and install the Silverlight 3 runtime from silverlight.net –

http://silverlight.net/getstarted/silverlight3/

2. Download and install the Silverlight 3 SDK and tools for Visual Studio from the silverlight site – 

http://silverlight.net/getstarted/

3. <Optional> Download and install the Silverlight Toolkit (If you want to use some of these cool and free Silverlight controls) –

http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514

4. If you are running Windows Server 2008 you can skip this step as the MIME types should have been automatically added to IIS7 for you. For server 2003 users you will need to add the Silverlight MIME types to IIS6, follow the instructions here –

http://blogs.technet.com/jorke/archive/2007/09/11/silverlight-mime-types-in-iis6.aspx

5. This step involves configuring the web.config files for the SharePoint sites that you wish to run your Silverlight applications in. Follow the instructions on this blog post –

http://blogs.msdn.com/steve_fox/archive/2009/03/11/amending-the-web-config-file-to-support-silverlight-development-on-sharepoint.aspx

6. Ensure that the assembly System.Web.Silverlight is in the global assembly cache. If not then you can find it at the following location –

C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Libraries\Server

7. Configuration complete! – now read on to the deployment section

Deployment

To get your silverlight xap displaying on a SharePoint page follow the steps below. In terms of where to store your .xap file there are a number of places for you to choose. Some people recommend storing it in a folder called ‘ClientBin’ in the IIS virtual directory of the SharePoint web application but I was not able to get this working. I opted for the simplest method which was to store the file in a document library.

1. Upload your Silverlight xap file to a document library

2. Switch to edit mode for your SharePoint page and add a Content Editor Web Part

3. Insert the following HTML code – 

<!–<div width=”600px” height=”100px” id=”silverlightControlHost”>
<object data=”data:application/x-silverlight”, type=”application/x-silverlight-2″ width=”450″ height=”450″>
<param name=”source” value=”
http://yoursite/sites/charting/XAPs/SimpleSilverlightChart.xap”/>
<param name=”onerror” value=”onSilverlightError” />
<param name=”background” value=”white” />
<a href=”
http://go.microsoft.com/fwlink/?LinkID=108182″ style=”text-decoration: none;”>
<img src=”
http://go.microsoft.com/fwlink?LinkID=108101″ alt=”Get Microsoft Silverlight” style=”border-style: none”/>
</a>
</object>
<iframe style=’visibility:hidden;height:0;width:0;border:0px’></iframe>
</div> –>

Remember to remove the comments from the above code and replace the param value=”” with the url to your document library and xap file.

4. Click apply and save the changes to your content editor web part

5. If all went well you should be seeing your Silverlight application displaying correctly!

Note: You may need to play around with the width and height of both the <div> and <object> tags to size them correctly for your Silverlight application.

Good Luck! 🙂





My Top 5 IE8 Accelerators

6 11 2009

If you haven’t heard of them ‘Accelerators’ are a new feature in IE8 which are designed to make your browsing tasks quicker and easier.

Accelerators allow you to perform an action by simply highlighting text on a webpage or just right clicking on a page and selecting your chosen accelerator.

Below are my top 5 IE8 accelerators:

1. ‘Google Reader Accelerator’

Simply right click on the RSS feed page and click the accelerator to subscribe to it with your Google reader account.

image

http://www.ieaddons.com/en/details/bookmarks/Subscribe_with_Google_Reader/

2. ‘Wordpress Accelerator’

Select any text on a webpage and select the accelerator to start a new blog post containing the selected text.

image

http://www.wordpress.com

(Login to your dashboard and you should find it available for download)

3. ‘Twitter Accelerator’

Select some text on a page and select the twitter accelerator to send the text as a tweet from your twitter account.

image

http://openbrolly.com/2008/08/31/ie8-accelerator-for-twitter/

4. ‘Google Maps Accelerator’

Select any bit of text (Postcode, Address etc) and select the google maps accelerator to open the location in google maps.

image

http://ie.microsoft.com/activities/en-en/Default.aspx

5. ‘Google Mail Accelerator’

Select some text and select the google mail accelerator to create a new email message containing the selected text.

image 

http://ie.microsoft.com/activities/en-en/Default.aspx

Hope you find these accelerators helpful and as useful as I do!