2016-07-08

The (default) generated homestead VM doesn't haven't an IPv4 address and how to fix this

And there is nothing that indicates a failure : neither when the VM is booting





( … )

using the "ifconfig" command, we can see that our adapters do not have an IPv4 address ( whereas we were expecting 192.168.10.10 to be used )




The “lspci” command allows us to see what devices are used. We can see the Ethernet controllers there.








VM ADAPTER #1


Back to VirtualBox, let's review the network adapters and see if anything can be done to fix this...




We can see the automatic port forwarding rules set by Vagrant/Homestead





VM ADAPTER #2















OTHER TYPES OF EMULATED ADAPTERS ?



Does any other type of network adapter can come to our rescue ?









Some documentation below…

VirtualBox NIC Type

Source: https://www.vagrantup.com/docs/virtualbox/networking.html


You can specify a specific NIC type for the created network interface by using the nic_type parameter. This is not prefixed by virtualbox__ for legacy reasons, but is VirtualBox-specific.

This is an advanced option and should only be used if you know what you are using, since it can cause the network device to not work at all.

Example:

Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4",
    nic_type: "virtio"
end



Virtual networking hardware

Source: https://www.virtualbox.org/manual/ch06.html


For each card, you can individually select what kind of hardware will be presented to the virtual machine. VirtualBox can virtualize the following six types of networking hardware:

AMD PCNet PCI II (Am79C970A);

AMD PCNet FAST III (Am79C973, the default);

Intel PRO/1000 MT Desktop (82540EM);

Intel PRO/1000 T Server (82543GC);

Intel PRO/1000 MT Server (82545EM);

Paravirtualized network adapter (virtio-net).

The PCNet FAST III is the default because it is supported by nearly all operating systems out of the box, as well as the GNU GRUB boot manager. As an exception, the Intel PRO/1000 family adapters are chosen for some guest operating system types that no longer ship with drivers for the PCNet card, such as Windows Vista.

The Intel PRO/1000 MT Desktop type works with Windows Vista and later versions. The T Server variant of the Intel PRO/1000 card is recognized by Windows XP guests without additional driver installation. The MT Server variant facilitates OVF imports from other platforms.

The "Paravirtualized network adapter (virtio-net)" is special. If you select this, then VirtualBox does not virtualize common networking hardware (that is supported by common guest operating systems out of the box). Instead, VirtualBox then expects a special software interface for virtualized environments to be provided by the guest, thus avoiding the complexity of emulating networking hardware and improving network performance. Starting with version 3.1, VirtualBox provides support for the industry-standard "virtio" networking drivers, which are part of the open-source KVM project.

The "virtio" networking drivers are available for the following guest operating systems:

    Linux kernels version 2.6.25 or later can be configured to provide virtio support; some distributions also back-ported virtio to older kernels.

    For Windows 2000, XP and Vista, virtio drivers can be downloaded and installed from the KVM project web page.[30]

VirtualBox also has limited support for so-called jumbo frames, i.e. networking packets with more than 1500 bytes of data, provided that you use the Intel card virtualization and bridged networking. In other words, jumbo frames are not supported with the AMD networking devices; in those cases, jumbo packets will silently be dropped for both the transmit and the receive direction. Guest operating systems trying to use this feature will observe this as a packet loss, which may lead to unexpected application behavior in the guest. This does not cause problems with guest operating systems in their default configuration, as jumbo frames need to be explicitly enabled.



Network Adapter Settings

Source: http://download.parallels.com/desktop/v4/docs/en/Parallels_Desktop_Users_Guide/22249.htm


  •     Shared Networking. Select this option to enable the Network Address Translation (NAT) feature for the virtual machine. In this case, your virtual machine will share whatever network connection is currently used by your physical computer.

  •     Bridged Ethernet. Select this option to allow the virtual machine to access the local network and Internet through one of the network adapters installed on the physical computer. In this case, the virtual machine is treated as a stand-alone computer on the network and should be configured in the same way as a real one. You can choose the physical adapter where the virtual machine adapter will be bridged in the drop-down list below the Bridged Ethernet option.

  •     Host-Only Networking. Select this option to allow the virtual machine to connect to the physical computer and the virtual machines residing on it and to make it invisible outside the physical computer.





