We distribute the Internet via WiFi using built-in Windows tools. How to completely remove Microsoft Wi-Fi Direct Virtual Adapter How to enable hosted network support

It just so happened that at work, in order to get full-fledged Internet without restrictions, I have to use a netbook and a 3G modem. Recently, having bought an iPod Touch, I really wanted to connect it to the Internet. If a smartphone could still get online on its own, it was a little more difficult with a player.

One option is to connect using a sync cable. The option is not very convenient, since there is absolutely no desire to carry a cable with you all the time, and you don’t want to install iTunes either. The second option, the one described in this article, is connecting via WiFi. A similar problem and its solution have already been mentioned on Habrahabr, but for Linux. Our task is to configure the same thing for Windows.

So what do we have

- Netbook, ASUS 1215B
- Internet via USB 3g modem
- Player and smartphone with WiFi

Task

- Get internet on all devices

Solution

Before you start, many people advise updating the WiFi card driver on your computer. Personally, I didn’t do this, but everyone decides for themselves.
Methods
- You can use graphical utilities such as Connectify and Virtual Router. They work, they even work well, but they eat up resources. Some people complained that they were eating up resources too much.

You can do everything yourself via the console using netsh. This is exactly the method I chose. All actions must be performed on behalf of the Administrator.

Creating a network
First of all, you need to create a wireless network using the following command
netsh wlan set hostednetwork mode=allow ssid="MyHomeInternet" key="pass12345678" keyUsage=persistent
where MyHomeInternet is the network name (ssid), pass12345678 is the login password.

The success of the command will look something like this:
Hosted network mode is enabled in the wireless network service. The hosted network SSID has been successfully changed. The hosted network user key passphrase was successfully changed.
Now you can go to Control Panel \ \ . I call it “Wireless Network Connection 2”.

Connection management
Since the connection is in the “No connection” status, we need to enable it. To do this, run the command:
After receiving the phrase Hosted network is running, the network will be launched and we will see your network connection in the list of connections. In our example, this is MyHomeInternet.

To stop the network, you need to use the command:
netsh wlan stop hostednetwork

Connecting the Internet
The WiFi network has been created and you can even connect to it, but the Internet will most likely be absent. In order to correct this misunderstanding, it is necessary:
- go to Control Panel \ Network and Sharing Center \ Change adapter settings;
- go to the properties of the connection through which you go online(for me this is Internet MTS);
- tab Access;
- check the box next to " Allow other network users to use this computer's Internet connection" and select our created network from the list - “Wireless network connection 2”;
- click OK;
- disable and enable 3g connection; (ideally restart your computer)
- disable and enable WiFi network.
What happened
Ideally, after these steps, the laptop will turn into a small WiFi point. To do this, take the iPod, turn on WiFi and see our created MyHomeInternet network. Enter the password and connect. There is Internet.

Restrictions

- first of all, after each start of Windows, you will have to start the network using the command netsh wlan start hostednetwork. This can be solved by writing a small script and sending it to startup. Another option is to create a shortcut on your desktop and launch the network only when necessary.
- OS must be Windows 7.
- the connected device must support WPA2-PSK/AES

Problems

Network is not created
- update the wireless adapter driver to a newer one
- run the console as administrator
The network has been created, but does not start
- perhaps restarting the computer and starting the network as administrator will help
The network has been created and started, but it is impossible to connect to it
- check password
- manually specify network settings in the properties of TCP/IP connections on the “server” and client. For example, for the server: ip - 192.168.137.1, mask - 255.255.255.0 and for the client: ip - 192.168.137.2, mask - 255.255.255.0, gateway - 192.168.137.1, dns - 192.168.137.1
Connected to the network, but can't access the Internet
- make sure that you have shared it (see the item “Connecting the Internet”)
- try to go not by domain name, but by IP address. If it does, then it’s time to think about adding a DNS server to the client and/or server settings.
Bottom line
As you can see, such a simple problem can be solved without using third-party software. Nevertheless, sometimes it happens that you can’t do without it. In my case, there were problems with DNS and even by specifying the Google Public Domain server in the TCP/IP settings, I could not do anything. Therefore, I had to resort to using the BIND package and setting it to 127.0.0.1. It’s just as easy to set up, but more on that in the next mini-article.

