Go to content Go to navigation Go to search

Brokenwire.NET::various

Fix: Virtualbox causes "Unidentified" network on Vista and Windows 7
· 24 days ago by Thijs Kroesbergen for Brokenwire.NET

The problem:

When you install Virtualbox on Windows Vista or Windows 7 it will install an additional virtual network adapter on the host system. This “Virtualbox Host-Only Adapter” causes the Windows network detection to show an additional “unidentified” network. And while this “unidentified” network is present the windows firewall settings will stay on “Public”. This behavior is undesirable because you want to be able to switch your firewall settings based on your location (home/work/public).


The solution (manually):

WARNING; DANGER: THE REGISTRY IS NO PLAYGROUND, IF YOU DON’T UNDERSTAND WHAT YOU’RE DOING THEN DON’T DO IT!
Now we have that out of the way, here is what you should do:

1. Open regedit and navigate to HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}

2. Browse through the subkeys (named 0000, 0001, etc) until you find the subkey containing the virtualbox network adapter, this is the one where the “DriverDesc” key has “VirtualBox Host-Only Ethernet Adapter” as value.

3. Add a new DWORD value with a name of “*NdisDeviceType” and a value of “1

4. Disable en re-enable the virtuabox host-only network adapter, or alternatively reboot your pc.

The solution (PowerShell)

I hacked together this PowerShell script to easily re-do this trick after a virtualbox upgrade. The script has only been tested on my pc (and it works), use at your own risk. You need to run an elevated PowerShell shell to modify the registry.

$devices = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\*"
$adapters = Get-ItemProperty $devices | Where-Object  {$_.Class -eq "Net"} | Foreach-Object { $_.PSPath }
Get-ChildItem $adapters -erroraction silentlycontinue | Foreach-Object { get-itemproperty -path $_.PSPath } | Where-Object {$_.ComponentId -eq "sun_vboxnetadp"} | Foreach-Object { Set-ItemProperty -path $_.PSPath -name "*NdisDeviceType" -Type DWORD -Value 1}
Get-WmiObject -Class Win32_NetworkAdapter | Where-Object {$_.Name -like "*Virtualbox Host*"} | Foreach-Object {$_.Disable(); $_.Enable()}

Why this registry fix fixes that:

There is actually an MSDN article that describes the possible registry keys for network adapters:

*NdisDeviceType

The type of the device. The default value is zero, which indicates a standard networking device that connects to a network. Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an endpoint device and is not a true network interface that connects to a network. For example, you must specify NDIS_DEVICE_TYPE_ENDPOINT for devices such as smart phones that use a networking infrastructure to communicate to the local computer system but do not provide connectivity to an external network.

And

Note  Windows Vista automatically identifies and monitors the networks to which a computer connects. If the NDIS_DEVICE_TYPE_ENDPOINT flag is set, the device is an endpoint device and is not a connection to a true external network. Consequently, Windows ignores the endpoint device when Windows identifies networks. The Network Awareness APIs indicate that the device does not connect the computer to a network. For end users in this situation, the Network and Sharing Center and the network icon in the notification area do not show the NDIS endpoint device as connected. However, the connection is shown in the Network Connections Folder.

More

Similar problem and similar fix for vmware:

http://aspoc.net/archives/2008/10/30/unidentified-network-issue-with-vmwares-virtual-nics-in-vista/

With a much nicer powershell script:

http://www.nivot.org/2008/09/05/VMWareVMNETAdaptersTriggeringPublicProfileForWindowsFirewall.aspx

And the virtualbox forums thread that pointed me in the right direction:

http://forums.virtualbox.org/viewtopic.php?f=6&t=17153#p73167

Comment - Permalink -

Christmas Lights updated
· 90 days ago by Thijs Kroesbergen for Brokenwire.NET

I just published a new version of the popular Christmas Lights. You can grab your free copy from the publish page right now.

So what’s new in this years update?

- New light bulbs: The new bulbs are bitmap based instead of “dynamic” WPF shapes, this reduces the CPU usage. And I think these look nicer too.

- Better stability: I resolved several issues which caused crashes when you changed the display resolution when the lights where active. Now you can also add/remove monitors while the lights are running.

- Plasma “burn-in” prevention: When this option is switched on the lights move a bit every minute so they don’t burn in your nice big plasma TV. :)

- Fully tested on Windows 7 but the lights will run on any pc having .NET framework 3.5(sp1). (This includes Windows XP, Vista, Server 2003)

DOWNLOAD NOW

I’ve already got some nice ideas for a future version, but suggestions (or patches) are always welcome!

Possible features for a next version:

- Make the blinking speed dependant on the power level of your laptop battery: As the battery gets empty the lights should blink slower (or faster).