Finally




Configuring the adapter type through the Vagrant file did not work as it created a third adapter and was ineffective.


But changing manually the NIC adapters in the VirtualBox VM setting and using • Paravirtualized network adapter (virtio-net) finally gave the best results
















2016-07-07

A word about false-positive and false-negative test-results, and why having a 'negative test-result' means 'passing the test'

Hi,


I am writing this because I sense there is a (legitimate) misunderstanding about some vocabulary we are using and I would like to try and clarify things. I will use an analogy from everyday life, that you might be familiar with, and I will explain why a POSITIVE test is a FAILED test, whereas a NEGATIVE test is a PASSED test. If it’s already making sense to you, you can pass, otherwise read on. There shouldn’t be any confusion about what is a false-positive test, and what is a false-negative test, which is which, and why they are critical.

First, notice that the usual phrasing is “one is taking a test”, or “one is being tested for something”.

So, when software is taking a test, software is tested “for” regressions.

Let me explain.




RnD and QA-oriented people, when coding automated tests, we are testing software “for” regressions. An analogy being: just like a chemical-test might reveal the presence of a molecule in your blood, a regression-test might reveal some incoherent or wrong behavior coming from the system-under-test.

So the software is really tested “for” regression(s) just like a person is tested “for” pregnancy, alcohol, narcotics or a disease. And, finally, the result of a test comes in two flavors only: positive or negative. And the meaning of this “positive” or “negative” status is:

-          Positive = Anomaly Detected,
-          Negative = Nothing To Report.

Except that we, humans, when dealing with a consumer, we negate this result and we call a negative test, a PASSED test, and we call a positive test, a FAILED test.

But the logic behind it remains the same and we, RnD and QA-oriented people, we must be familiar with it. There are only 4 typical situations, by the end of an anomaly search:

a) we might find some anomaly and be able to reproduce it (positive test),
b) we might not find any, because there aren’t any anomalies (negative test)
c) we might see some anomaly that isn't there, and then reconsider and force the status to PASS (false-positive test, status FORCED),
d) we might miss some (false-negative test).




All things considered,

-          Situation c), on top of causing a tremendous overhead on the QA-oriented people, it might make the product absolutely impossible to tests (eg. like when using non-deterministic algorithms or data structures),
-          Situation d), on top of causing an increased overhead on both RnD and QA-oriented people later in time, it also means “bad press” for the company at one level or another.

Working iteratively at minimizing the occurrences of cases c) and d) is what makes the whole integrated system reliable and our lives easier in the long run. 

2016-02-12

Print system information on top of your desktop background upon startup using BGInfo.exe (Sysinternals)



Executable with custom template:




https://onedrive.live.com/redir?resid=C213C8B09441DCD7!48680&authkey=!AEUBtQwOZXCSUto&ithint=file%2czip

Drop the the ".exe" and the ".bgi" files in C:\Windows, and schedule task to run at user logon :



    Bginfo.exe BGInfoConf-v160205.1.bgi /nolicprompt /timer:0



Default template:







My template:




Scheduled:




2016-02-11

RDP as a different user to Localhost on Windows 7

Concurrent sessions is a feature in server editions of Windows that lets more than one user to log on remotely and use the server at the same time. By default in desktop editions when you connect to a remote computer using Remote Desktop it will force the user who is physically sat at the computer to log off. So how to work around this?

In two steps:


  • Crack termsrv.dll, remove the Concurrent Remote Desktop sessions limit, allow multi-user login in XP/Vista at the same time.
  • Connect RDC to IP address 127.0.0.2





REFERENCES:

Original patcher:
TCP-Z, Best TCP/IP Patch: Universal Termsrv.dll Patch V1.0b Build 20090425 Release
http://deepxw.blogspot.fr/2009/04/universal-termsrvdll-patch.html