Currently, wireless networks are becoming increasingly widespread: they work at train stations, airports, and enterprises, and for many users at home. In Windows 7, an option appeared called “virtual WiFi” - a software layer that creates several virtual adapters from the wireless network card installed in the computer. But first, a little theory.

Wireless networks can operate in two modes:

The devices are connected directly to each other. The result is a simple network (ad-hoc mode). This mode is called "point-to-point". This mode is used quite rarely and mainly for data exchange in cases where it is not possible to use an access point.

Devices are connected via an access point (Access Point-AP).
This mode is called Infrastructure Mode and is usually used in conjunction with a wireless router connected to the Internet.

It should be noted that the simultaneous use of two modes of wireless network operation on one physical wireless adapter is not provided for by the WiFi concept itself, and this is where the virtualization technology used in Windows 7, which expands the capabilities of adapters, comes to the rescue.

What is Virtual WiFi technology

Without going into technical details: in Windows 7, one physical wireless adapter can be turned into several virtual ones, and - attention! - Each of these virtual adapters can be configured to connect to different wireless networks.

What is it for

Hmm... The question is, of course, interesting.
Example one: the radio signal from an existing access point does not cover the required distance between it and wireless devices. In this case, a computer or laptop with Virtual WiFi can act as a repeater (repeater), expanding the coverage area of ​​the wireless network.

Example two: creating a personal network (Wireless Personal Area Network), to which you can very quickly connect a phone, camera, printer, laptop or any other device with a wireless adapter for simple information exchange.

Example three: an existing wireless network with static IP addresses of devices, but sometimes you need to quickly connect new devices, without any adjustments or adjustments (this can be done if the mode for allocating dynamic IP addresses was enabled. But alas) .

How Virtual WiFi is implemented in Windows 7

By the way: Virtual WiFi technology is included not only in Windows 7, but also in Windows 2008 R2.

Virtual WiFi is implemented in the operating system at the kernel level and allows for a very simple implementation of a software access point (SoftAP), while the only thing required from wireless adapter manufacturers is to implement SoftAP support in their drivers (many, by the way, have already done this).

So far - in the current implementation - Virtual WiFi has the following limitations: it is allowed to create only one virtual adapter, operating only in access point mode and only with WPA2-PSK/AES encryption.
By the way, Virtual WiFi technology allows you to connect up to 100 clients to an access point versus 8 clients in the My WiFi technology promoted by Intel.

Installing, enabling and configuring Virtual WiFi

Testing the operation of Virtual WiFi - installing, turning on and configuring a wireless network - was carried out on an ASUS eeePC 1000H netbook with a built-in Ralink WiFi adapter.

So, first you have to play around a little - call the command prompt with administrator rights and enter the following command:

netsh wlan set hostednetwork mode=allow ssid="MS Virtual WiFi" key="softodrom" keyUsage=persistent

“MS Virtual WiFi” here is the name (SSID) of the virtual network being created, and “softodrom” is the password for accessing the network. Of course, both of these parameters can be changed at your own discretion.
The last parameter - keyUsage=persistent - determines that the password will be saved and will not have to be specified every time you need to start a virtual network.

After running this command, the system will detect the new hardware and a new network adapter will appear in Device Manager called "Microsoft Virtual WiFi miniport adapter".

As a clarification: naturally, a virtual adapter will appear in Device Manager only if the driver of the wireless adapter you have installed supports Virtual WiFi technology.

To be more reliable, let’s look at Control Panel –> Network and Sharing Center –> Change adapter settings:

As you can see, a new connection “Wireless network connection 2” has appeared here with the status “No connection” (it is already there in the picture. More on that below).

Let's move on to launching the network. In a command prompt running with administrator rights, run the following command:

netsh wlan start hostednetwork

After this, a) the network will start (Microsoft called it “Hosted Network”) and b) the software access point will work, which you can verify by going to Control Panel -> Network and Sharing Center.

As we can see, the computer is connected to several wireless networks simultaneously, and now other wireless devices can connect to our newly created software access point.

To provide Internet access to other wireless devices that will connect to our software access point, go to the Control Panel tab -> Network and Sharing Center -> Change adapter settings and in the properties of the adapter through which the computer - in our case eeePC netbook - gets access to the Internet (we have a WiFi connection, but it can be any of the available ones - Ethernet, WiMax, 3G, etc.) in the "access" tab, check the box "Allow other network users to use the Internet connection this computer."

