Monday, June 30, 2008

Screen garbled in VMware Server 2.0 beta 2

 This can be fixed by adding the following line in .vmx of the guest virtual machine.
svga.enableOverlay = "FALSE"

References:
http://communities.vmware.com/message/978732?tstart=15
http://communities.vmware.com/message/905156#905156

~ts~

The file is not a valid compound file opening data link file

If you get this message when opening an ADO connection using Data Link File (.udl)  then this may mean that your .udl file was saved as ANSI. To fix this save .udl file as Unicode  BOM.

~ts~

Friday, June 27, 2008

Fixing VBox guest lossing networking connection

When playing around with Virtual Box guests running Linux, the network connection my get lost on Debian Etch when the virtual interface's MAC changes. This is due to the fact that this version of linux is using udev and fortunately udev detects changes to MAC address. So basically, each new network interface with new MAC address gets its new ethx network interface device name. In my case, I got 3 ethx's already so I need to get rid of the unnecessary interfaces. As a root do this:
$: su
#: cd /etc/udev/rules.d
#: mkdir ~/bak
#: cp zxx_persistent-net-generator.rules ~/bak
#: rm zxx_persistent-net-generator.rules
#: /etc/init.d/udev stop
#: /etc/init.d/udev start
Note that we make a backup of the file just in case we need to go back. Also, for zxx_persistent-net-generator.rules, xx is any two digit number. So just go check the directory for a file that resembels *_persistent-net-generator.rules. Now to prevent udev to generate new interface for every new MAC address for Virtual Box virtual interface, do make the following changes:
#: nano -w /etc/udev/persistent-net-generator.rules
Then ensure that you have the line to ingore MAC address from Virtual Box virtual network interface:
# These rules generate rules to keep network interface names unchanged
# across reboots write them to /etc/udev/rules.d/z25_persistent-net.rules.
#
# The default name for this file is z45_persistent-net-generator.rules.

ACTION!="add",    GOTO="persistent_net_generator_end"
SUBSYSTEM!="net",   GOTO="persistent_net_generator_end"

# ignore the interface if a name has already been set
NAME=="?*",    GOTO="persistent_net_generator_end"

# ignore "secondary" raw interfaces of the madwifi driver
KERNEL=="ath*", ATTRS{type}=="802", GOTO="persistent_net_generator_end"

# provide nice comments for the generated rules
SUBSYSTEMS=="pci", \
ENV{COMMENT}="PCI device $attr{vendor}:$attr{device}"
SUBSYSTEMS=="usb", \
ENV{COMMENT}="USB device $attr{idVendor}:$attr{idProduct}"
SUBSYSTEMS=="ieee1394", \
ENV{COMMENT}="Firewire device $attr{host_id}"
SUBSYSTEMS=="xen", \
ENV{COMMENT}="Xen virtual device"
ENV{COMMENT}=="", \
ENV{COMMENT}="Unknown $env{SUBSYSTEM} device ($env{DEVPATH})"
ATTRS{driver}=="?*", \
ENV{COMMENT}="$env{COMMENT} ($attr{driver})"
#Ignore Virtual Box virtual network interface
ATTR{address}=="08:00:27:*", GOTO="persistent_net_generator_end"

# ignore interfaces without a driver link like bridges and VLANs
KERNEL=="eth*|ath*|wlan*|ra*|sta*", DRIVERS=="?*",\
IMPORT{program}="write_net_rules $attr{address}"

ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"

LABEL="persistent_net_generator_end"
Then delete /etc/udev/rules.d/zxx_persistent-net-generator.rules. In Debian Etch, default xx value is 25 but once you re-generate new rule it defaults xx to 45. Now once you restart udev or reboot the machine you should have a persistent interface name for Virtual Box virtual interface. A word of caution though. If you add another interface this may cause problem as udev might not assign new network interface for the additional NIC card since we have created an exception. So you might opt to use the first method of just regenerating the rules by deleting /etc/udev/rules.d/zxx_persistent-net-generator.rules and restarting udev or rebooting the machine.

References: http://forums.virtualbox.org/viewtopic.php?t=1616

Enjoy!

~TechnoS

Wednesday, June 25, 2008

Detecting Classic Start Menu or Start Menu

On some of our regression tests, we need to check that all shortcuts that our product created under Windows Start Menu is working. One of the challenge this one presents is that user can set it to either "Classic Start Menu" or the new XP style Start Menu. Since our organization likes to use Visual Tests, I was looking for a way to detect what is the current style of Start Menu, hence the script below was born:

'Refs
'http://www.themssforum.com/VisualBasic/SHGetSetSetting-SHELLFLAGSTATESHELLSTATE/
'http://msdn.microsoft.com/en-us/library/bb762200(VS.85).aspx
'http://msdn.microsoft.com/en-us/library/bb759788(VS.85).aspx

Option
Explicit
Private
Declare Sub SHGetSetSettings Lib "shell32" _
(ByRef lpSS As Byte, ByVal dwMask As Long, ByVal bSet As Long)
Const SSF_STARTPANELON =
&H200000

Public Function IsXpMenuStyleOn() As
Long
   
'SHELLSTATE is 36 byte structure
    IsXpMenuStyleOn =
0
    
    Dim Buf(0 To 35) As
Byte
    
    SHGetSetSettings Buf(0), SSF_STARTPANELON,
0
    If Buf(28) = 2
Then
        IsXpMenuStyleOn =
1
   
Else
        IsXpMenuStyleOn =
0
    End
If
End
Function

 

You can put this in Common project under Shared Module or Module. For my case I saved it to Module asset named DesktopUtilities. Now to use this, create a test script that looks like the following:

Sub Main()
    Include
"Common.DesktopUtilities"
        
    bXpStyleOn = DesktopUtilities.IsXpMenuStyleOn()
End Sub

 

Note that you need to define bXpStyleOn as TP output variable, and then you need to get the return value into a Visual Test variable. Once you know what is the current Window Menu Style you can create a decision logic to run different Visual Test script depending on the returned value.

 

Happy Test Partner coding !!!

 

~ts