Article commenting on the patcher:
Enable Concurrent Sessions on Windows 7, Windows Vista and Windows XP (Termsrv.dll)
http://digiex.net/guides-reviews/guides-tutorials/windows-guides/1879-enable-concurrent-sessions-windows-7-windows-vista-windows-xp-termsrv-dll.html

Cached version of the patcher executable:
UniversalTermsrvPatch_20090425.zip (Location 4) (Click to download)
https://onedrive.live.com/redir?resid=C213C8B09441DCD7!48685&authkey=!AAdHghvpV7PZ0oM&ithint=file%2czip

Connect Remote Desktop Protocol (RDP) Client To Localhost
(see "Method 1: Connect RDC to IP address 127.0.0.2")
http://www.techbuzz.in/connect-remote-desktop-protocol-rdp-client-to-localhost.php


FURTHER READING:

TCP-Z, Best TCP/IP Patch: Say Bye To Half-open TCP Connections Limit In Vista/2008 SP2
http://deepxw.blogspot.fr/2009/05/say-bye-to-half-open-tcp-connections.html

2016-02-10

Redirect terminal service to console (ie. Disconnect RDP and leave computer unlocked)

Usually, when you close your RDP connection the remote computer locks the computer and therefore restricts access and use of your Desktop (COMPUTER LOCKED).

The solution is either :

1/ use VNC instead of RDP

2/ or run "@tscon.exe 1 /dest:console" to transfer your session from RDP to CONSOLE, this will "virtually" kick you out, but it will leave your user session open and your Desktop active on the remote computer.

WARNING: By definition, this solution (2/) is unlikely to work for multiple remote desktop sessions on a single computer at the same time, there can be only one console session and it is already in use.


C:\Users\Administrator2>tscon 2 /dest:console
Could not connect sessionID 2 to sessionname console, Error code 7045
Error [7045]:The requested session access is denied.


2013-11-08

Display the path of the currently edited file in Visual Studio 2012



A Visual Studio border plugin that provides the full path of the currently open edit window
Where Am I extension

All I did, was to:
  • Get the source from Github
  • Install the SDK for Visual Studio
  • Open and convert the project
  • Change the project properties and use .NET Framework 4.5
  • Change the settings file to target Visual Studio 11.0
  • Compile for Visual Studio 11.0  (AKA. Visual Studio 2012)
That'a all folks!



For more information see also: Visual Studio 2012 - display full path of current file

Source code:
/ WhereAmI

2013-02-11

One bug in SED.EXE and another in MS-DOS DEL command

That was a fun day, a WTF one (What's The Fun?!). Wasted at least an hour on troubleshooting third party applications... -_-'

Damn'.


Sed.exe temporary file bug


The utility 'sed.exe' (from GnuWin32) helped me in modifying a file during a headless installation process (changing a property in a "web.config" file). Until there, it was fairly cool.


But here comes the less fun part, I noticed that the executable creates a temporary file right in the middle of its working directory. This is a bug listed and commented here:


From what it looks like, the tool may have regressed in Windows 7 again. Unless it's because of the 64 bit system and the WoW emulation...? Anyway.

The temporary file is not that random, first we know where it is located, second, its name is made of 3 known characters 'sed' and 6 random alphanumeric ones. In regular expressions it would be something like

/sed[a-zA-Z0-9]{6}/

So let's rock'n'roll with a workaround. Let's call:

$> DEL /q sed??????

Let's call it in a directory that contains a file sedE1, a file sedE1f8fd, and a file sedE1f8fdBIS. What happens. All three are deleted. WTF?!


Wildcards issue


After further investigations, "sed????" works fine. So what is wrong?

It seems that, as far as wildcards are concerned:

"?????????" <=> "*"

The explanation I found is that DEL works still on the 8.3 character file name model.

So finally the only workaround is to wrap sed.exe into a batch file:


2012-03-21

Working with automated computers rather than having pets


I love that one, it reminds me my work with my computers and my automated test-scripts that seem to have a life of their own...