- Make the lights blink when sound is detected, so they can sync up with your favorite Christmas tunes.

- Create more blinking patterns and add a pattern to cycle through all other patterns.

So prepare your PC for the Christmas season and install the lights!
And if you are curious about the code that makes all that goodness happen, take a look at the “Wpf Christmas Lights” CodePlex project page. There you can also report bugs or post suggestions.

Happy Holidays!

Comment - Permalink -

New feature: Webslice
· 325 days ago by Thijs Kroesbergen for Brokenwire.NET

Brokenwire.NET now has it’s own webslice. You may wonder what a webslice is. Remember 1997 ? That’s when we had snippets of web pages on our active desktop! Well a web slice is just that, it’s a piece of information from a site inside a small window in your browser. Internet Explorer 8 is the only browser that supports these things right now.

When you have installed the slice on you browser’s favorites bar it will look like this:

So if you have IE8 you can click on the small link in the right sidebar on this site to add the Brokenwire.NET webslice to your own browser.

Creating such a slice is very easy, with some help of this blogpost about webslices I was able to do this in 10 minutes.

The basic HTML structure:

<html><head>
<title>Page Title</title>
</head><body>
<div class="hslice" id="techologynews">
<h2 class="entry-title">IE 8 web slice</h2>
<div class="entry-content">
<p><a href='#'>Link 1</a></p>
<p><a href='#'>Link 2</a></p>
<p><a href='#'>Link 3</a></p>
</div></div>
</body></html>

The basic rules:

    1. The WebSlice must use the class name hslice in the container.
    2. Each WebSlice must contain an ID in the container. This is how the WebSlice will be differentiated from others on the page.
    3. The WebSlice must have at least one entry-title element defined. This will be displayed both in the page and in the feed button that appear in the Favorites Bar when a user subscribes to the WebSlice.
    4. While not required, each WebSlice should contain at least one entry-content element. This is the information that will appear when the user selects the WebSlice from their Favorites Bar.

There is also an official Microsoft whitepaper about webslices.

I wonder if anybody is actually going to use this, but it was a nice thing to play with for a bit.

Enjoy!

Comment - Permalink -

Today is special
· 392 days ago by Thijs Kroesbergen for Brokenwire.NET

Why? Because today is Friday 13th? Yes, and did you know there is a larger chance that the 13th of the month is a Friday? Now that's creepy.

But today is special in another way:

Today is the day on which Unix time will hit 1234567890, this will happen tonight at precisely 23:31:30h UTC.

Unix time (POSIX time) represents the number of seconds since the "epoch" which is defined as on 00:00h, January 1st 1970. The 1000000000 mark already passed by on 01:46:40h 2001-09-09 UTC.

Many people take advantage of this well-balanced number to throw 1234567890 parties. (And why not, any reason is a terrific reason to party!)

Working in an Microsoft SQL Server world you may wonder why 1-1-1753 is the smallest date in the regular datetime datatype. Some very good reading about that can be found in The ultimate guide to the datetime datatypes.

Although watching these numbers rise is great fun, there is a new Y2k problem looming ahead. on January 19th 2038 at 03:14:08h UTC the world as we know it will end. Because at that exact moment the number of seconds will exceed the value a 32-bit signed integer can hold (2^31). If that doesn't end the world there is another chance on February 7th, 2106 at 06:28:16h UTC, when the POSIX time will reach 2^32. But using a positive-only integer to store the timestamp would be stupid because then we would loose the possibility to store date before 1970, so we're doomed anyway. The only chance of survival we have is to start storing the timestamp in signed 64-bit integers, because that will extend the problem for... uh... some 300 million years. (Don't worry too much, most modern operating systems store the timestamp in an 64-bits unsigned integer already)

So, what will you do to celebrate this great moment in history? I'll probably be watching TV, and not playing any games.

Comment [1] - Permalink -

Oh no!
· 401 days ago by Thijs Kroesbergen for Brokenwire.NET

kb907534 Sigh...

Comment [2] - Permalink -

Kill the *beep*
· 420 days ago by Thijs Kroesbergen for Brokenwire.NET

The PC Speaker on my laptop also plays through the headphones, on maximum volume. So if you are listening to music the beep plays incredibly loud and straight into your ears.

To kill the beep run the following commands from an command prompt (with administrative privileges)

net stop beep

sc config beep started= disabled

I tried this on both Vista and Server 2003. A nice way to test if this worked for you: in the command prompt type:

echo ^G

(echo and ctrl+G) then Enter. With the beep on this destroys your ears, with the beep of you won't hear a thing.

Happy listening!

Comment - Permalink -

Previous