In addition, in “Connecting a home network” you need to indicate which network adapter - in our case it is “Wireless Network Connection 2” - the Internet should be provided to.


Finally, about the client. From the client side, several wireless networks will be visible, and when connecting to an organized access point (previously we assigned it SSID = MS Virtual WiFi), the client will automatically receive an IP address from the internal DHCP server, gain access to the Internet and at the same time be separated from the external NAT (Network Address Translation) networks.

The clients used in the test were a laptop and a WiFi-enabled mobile phone; in both cases, accessing the Internet via a virtual WiFi network did not cause any difficulties.

Simplifying virtual WiFi network management

Despite the obvious advantages of Virtual WiFi, using the command line to configure and start a network for Windows users who are accustomed to pressing buttons is not convenient and familiar, especially since they will have to start the network every time after rebooting the computer, as well as waking it up from sleep or standby mode.

Unfortunately, there is no built-in graphical interface for Virtual WiFi in the operating system, but, as always in such cases, third-party developers came to the rescue and released graphical shells for Virtual WiFi - Connectify and Virtual Router Manager. We recommend using the first one (Connectify), since its developer is constantly working to improve it and regularly releases new versions, and the development of Virtual Router Manager is still in the beta stage, with the last beta version dating back to 2009.

The principle of using both utilities is very simple: in the appropriate fields you need to indicate the network SSID and password for access and click on the Start button, after which the program will load along with the startup of the operating system, ensuring the launch of the virtual network. In addition, both utilities, Connectify and Virtual Router Manager, show current connections to the virtual network.

Commands for Managing a Hosted Network

Finally, for command line connoisseurs, there are new commands for managing a hosted network that appeared in Windows 7 and Windows 2008 R2:

netsh wlan set hostednetwork allowed/disallowed – allow or deny network use

netsh wlan set hostednetwork persistent/temporary - setting up network parameters, where SSID is the SSID of the network; key - security key (password) used by the network; keyUsage – indicates whether the security key is permanent or temporary

netsh wlan show settings – shows network properties and its status

netsh wlan show hostednetwork settings=security – displays the security settings of the hosted network, including the password specified in key when configuring netsh wlan set hostednetwork

netsh wlan start hostednetwork - start a hosted network

netsh wlan stop hostednetwork - stop the hosted network.

I think many of my readers have encountered a situation when there was an urgent need to distribute the Internet from their laptop to other gadgets, or to create a permanent local WiFi network, but there was no WiFi Router available. There is specialized software for these tasks, for example, Connectify.

However, using such software may not always be a good idea. For example, if the need for distribution is an isolated case, then installing a separate program for these purposes may not be practical. Moreover, the same Connectify has the unpleasant property of significantly slowing down the system and, in some cases, causing various failures. And its free version blocks VPN connection forwarding and has a number of other restrictions, which may also come as an unpleasant surprise for you.

Therefore, in this article we will talk about how to set up a virtual WiFi access point in infrastructure mode without using third-party tools and tools.

Starting with Windows 7, Virtual WiFi technology was included in the operating system at the kernel level. This means that if your network card supports Software Access Point (SoftAP), you can create one virtual adapter that will operate in access point mode, while providing encryption over WPA2-PSK/AES.

Configuring Hosted Network Settings

To configure settings hosted network You need to start a command prompt with administrator rights and run the following command:

netsh wlan set hostednetwork mode=allow ssid="Network_name" key="Network_Password" keyUsage=persistent

After executing this command, the operating system will install new hardware and a new virtual network adapter may appear in Device Manager - AMicrosoft Virtual WiFi Miniport Adapter (Microsoft Virtual WiFi miniport adapter)

Note 1: For some new Intel network adapters, additional hardware may not appear in Device Manager. However, Virtual WiFi will still work.

Also in Network and Sharing Center In chapter Change adapter settings, a new connection will appear Wireless network connection 2

Note 2: In case of use In Windows 8.1, in the Network and Sharing Center, a new connection appears only after the hosted network is launched.

Launching a Hosted Network

To start a hosted network, you need to start a command prompt with administrator rights and run the following command:

netsh wlan start hostednetwork

Note 3: The command to configure hosted network settings needs to be run only once for an individual computer, and the command to start hosted network needs to be run each time there is a need to work with a virtual access point.

