Wednesday, 30 June 2010

Create a NFS share for VM ISO files with Windows 2003 Server R2

If your ESX servers are not connected to network storage or if you do not have enough available space on your SAN to dedicate a sub folder of a VMFS volume for ISO files, then you can use a NFS network share to centrally store these images. Creating the NFS share can be done with many server operating systems, but did you know that Windows Server 2003 R2 has native NFS?

VMware-land.com has many "how to" VMware Tips for ESX, and the following is the instructions found there for creating a Windows 2003 R2 NFS share:

  1. On the Windows 2003 Server make sure "Microsoft Services for NFS" in installed. If not you need to add it under Add/Remove Programs, Windows
    Components, Other Network File and Print Services
  2. Next go to folder you want to share and right-click on it and select Properties
  3. Click on the NFS Sharing tab and select "Share this Folder"
  4. Enter a Share Name, check "Anonymous Access" and make sure the UID and GID are both -2
  5. In VirtualCenter, select your ESX server and click the "Configuration" tab and then select "Storage"
  6. Click on "Add Storage" and select "Network File System" as the storage type
  7. Enter the Windows Server name, the folder (share) name and a descriptive Datastore Name
  8. Once it finishes the configuration you can now map your VM's CD-ROM devices to this new VMFS volume

Repeat steps 5 through 8 for each of your ESX servers to make the same ISO files available to all ESX hosts.

These instructions assume that you have already configured the VMkernel port group on a vSwitch for each ESX host. For instructions and information about configuring the VMKernel for NAS/NFS storage check the Storage Chapter of the ESX Server 3 Configuration Guide.

Of course, you can use the NFS share for more than just ISO file storage too. This is a good repository for patches and scripts that need to be used on all hosts. NFS also makes a good target for VM image backups too. Use some imagination and install the free VMware server on your 2003 R2 box and you have a low budget DR platform. Oh yeah, I shouldn't forget to mention you can even run ESX VMs from NFS!

Important Notes:

  • ESX version 3.x only supports NFS version 3 over TCP/IP.
  • Best practice for TCP/IP storage is to use a dedicated subnet. This will usually require creating separate Service Console and VMKernel port groups on a dedicated vSwitch.
  • On the Windows 2003 R2 server be sure to configure the shared folder so that the file permissions allow anonymous full control. You can make the share read only when adding the storage in ESX.
  • Be sure to remember to punch a hole in the ESX firewall for NFS. On the Configuration tab, go to the Security Profile settings and add the NFS Client so it appears in the allowed outbound connections.


 

You can also create a NFS share from the Windows command line with the following command

C:\>nfsshare [SHARENAME]=[path to folder, e:\foldername] -o rw -o root anon=yes anonuid=-2 anonguid=-2

You then need to manually add the Anonymous Access user account on the Security tab and set to "full control". (I bet you can do this from the cmd line too, but I do not have that command right now)


 

Thursday, 17 June 2010

How to Modify the All Users Startup Menu in Windows 2008, Vista and Windows 7

How to Modify the All Users Startup Menu


As you no doubt know, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 have modified the locations for user profiles. They are no longer in %SystemDrive%\Documents and Settings and exist in the %ProgramData%\Users folder.

However, to modify the All Users profile to add a shortcut to the Startup menu you actually need to access the %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup folder.

Tuesday, 1 June 2010

Cannot open Virtual Machine Console


Original document located at vmware KB:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=749640

Details


  • When you try to connect to a virtual machine console from VirtualCenter, you see one or more of these errors:
    • Error connecting: Login (username/password) incorrect
    • Error connecting: Host address lookup for server <SERVER> failed: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for Do you want to try again?
    • Error connecting: cannot connect to host <host>: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Do you want to try again?
    • Error connecting: You need execute access in order to connect with the VMware console. Access denied for config file.
    • Unable to connect to MKS: failed to connect to server IP:903. For more information, see
      Troubleshooting the firewall policy on an ESX Server (1003634).
      ESX 4.0 hosts lose network connectivity when multiple service console interfaces are configured on subnets that use DHCP IP addresses (1010828).
  • You cannot open a remote console to a virtual machine.
  • Virtual machine console is black (blank).
  • The VMware Infrastructure (VI) Client console tab session may time out or disconnect while in use.
  • Migration of virtual machines using vMotion fails.
  • This issue may affect a single ESX  host. If the virtual machines are moved to another ESX host, you may be able to connect to the console without error.
  • This issue may occur if you try to connect to the console using VMware Infrastructure (VI) Client connected directly to the ESX host or to vCenter Server.

Solution



If your network is configured such that a firewall exists between the ESX host and the client running the workstation running VI Client, you might not be able to open a virtual machine console. To connect to a virtual machine console from VI Client, port 903 needs to be open in any firewall between the the workstation running VI Client and the ESX host. This
applies even if VI Client is connected to VirtualCenter and not directly to ESX host.


Note: Before performing the steps in this article:
  • For more information on restarting the Management agents, see Restarting the Management agents on an ESX Server (1003490).
  • For more information on editing configuration files, see Editing configuration files in VMware ESX (1017022).


