Blending local Linux apps into the Citrix XenDesktop Virtual Desktop

With the XenDesktop 7 and XenApp 6.5 Feature Pack 2, now local Microsoft windows applications can be seen without having to escape from your VDI or Hosted Shared desktop.
http://support.citrix.com/proddocs/topic/xendesktop-7/laa-overview.html

Back in 2011, I worked on the development of the prototype for the similar concept that allows blending the local Linux applications into the Virtual Desktop.

Technologies we used for the development of this prototype:
Citrix Virtual Channel SDK, Citrix WinFram API SDK, Google’s Protocol Buffers, C++, Visual C#, WinAPI, Xlib.

Here is the demo

Advertisements

Importing/Exporting OVA in vSphere using VMware OVF Command line Tool

VMware OVF tool is a command line utility that supports import and export of OVF packages to and from vSphere infrastructure.

Download Tool – http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/ovf
Documentation – http://www.vmware.com/support/developer/ovf/

Exporting Virtual Machine to OVA file

C:\Program Files\VMware\VMware OVF Tool>ovftool.exe "vi://username:password@vCenterIP:443/DataCenter_Name/vm/Demo-W7-VM" "C:\VM-Backup\Demo-W7-VM.ova"

Importing OVA VM to vSphere

C:\Program Files\VMware\VMware OVF Tool>ovftool.exe "--datastore=datastore1" "--network=VM-Network" "C:\VM-Backup\Demo-W7-VM.ova" "vi://username:password@vCenterIP/DataCenter_Name/host/Cluster_Name/hostIP"

Deploying Cisco UCS Emulator on VMware ESXi

Cisco UCS Emulator is a great tool to show many features that Cisco Unified Computing System (UCS) offers. It also gives something to use to get familiar with the system as well as can be used for the demo.

Download UCS Emulator Version 2.0 GA from http://developer.cisco.com/web/unifiedcomputing/ucsemulatordownload

Download the 7zip open source archiver from http://www.7zip.org to unzip the compressed emulator file.

Extract 7z archive. It contains VMDK files that can be used to deploy Virtual Machine on VMware Workstation or Fusion, but to deploy it on ESXi, some additional steps required to process files with VMware vCenter Converter and then we can deploy it to vCenter directly.

Download and Install VMware vCenter Converter from http://www.vmware.com/products/converter/

Launch vCenter Converter and Click File -> New -> Convert Machine

Select “VMware Workstation or Other VMware virtual machine” as the source type and select UCSPE.vmx as virtual machine file to process for conversion.

You can click on “View Source Details” link to know the VM configuration and disks layout.

Close Source Details Dialog and Click Next to proceed with the selection of target destination type.

Select “VMware Infrastructure virtual machine” as the destination type and provide destination information for vCenter Server.

Click Next to Continue. Specify Destination VM name “UCSPE_V2”.

Select a destination cluster resource, datastore and Virtual machine Version “Version 7” for the new VM.

Set the ‘Conversion Options’ before hitting the Finish button. Configure the destination VM parameters as per your need. You can chose to set disk formats to “Thin” or “Thick”, adjust CPU/Memory allocation and set desired destination network.

  

Confirm selected options from the Summary and then click Finish. The Conversion job will then be processed and status can be watched within the Converter window.

When completed, the VM will appear in the vCenter inventory with the name and configuration specified above.

Go to vCenter and Power-on the VM.

VM is pre-configured to obtain DHCP IP address. Once the VM is booted, it will show the UCS Web UI location and login details on the console.

 

Default admin password is the cisco for the UCS manager console.

VMware View Client with PCoIP installation on Ubuntu 11.10

VMware View Client for Linux Tech Preview turns your Ubuntu PC into a thin client and connects to your company’s Virtual Desktop Infrastructure. With VMware View 5 PCoIP capacities you can deliver a personalized high fidelity experience for end-users across sessions, devices and operating systems.

Enable Ubuntu 11.10 partner channel package repository “oneiric-partner”

$ sudo gedit /etc/apt/sources.list
[sudo] password for divyen:

Uncomment (take out #) following lines from /etc/apt/sources.list and save file.

# deb http://archive.canonical.com/ubuntu oneiric partner
# deb-src http://archive.canonical.com/ubuntu oneiric partner

Retrive new list of packages and install vmware-view-client package.

$ sudo apt-get update
$ sudo apt-get install vmware-view-client

Search and Launch VMware View Client from Dash home

Read more about PC Repurposing with VMware View
http://communities.vmware.com/community/vmtn/desktop/view/pcrepurposing

Fixes

When VMware view Client cannot verify that the connection to the server is secure, it warns about self-signed or expired certificate with this error “The certificate authority is invalid or incorrect”.

If you encounter this error and cannot connect to the virtual desktop, you can go to the File -> Preferences and set the mode which allows the unverifiable connection.

Snapshot of the VMware View Client Connected to the Windows 7 Virtual Machine on Ubuntu 11.10

Configuring Jumbo Frames on ESXi Server

1. SSH into ESXi Server

2. Set the MTU for the vSwitch

~ # esxcfg-vmknic -m 9000 VMkernel
[2011-11-18 03:01:47 'NotifyDCUI' warning] Notifying the DCUI of configuration change
~ # 

3. Verify vSwitch’s MTU

~ # esxcfg-vmknic -list
Interface  Port Group/DVPort   IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type
vmk0       135                 IPv4      192.168.24.30                           255.255.255.0   192.168.24.255  88:43:e1:c3:19:e8 1500    65535     true    STATIC
vmk1       VMkernel            IPv4      20.0.0.1                                255.255.255.0   20.0.0.255      00:50:56:73:a1:42 9000    65535     true    STATIC
~ #

Handy VMware vSphere PowerCLI Cmdlets

Connect to vShere Server (vCenter/ESX/ESXi Host)

Connect-VIServer -Server $vhost -Protocol $protocol -User $user -Password $password

Disconnect vSphere Server

Disconnect-VIServer -Confirm:$False

Poweron Virtual Machine

Get-VM -Name $VMName | Start-VM

Shutdown Virtual Machine

Get-VM -Name $VM_Name | Shutdown-VMGuest

Reset Virtual Machine

Get-VM -Name $VM_Name | Restart-VM

Disconnect Network Adapter on Virtual Machine

Get-VM -Name $VM_Name | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$false

Connect Network Adapter on Virtual Machine

Get-VM -Name $VM_Name | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$true

Check Network Adapters Connection State on VMs

Get-VM | Get-NetworkAdapter | Select-Object Parent,ConnectionState

Move Virtual Machine to different Port group

Get-VM -Name $VM_Name | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $new_port_group

Register Virtual Machines by traversing Datastore directories

cd $vm_datastore_path
$vmdirectorylist=Get-ChildItem -Name W7-*

foreach($vmdirectory in $vmdirectorylist)
{
    cd $vm_datastore_path\$vmdirectory
    $vmxFile=Get-Item *.vmx
    New-VM -name $vmdirectory -VMHost $vHost -VMFilePath $vmxFile.DatastoreFullPath
}

Add NFS NAS as a new Datastore

New-Datastore -Nfs -VMHost $ESXiHost -Name $nfs_datastore_name -Path $nfs_mount_point -NfsHost $nfs_ip_address

Copy Directory from One Datastore to Other/Same Datastore Recursively

Copy-DatastoreItem $source_datastore\$source_directory $destination_datastore -Recurse

Enable SSH on ESXi Host

Get-VMHost "192.168.24.201" | Get-VMHostService | Where {$_.Key -eq "TSM-SSH"} | Start-VMHostService

Getting Endpoint Device Information within VMware View Desktop

When a connection towards the virtual desktop is establishing the View Agent installed within the VM handles the session management. Client Device Information sent to the View Agent and can be gathered every time user logs in, connect and re-connect.

Client Device Information is changing when user changes location/endpoint.
This information is saved at (HKEY_CURRENT_USER -> Volatile Environment). This registry key contains a collection of values which relates to user’s non-persistent environment variable set.

Code (C++ Managed) to retrieve Endpoint Information


using namespace System;
using namespace Microsoft::Win32;

int main()
{
	RegistryKey^ regkey=Registry::CurrentUser->OpenSubKey("Volatile Environment");
	if(regkey==nullptr) {
		Console::WriteLine("Registry Key not found - aborting");
		return -1;
	}

	Object^ obj;
	array ^keys = gcnew array(4);
	keys[0]="ViewClient_IP_Address";
	keys[1]="ViewClient_MAC_Address";
	keys[2]="ViewClient_Machine_Name";
	keys[3]="ViewClient_Type";

	for(int i=0; i<keys->Length;; i++) {
		obj=regkey->GetValue(keys[i]);
		if(obj!=nullptr) {
			Console::WriteLine(keys[i] + ":" + obj->ToString());
		}
	}
	return 0;
}

Executing the compiled binary from within the View Desktop Session.

To download the code with Visual Studio project files, click here.

With configuring the group policy for CommandToRunOnConnect and CommandToRunOnReConnect we can execute a command to retrieve physical device and network information, and can pass on this information to any location aware application.

In addition, it enables the new way for Single Sign-On (SSO) access based on “where you are”.

For Configuring Group Policy for CommandToRunOnConnect and CommandToRunOnReConnect refer to my previous blog post – https://divyen.wordpress.com/2011/07/02/running-scripts-commands-on-vmware-view-desktop-connect-reconnect/

For detailed information on Location Awareness in VMWare view refer to http://www.vmware.com/files/pdf/VMware-View-4-LocationAwareness-WP-EN.pdf