Stopping a hosted network

To stop the hosted network, you need to start a command prompt with administrator rights and run the following command:

netsh wlan stop hostednetwork

Note 4: When you turn off your computer, the virtual access point is also turned off, and after turning it on again it will not start automatically. How to ensure automation of a virtual network, see the section Automate the launch of a hosted network.

Note 5: When the user logs out, the virtual access point will continue to work. To stop it, you need to run the appropriate command or restart the computer.

Setting up Internet sharing

To configure shared access to the Internet, you need to go to the tab in the properties of the network adapter that is connected to the Network. Access (Sharing), check the box next to the “Allow other network users to connect thougt this computer’s Internet connection” option and select the virtual network adapter from the drop-down list.

Automate the launch of a hosted network

To automate the launch of a hosted network, we will use the Task Scheduler. To create a new task, you must Task Scheduler Library go to the appropriate folder with your tasks (or create a new folder and then go to it) and on the panel Actions select item Create a task.

Note 6: To launch the scheduler in Windows 8.1, open the Home screen, type in the search Schedule tasks, and open the corresponding application.

In the window that opens, you must enter the name of the task, as well as specify other parameters, as shown in the screenshot:

On the Triggers tab, you must specify the conditions for starting the task. Let's create a trigger that starts the task 3 minutes after logging in. For this purpose in the list Start task choose When you log in, and indicate other parameters in accordance with the screenshot:

Note 7: I recommend setting the task execution delay so as not to aggravate the problem of slow response of the operating system during autostart of programs and services when logging into the system. It is advisable to select the startup delay time based on the computer configuration, as well as the overall loading of the OS by programs from autorun.

Note 8: If you use Hibernation, then in addition to the login trigger, you need to create another trigger, indicating Start task When the workstation is unlocked.

On the Actions tab, you need to configure the launch of a WiFi virtual network. To do this, press the button Create, and enter the launch command parameters: Action: Starting the program; Program: netsh; Arguments: wlan start hostednetwork.

On the Conditions tab, you can allow a task to run only if the computer is connected to a specified network, or any network at all.

After completing the creation of the task, you must enter the password of the account under which it will be launched.

If you did everything correctly, now after each restart of Windows the virtual WiFi network will start automatically.

Take Our Poll

It just so happened that at work, in order to get full-fledged Internet without restrictions, I have to use a netbook and a 3G modem. Recently, having bought an iPod Touch, I really wanted to connect it to the Internet. If a smartphone could still get online on its own, it was a little more difficult with a player.

One option is to connect using a sync cable. The option is not very convenient, since there is absolutely no desire to carry a cable with you all the time, and you don’t want to install iTunes either. The second option, the one described in this article, is connecting via WiFi. Already on Habrahabr, but for Linux. Our task is to configure the same thing for Windows.

So what do we have

- Netbook, ASUS 1215B
- Internet via USB 3g modem
- Player and smartphone with WiFi

Task

- Get internet on all devices

Solution

Before you start, many people advise updating the WiFi card driver on your computer. Personally, I didn’t do this, but everyone decides for themselves.
Methods
- You can use graphical utilities such as Connectify and Virtual Router. They work, they even work well, but they eat up resources. Some people complained that they were eating up resources too much.

You can do everything yourself via the console using netsh. This is exactly the method I chose. All actions must be performed on behalf of the Administrator.

Creating a network
First of all, you need to create a wireless network using the following command
netsh wlan set hostednetwork mode=allow ssid="MyHomeInternet" key="pass12345678" keyUsage=persistent
where MyHomeInternet is the network name (ssid), pass12345678 is the login password.

The success of the command will look something like this:
Hosted network mode is enabled in the wireless network service. The hosted network SSID has been successfully changed. The hosted network user key passphrase was successfully changed.
Now you can go to Control Panel \ \ . I call it “Wireless Network Connection 2”.

Connection management
Since the connection is in the “No connection” status, we need to enable it. To do this, run the command:
After receiving the phrase Hosted network is running, the network will be launched and we will see your network connection in the list of connections. In our example, this is MyHomeInternet.

To stop the network, you need to use the command:
netsh wlan stop hostednetwork