To troubleshoot this issue:
(Just issuing step 1 worked for me !)

  1. Log in to the VirtualCenter Server directly through Terminal Services or a Remote KVM and attempt a connection from VI Client from this system. If this method works, the firewall is likely preventing the console from working. Configure your firewall to allow communications on port 903 between the ESX host and the workstation running VI Client.

    If port 903 is not open or cannot be opened in your environment, enable the vmauthd proxy. This forces remote console communication to be sent on port 902 on the Service Console, instead of 903.

    Note: By enabling this setting there may be degradation in performance communicating to the ESX host service console, if remote consoles are heavily utilized.

    To enable the proxy:
    1. Log in to the ESX host's service console as root.
    2. Open /etc/vmware/config with a text editor. 
    3. Add the following line:
      vmauthd.server.alwaysProxy = "TRUE"
    4. Issue the following command to restart xinetd:
      service xinetd restart
  2. Verify the ESX firewall policy.  For more information, see
  3. Verify that the ESX host and the workstation running VI Client are correctly synced to an NTP service. This is required to satisfy SSL handshaking between VI Client and ESX. For more information, see Verifying time synchronization across environment (1003736).

  4. DNS problems are a common cause of virtual machine console problems. Verify name resolution in your environment. For more information, see:

  • After verifying DNS, open a command prompt on the VI Client machine and perform the following:
    ipconfig /flushdns
    ipconfig /registerdns
  • Verify /var partition is not full.
  • Verify that the permissions for the virtual machine's .vmx file are set correctly. To set the permissions, run the command:
    chmod 755 </full/path/to/virtual machine.vmx>
  • If your ESX host has more than one service console configured, verify that they are not on the same network.
  • Check if the Service Console IP is routing traffic to the workstation running the vCenter. For more information on configuring the Service Console Gateway, see Changing the IP address, default gateway, and hostname of the Service Console in ESX (4309499).

Friday, 14 May 2010

How to delete old files in Linux

In order to delete OLD files older than XX days, execute following command on your Linux box, where /opt/app/logs is the directory where files are located:

find /opt/app/logs -mtime +XX -exec rm {} \;

For example, to delete files older than 90 days:

find /opt/app/logs -mtime +90 -exec rm {} \;

If the same directory has multiple type of files, and want to delete ONLY those with .log extension:

find /opt/app/logs -name '*.log' -mtime +90 -exec rm {} \;

If you want to see the files to be deleted, run the same command removing "-exec rm {} \;"

Tuesday, 20 April 2010

MOUNT USB STICK WITH READ AND WRITE PERMISSIONS FOR A USER

Important: As most up-to-date Linux Distributions support Hotplug for USB removable media you might want to try to plug your USB stick to the system and see if it gets detected and mounted automatically.


If you just mount the usb stick without special options it is only read/writable for root.

To read/write enable the stick for a different user use the following:

mount /dev/sda1 /mnt/usbstick/ -o uid=500


User ID 500 is on many systems the default ID for your first user. You might want to switch it to another user (take a look at the ID in /etc/passwd) or set permissions for a group. For a group use "gid" instead of "uid".

It also might be handy to add a line like the following to your /etc/fstab file (where you can specify some default mount information):

/dev/sda1 /mnt/usbstick vfat noauto,users,exec,rw,umask=000 0 0


This allows the members of the group "users" to mount the device /dev/sda1 (which represents the usb stick on my system) with read and write access. Another advantage of this line in your /etc/fstab is that for some graphical environments (e.g. KDE) read the file at startup and present you a corresponding icon to mount and unmount the device automatically on your desktop.

Tuesday, 13 April 2010

Some vbs scripts to create shortcuts in your Windows

Create any or all of the examples and execute it from either the command prompt or Start / Run using:

wscript xyz.vbs

Note: These scripts were all tested on Windows 7, Windows 2008 and 2003. They should run fine on earlier versions of Windows (XP, Vista, 2000, etc.) as well.

Although most of these examples will create shortcuts to Windows Explorer (the last one is a shortcut to the Command Prompt), they are being placed in different locations. Of course you could modify the examples to launch any program of your choosing. Additionally you could combine them into one script that could be launched the first time you logon.

For easy reference I highlighted the values you may want to change to tailor the script to your needs.

Windows 7, Vista and Windows 2008 Server note: You will probably have to execute these with administrative rights. One way to do this is to launch a command prompt (the old fashioned way - Start [All] Programs / Accessories / Command Prompt) using right-click and selecting "Run As Administrator."


