Creating your own virtual machine client application for Virtual Server

The VMRC client used by Virtual Server is a basic ActiveX control.  This is very handy for integrating it into your own custom client application.  Starting with a blank Windows Application project under Visual Studio .NET 2003 you will need to select: ‘Tools’ –> ‘Add / Remove Toolbox items’ –> ‘COM Components’ –> and then check ‘Microsoft Virtual Server VMRC Control’

Once you have done this you should select the ‘Data’ section of the Toolbox and add the ‘Microsoft Virtual Server VMRC Control’ to the Windows Form. You will then need to change the ServerAddress, ServerPort and other properties appropriately.  Really quite simple:

Creating your own virtual machine client application for Virtual Server

   Creating your own virtual machine client application for Virtual Server   Creating your own virtual machine client application for Virtual Server

It is also fairly easy to configure the Windows Form to resize automatically to the size of the virtual machines display with a piece of code something like this:

    Private Sub AxVMRCClientControl1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxVMRCClientControl1.Resize

        If Not Form1.ActiveForm Is Nothing Then
            Form1.ActiveForm.Width = AxVMRCClientControl1.Width + 5
            Form1.ActiveForm.Height = AxVMRCClientControl1.Height + 35
        End If

    End Sub

Cheers,
Ben