Connecting the Internet
The WiFi network has been created and you can even connect to it, but the Internet will most likely be absent. In order to correct this misunderstanding, it is necessary:
- go to Control Panel \ Network and Sharing Center \ Change adapter settings;
- go to the properties of the connection through which you go online(for me this is Internet MTS);
- tab Access;
- check the box next to " Allow other network users to use this computer's Internet connection" and select our created network from the list - “Wireless network connection 2”;
- click OK;
- disable and enable 3g connection; (ideally restart your computer)
- disable and enable WiFi network.
What happened
Ideally, after these steps, the laptop will turn into a small WiFi point. To do this, take the iPod, turn on WiFi and see our created MyHomeInternet network. Enter the password and connect. There is Internet.

Restrictions

- first of all, after each start of Windows, you will have to start the network using the command netsh wlan start hostednetwork. This can be solved by writing a small script and sending it to startup. Another option is to create a shortcut on your desktop and launch the network only when necessary.
- OS must be Windows 7.
- the connected device must support WPA2-PSK/AES

Problems

Network is not created
- update the wireless adapter driver to a newer one
- run the console as administrator
The network has been created, but does not start
- perhaps restarting the computer and starting the network as administrator will help
The network has been created and started, but it is impossible to connect to it
- check password
- manually specify network settings in the properties of TCP/IP connections on the “server” and client. For example, for the server: ip - 192.168.137.1, mask - 255.255.255.0 and for the client: ip - 192.168.137.2, mask - 255.255.255.0, gateway - 192.168.137.1, dns - 192.168.137.1
Connected to the network, but can't access the Internet
- make sure that you have shared it (see the item “Connecting the Internet”)
- try to go not by domain name, but by IP address. If it does, then it’s time to think about adding a DNS server to the client and/or server settings.
Bottom line
As you can see, such a simple problem can be solved without using third-party software. Nevertheless, sometimes it happens that you can’t do without it. In my case, there were problems with DNS and even by specifying the Google Public Domain server in the TCP/IP settings, I could not do anything. Therefore, I had to resort to using the BIND package and setting it to 127.0.0.1. It’s just as easy to set up, but more on that in the next mini-article.

When trying to create a virtual Wi-Fi network using the netsh wlan start hostednetwork command, the user may encounter a message that the hosting of such a network was unsuccessful. In this article, I will tell you what this error is and also explain how to fix the “The Hosted Network Couldn’t be Started” problem on your PC.

Among the reasons for the netsh wlan start hostednetwork error, I would note the following:


Fixing netsh wlan start hostednetwork error

First, check if you have a Wi-Fi adapter on your computer. If for a laptop and netbook this is implied a priori, then for owners of desktop computers everything is not so clear. Look for the Wi-Fi adapter in Device Manager (the “Network Adapters” section), where it is usually listed as a wireless network adapter.

It also happens that Wi-Fi on a PC is turned off by the user himself (either through the button to turn off the Wi-Fi module, or by pressing a key combination, for example, for me, it’s Fn+F2). Make sure your Wi-Fi module is enabled and working. So what to do?

Method 1. Use a virtual adapter


Now you can connect your virtual network using the standard command “netsh wlan start hostednetwork”.

Method 2. Restart the adapter

  1. Go back to Device Manager and find “Network Adapters”.
  2. Find the name of our main wireless network adapter.
  3. Right-click and first select “Disable”.
  4. And then a couple of seconds after turning it off, select “Enable”.

Method 3. Use commands

If the previous two methods did not help you start a hosted network netsh wlan start hostednetwork, then Microsoft experts recommend doing the following:


How this all looks visually can be seen in the video:

Method 4. Check whether our adapter supports a virtual access point

  1. Press the key combination Win+R, and in the window that appears, type cmd.
  2. On the command line, write netsh wlan show drivers and press enter.
  3. In the resulting result, we check the item about supporting a hosted network, and if it says “no,” then your adapter is not suitable for creating a virtual Wi-Fi network.
  4. In this case, we can only advise you to buy an external Wi-Fi adapter that uses a USB connection for its operation.

Conclusion

In most cases, the specified problem with netsh wlan show drivers is solved by enabling a virtual adapter, which is often hidden from the user's eyes. You can also advise restarting your Wi-Fi adapter; in addition, some users were helped by a set of tips from Microsoft specialists on disabling and enabling the hosted network. Well, for those who do not have a Wi-Fi adapter at all, we can advise you to purchase such an adapter at the nearest specialized store.

In contact with