Example 1 - Shortcut to Windows Explorer in the "All Users" Desktop folder. I named the script Explorer_Shortcut_on_AU_Desktop.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%\explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%\explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 2 - Shortcut to Windows Explorer in the "All Users" Start Menu folder. I named the script Explorer_Shortcut_in_AU_Startmenu.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartMenu = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartMenu & "\Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%\explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%\explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 3 - Shortcut to Windows Explorer in the "All Users" Startup folder. I named the script Explorer_Shortcut_in_AU_Startup.vbs. This will cause one instance of Windows Explorer to launch during logon. If you're like me you will be using it anyway, so why not have it open automatically.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartup & "\programs\startup\Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%\explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%\explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 4 - Shortcut to Windows Explorer in the "Current User" Quick Launch toolbar. I named the script Explorer_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "\Microsoft\Internet Explorer\Quick Launch\Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%\explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%\explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 5 - Shortcut to Command Prompt in the Quick Launch toolbar for you, the current user. I named the script CMD_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "\Microsoft\Internet Explorer\Quick Launch\Command Prompt.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%\system32\cmd.exe"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "Ctrl+Alt+C"
oShellLink.IconLocation = "%SystemRoot%\system32\cmd.exe"
oShellLink.Description = "Windows Command Prompt"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

How to run vbs scripts from KiXtart?

You can do it by SHELL (waits for execution) or RUN (continues with Kixtart script)

eg:

shell 'wscript.exe yourscript.vbs [arguments]'

where [arguments] might be one of your KiX variables


http://www.kixtart.org/

Sunday, 7 March 2010

Run add printer wizard as another user

In a Windows 200X system (Windows 2000, Windows XP, Windows 2003), to start the printer wizard with another user like administration, go to the command line and execute this:


runas /U:administrator "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"

Friday, 5 March 2010

Proclarity: The selected page could not be opened because the cube could not be found

Here's a slightly dated but still fantastic document from Dawn Fink regarding cube could not be found errors. Check out the link near the bottom for a whitepaper on Kerberos Delegation and PAS.



SYMPTOMS:
Opening a book with the Standard Web Client displays a warning message. The message states, "The cube used by this page could not be found" [The selected page could not be opened because the cube could not be found.]. The message also states that the details of the condition have been recorded and sent to the web site administrator and that if immediate assistance is required, contact the administrator.

CAUSE:
The message fundamentally means that the ProClarity Analytic Server (PAS) could not contact Microsoft SQL Server Analysis Services (SSAS) successfully. There are many reasons why this might happen. This article will cover some common issues.

Configuration 1:
PAS is located on a separate machine from SSAS, and IIS authentication is set to "Windows Integrated," and Kerberos Delegation is not configured. This is also known as the "two-hop" problem.

Cause:
Because of intentional security restrictions, it is not possible in to have the OLAP server and PAS server on separate physical machines, use Integrated authentication and have OLAP security respected at the same time - unless you configure Kerberos Delegation.

Resolution:
There are a few possible solutions to this problem.

1. Set the IIS authentication to Basic only. This will allow PAS (IIS) to receive credentials and pass them on to the OLAP server. Note that when this is done IIS will display a warning about credentials being passed in clear text when using this mode - please use SSL to secure Basic traffic.

2. Move SSAS and PAS (IIS) to the same machine. This will eliminate one of the two hops in the two hop problem.

3. Do not use any security settings on SSAS by allowing the Anonymous IIS user access to the cube. This means that everyone will have access to all of the information on the server.

4. Configure your network to use the Kerberos Delegation. Please see the document below.

Configuration 2:
PAS and SSAS are located on the same machine OR they are located on separate machines AND IIS authentication is set to "Basic" and not "Windows Integrated".

Cause:
The user attempting to access SSAS does not have sufficient privileges to access the desired data.

Resolution:
Check the security roles on SSAS at both the cube level and the database level. Be sure the user has access to the data they are attempting to view.

Configuration 3:
PAS and SSAS are located on the same machine OR they are located on separate machines AND IIS authentication is set to "Basic" and not "Windows Integrated" (or you are leveraging the features of Kerberos Delegation). SSAS data has recently been migrated to another machine, the SSAS machine name has changed, one or more of the catalog names have been changed, or one or more of the cube names have been changed.

Resolution:
Please use ProClarity Professional and the Change Connection Information Wizard to verify you are pointing to the correct server, database (catalog), and cube.


http://blogs.technet.com/proclarity/attachment/3172290.ashx

Friday, 26 February 2010

How to write text on PDF files for free?

If you are looking to write text on PDF files or fill up forms, try:
http://www.pdfescape.com

It's a free online PDF editor, and will let you type on the file where-ever needed.

Here are its major features:

Free Online PDF Reader
Open PDF documents natively in your web browser
Rotate & zoom PDF pages to preferred viewing style
Select text and copy PDF content to your clipboard
Save, download, email, & print PDF documents
PDF thumbnail, bookmark, & link support


Free Online PDF Editor
Add text, shapes, whiteout & more to PDF files
Move, delete, & insert PDF pages
Create links to other PDF pages or web content
Change PDF information tags
Encrypt PDF contents using a password
Add & edit PDF annotations (sticky notes)


Free PDF Form Filler
Fill out PDF forms using existing form fields or use text tool
PDF text, checkbox, radio, list, and drop down fields supported
Essential PDF field calculation and formatting supported
Basic PDF field styling properties supported
Quickly tab from field to field


Free PDF Form Designer
Add new PDF form fields to any PDF file
Style PDF form fields (font, size, color, etc)
Modify existing PDF form fields


If you want more advanced features, the same company developed another application:
http://www.pdftypewriter.com

Price for this one is less than $30.