Monday, August 27, 2012

Turn a Windows 7 desktop to Wifi AP via Microsoft Virtual Wifi miniport adapter

Introduction

Windows 7 introduces a new virtual driver for WiFi network that create a virtual WiFi AP to share network / Internet connection for any WiFi device.  The network adapter is named as Microsoft Virtual Wifi miniport adapter.

Before Windows 7, Adhoc wireless connection is a common WiFi connection that may only connect to one WiFi device only.  The Windows Virtual WiFi connection may connect to up 8 WiFi devices.

Check support of Virtual Wifi

The virtual network adapter should install automatically in Device Manager once your WiFi adapter is activated:

image

A new Wireless Network Connection (e.g.: Wireless Network Connection 2 in the following example) should configure as well:

image

Everything is ready up to this stage, continue the configuration to turn on the virtual WiFi AP and start sharing your network connection.

Please note that there is no GUI tools to configure virtual WIFI connection.  All commands should type in command line console under Administrator privilege.

Configure Virtual WiFi connection

Choose a SSID to identify your virtual WIFI AP and set a password for it.  Type the following command in command line console running as administrator to start configure:

C:\Windows\system32>netsh wlan set hostednetwork mode=allow ssid=MyWifi key=password keyUsage=persistent
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.

Make sure the physical Wifi adapter is enabled before start the Virtual WiFi connection:

C:\Windows\system32>netsh wlan start hostednetwork
The hosted network started.

The Virtual WiFi connection (MyWifi, in this example) is active:

image

The Virtual WiFi connection is ready to accept connection now.  Use any other WiFi device (Smartphone, other notebook, PC) to check if the MyWifi connection appears the WiFi connection list.

Please note that the virtual WiFi connection does not connect to any Internet connection yet.  All WiFi connection to MyWifi is isolated in the MyWifi network only.

Share Internet connection to Virtual WiFi connection

Enable Internet Connection Sharing for virtual WiFi connection allow Internet traffic be served for virtual WiFi client.  First, identify the network connection with Internet access:

image

Open properties page of the Network Connection with internet access and set the following:

  1. “Allow other network users to connect through this computer’s Internet connection.
  2. Set Home networking connection to “Wireless Network Connection 2” (The connection should be Virtual WiFi Connection).
  3. Click OK to commit changes.

image

The Virtual WiFi connection should have access to Internet now:

image

Other WiFi device connect to virtual WiFi connection should be able to access the Internet immediately.

Virtual Wifi AP not started after reboot

The Windows 7 Virtual WiFi connection is not persisted when machine reboot.  You should start the virtual WiFi connection each time machine has rebooted:

C:\>netsh wlan show hostednetwork

Hosted network settings
-----------------------
    Mode                   : Allowed
    SSID name              : "MyWifi"
    Max number of clients  : 8
    Authentication         : WPA2-Personal
    Cipher                 : CCMP

Hosted network status
---------------------
    Status                 : Not started


C:\>netsh wlan start hostednetwork
The hosted network started.

Stop virtual WiFi connection

Run the command to stop connection:

C:\>netsh wlan stop hostednetwork
The hosted network stopped.

Uninstall virtual WiFi adapter

It is not necessary to uninstall virtual WiFi adapter as the uninstall is not permanent.  The virtual WiFi adapter will be installed once your reboot machine.  If you mean to uninstall the virtual WiFi adapter for current session, try this:

C:\>netsh wlan set hostednetwork mode=disallow
The hosted network mode has been set to disallow.

Side Effect: Unable to access network share after update Microsoft Virtual WiFi Miniport Adapter

There is a side effect if Microsoft Virtual Wifi Miniport Adapter has been updated.  The network share may not be accessed and “0x8004005 Unspecified error” may prompt:

image

This is due to the “Client for Microsoft Networks” service is missing from the network connection.  Reinstall service “Client for Microsoft Networks” will solve the error:

Untitled

No comments: