[Guide] Alternate to Ad-Hoc Wi-Fi Network for your Android Device

Search This thread

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
1. Introduction:
-This guide is for those who do not have a Wi-Fi router in their network. The guide will teach you how to access the internet in your Android device, where by the internet is only accessible in your Laptop though LAN.

-Before when Galaxy S2 had Gingerbread, there was a modified WPA_Supplicant here. However it does not work with ICS and above and no one else have come up with a updated mod.

-However if you have Windows 7/8 [does not work in XP] then you can try setting up a Virtual Wi-Fi adapter which works as good as a WI-Fi access point.

-There are many other ways like Connectify and other softwares, but they have not worked for and more over why to bloat the system when there is a native feature support in PC.

-There is another alternate called reverse tethering. But that will require root and it only works for me sometimes. More like when I get lucky. You can try this app or this guide.

2. Requirements:
a. Windows 7/8
b. Administrative access for Windows PC
c. Wi-Fi enabled Laptop or an Desktop with Wi-Fi adapter

3. Steps:
Step 1: Press start and type cmd and right click on it click on "Run as Administrator"

Step 2: Type netsh wlan set hostednetwork mode=allow ssid=NAME key=PASSWORD and press enter
Note: NAME is the name which you want to give for the WI-Fi accesspoint and PASSWORD is the security key which is required for accessing the Wi-Fi AP in Android device. Also the password should be at least 8 character long.

Now wait till you get three sets of line confirming the command as attached in screen shot. It sometimes may take around a minute

Step 3: Type netsh wlan start hostednetwork and press enter. You will again get a confirmation message. By this step the new Wi-Fi access point will be broadcasting and when you scan it in you Android device it will appear in the list
1cmd.png

Step 4: There is one more step to make the internet pass through the newly created Wi-Fi access point. The internet should be shared via LAN adapter. To do that follow the steps as below:
a. Start -> Run (or press Windows key + R)
b. Type ncpa.cpl and press enter
c. You will see Network Connections now
d. Here you will find a new network adapter called "Microsoft Virtual WiFi Miniport Adapter". This one is created when the "Step 3" is done as above. Note down the connection name. In my case it is "Wireless Network Connection 2"
e. Now identify the one which is connected to your LAN network where internet is accessed (this can be LAN adapter, WiFi adapter or even dialup connection in case of tethering)
f. Double click on that connection identified under step (e)
g. Click on "Properties"
h. Click on "Sharing" tab
i. Tick on "Allow other network users to connect through this computer's Internet Connection"
j. Under the drop down list for "Home networking connection" select "Wireless Network Connection 2" [or which ever it is in your case]
k. Click on OK and close all the dialogue boxes
[
2sharing.png

Step 5: Now scan for Wi-Fi in your Android device and you can find the Wi-Fi with whatever SSID you created. Connect to it and enjoy the LAN internet in your device.

Note: If you wish to turn off the Wi-Fi AP you created then you can type netsh wlan stop hostednetwork in the command prompt and press enter. The next time you restart your PC you can directly do the "Step 3" above and you are good to go.

Also you if you wish to change the SSID and/or password later do only the "Step 2" and "Step 3" as above.


4. Troubleshooting:

1 - Wi-Fi is not turned on in PC
You might get an error stating as below when you try the "Step 3":
3atb1.png

The hosted network couldn't be started.
A device attached to the system is not functioning.

This is because the WI-Fi adapter is turned off in your PC. Just turn it on which usually will be a physical button or a function key in your keyboard. Now try "Step 3" again and you shouldn't be getting the error.

2 - Insufficient resources error
You might also get an error stating as below when you try the "Step 3":
3btb2.png

The hosted network couldn't be started.
The group or resource is not in the correct state to perform the requested operation.

This can happen if the Virtual WiFi Miniport adapter is not working properly. Try the below steps to resolve it:
a. Under network connections, if you already have a Virtual WiFi Miniport adapter then make sure its not disabled. If yes enable it back by right clicking and selecting enable.

b. OR - if you don't find the WiFi Miniport adapter at all then do as below:
i. Open Run and type "devmgmt.msc" and press enter
ii. Now you will get Device Manager window. Here expand the Network Adapters tab.
iii. Identify the actual WiFi adapter and right click on it and select disable.
iv. Now right click on it again and select enable
3ctb21.png

After this the adapter settings will have rested and the "Step 3" should be a no problem.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is my second guide here in XDA. Hope it was useful and helping you enjoy the internet in your device. Do post your comments here if you have tried it out. Also do not hesitate to post here for any queries.

I also request you to look at my first guide Access Windows PC files directly from Android through Wi-Fi.

Thank you for reading.

Change log:
v0.1 [07-Oct-12]
-Initial guide
 
Last edited:

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
Quick note:

For those who are not able to solve the issue mentioned in troubleshoot 2 in guide above here is an checkup. With admin rights in command prompt type as below:

netsh wlan show drivers

After you press enter you will get a list of line items. There check for "Hosted network support: Yes"

If it is mentioned as "No" then you need to update your wifi adapter drivers.

Sent from my GT-I9100 using Tapatalk 2
 

oliaros

Member
Sep 4, 2012
5
0
nice try, works fine! But: I would prefer a solution that can connect directly over wifi, means ice cream sandwich can see and log on to adhoc networks. Anyway: thanx for this, oliaros
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
nice try, works fine! But: I would prefer a solution that can connect directly over wifi, means ice cream sandwich can see and log on to adhoc networks. Anyway: thanx for this, oliaros
Well but the thing is virtual wifi adapter is much for efficient and secured than ad hoc network. Even if you want to set up the ad hoc it will take the same amount of procedure. Just that you will be using the GUI and not the command prompt. But do note that windows 8 has no ad hoc feature ;)

Only draw back of the this method is that you need wifi adapter supporting virtual wifi and you should be on Windows 7/8.

Sent from my GT-I9100 using Tapatalk 2
 

idoleng

Senior Member
Jul 17, 2012
73
6
nice tutorial!

but on my dell latitude laptop, (I am using vista) I cannot find "hostednetwork" under netsh>wlan>set.

I can only see the following under set:
autoconfig
blockednetworks
createalluserprofile
profileorder
profileparameter
tracing
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
nice tutorial!

but on my dell latitude laptop, (I am using vista) I cannot find "hostednetwork" under netsh>wlan>set.

I can only see the following under set:
autoconfig
blockednetworks
createalluserprofile
profileorder
profileparameter
tracing
Virtual WiFi adapter is Windows 7/8 feature only. Upgrade the OS :) Vista is buggy actually.

Sent from my GT-I9100 using Tapatalk 2
 

idoleng

Senior Member
Jul 17, 2012
73
6
adhoc

Virtual WiFi adapter is Windows 7/8 feature only. Upgrade the OS :) Vista is buggy actually.

Sent from my GT-I9100 using Tapatalk 2

:crying:

reminds me of one software I was trying before(when trying to activate adhoc also) I think it was connectify but not sure. it can only be used also in windows 7 only.

thanks anyway. I hope android includes this on their future updates.
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
:crying:

reminds me of one software I was trying before(when trying to activate adhoc also) I think it was connectify but not sure. it can only be used also in windows 7 only.

thanks anyway. I hope android includes this on their future updates.
Yup its connectify. It works in Vista but in Vista is ad hoc only. Even that software requires windows 7 or above for Virtual WiFi.

Sent from my GT-I9100 using Tapatalk 2
 

oliaros

Member
Sep 4, 2012
5
0
Well but the thing is virtual wifi adapter is much for efficient and secured than ad hoc network. Even if you want to set up the ad hoc it will take the same amount of procedure. Just that you will be using the GUI and not the command prompt. But do note that windows 8 has no ad hoc feature ;)

Only draw back of the this method is that you need wifi adapter supporting virtual wifi and you should be on Windows 7/8.


as i'm running xp i cannot use virtual wi-fi. my aim is just to connect to the internet, when my laptop has a connection. maybe someone patches the wpa_supplicant ...
oliaros
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
as i'm running xp i cannot use virtual wi-fi. my aim is just to connect to the internet, when my laptop has a connection. maybe someone patches the wpa_supplicant ...
oliaros
In that case hope someone comes with a patch just like they did for GB.

Sent from my GT-I9100 using Tapatalk 2
 

neeraj.juneja

Member
Aug 31, 2012
9
1
All thanks to Harsha Raj

Initially there was some issue with 3rd step, but updating the wifi driver via device manager proved to be useful..
In the process Harsha Raj was very useful and he was giving continuous support..
Thanks, it is very useful to users like us who are not using Data plans.

Thanks a lot again buddy.
God Bless us all.
 
  • Like
Reactions: Harsha Raj

ottti

New member
Oct 12, 2012
1
0
Vielen Dank für diese super Anleitung.

Lange habe ich versucht, eine Lösung für das AdHoc Problem unter ICS zu finden. Diese Anleitung ist die perfekte Alternative.
Alles funktionierte genau wie beschrieben.

:good:
VG Ottti
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
Vielen Dank für diese super Anleitung.

Lange habe ich versucht, eine Lösung für das AdHoc Problem unter ICS zu finden. Diese Anleitung ist die perfekte Alternative.
Alles funktionierte genau wie beschrieben.

:good:
VG Ottti
This forum is English only :)

Thanks for this great guide.

I have long been trying to find a solution to the problem under AdHoc ICS. This guide is the perfect alternative.
Everything worked exactly as described.

: Good:
VG Ottti0
You are welcome:D

Sent from my GT-I9100 using Tapatalk 2
 

Las0mbra

New member
Nov 8, 2010
1
0
Thank You!

Great, just great! A working solution after I had 16 hours of headaches with the f*ing wpa_supplicant.

I don't like to sound over enthusiastic, but:

Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! :D:D:D:D:D
 

Harsha Raj

Senior Member
Jun 30, 2011
4,353
1,335
Great, just great! A working solution after I had 16 hours of headaches with the f*ing wpa_supplicant.

I don't like to sound over enthusiastic, but:

Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! :D:D:D:D:D
Had the same feeling when I found out the solution for first time :D

Sent from my GT-I9100 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    1. Introduction:
    -This guide is for those who do not have a Wi-Fi router in their network. The guide will teach you how to access the internet in your Android device, where by the internet is only accessible in your Laptop though LAN.

    -Before when Galaxy S2 had Gingerbread, there was a modified WPA_Supplicant here. However it does not work with ICS and above and no one else have come up with a updated mod.

    -However if you have Windows 7/8 [does not work in XP] then you can try setting up a Virtual Wi-Fi adapter which works as good as a WI-Fi access point.

    -There are many other ways like Connectify and other softwares, but they have not worked for and more over why to bloat the system when there is a native feature support in PC.

    -There is another alternate called reverse tethering. But that will require root and it only works for me sometimes. More like when I get lucky. You can try this app or this guide.

    2. Requirements:
    a. Windows 7/8
    b. Administrative access for Windows PC
    c. Wi-Fi enabled Laptop or an Desktop with Wi-Fi adapter

    3. Steps:
    Step 1: Press start and type cmd and right click on it click on "Run as Administrator"

    Step 2: Type netsh wlan set hostednetwork mode=allow ssid=NAME key=PASSWORD and press enter
    Note: NAME is the name which you want to give for the WI-Fi accesspoint and PASSWORD is the security key which is required for accessing the Wi-Fi AP in Android device. Also the password should be at least 8 character long.

    Now wait till you get three sets of line confirming the command as attached in screen shot. It sometimes may take around a minute

    Step 3: Type netsh wlan start hostednetwork and press enter. You will again get a confirmation message. By this step the new Wi-Fi access point will be broadcasting and when you scan it in you Android device it will appear in the list
    1cmd.png

    Step 4: There is one more step to make the internet pass through the newly created Wi-Fi access point. The internet should be shared via LAN adapter. To do that follow the steps as below:
    a. Start -> Run (or press Windows key + R)
    b. Type ncpa.cpl and press enter
    c. You will see Network Connections now
    d. Here you will find a new network adapter called "Microsoft Virtual WiFi Miniport Adapter". This one is created when the "Step 3" is done as above. Note down the connection name. In my case it is "Wireless Network Connection 2"
    e. Now identify the one which is connected to your LAN network where internet is accessed (this can be LAN adapter, WiFi adapter or even dialup connection in case of tethering)
    f. Double click on that connection identified under step (e)
    g. Click on "Properties"
    h. Click on "Sharing" tab
    i. Tick on "Allow other network users to connect through this computer's Internet Connection"
    j. Under the drop down list for "Home networking connection" select "Wireless Network Connection 2" [or which ever it is in your case]
    k. Click on OK and close all the dialogue boxes
    [
    2sharing.png

    Step 5: Now scan for Wi-Fi in your Android device and you can find the Wi-Fi with whatever SSID you created. Connect to it and enjoy the LAN internet in your device.

    Note: If you wish to turn off the Wi-Fi AP you created then you can type netsh wlan stop hostednetwork in the command prompt and press enter. The next time you restart your PC you can directly do the "Step 3" above and you are good to go.

    Also you if you wish to change the SSID and/or password later do only the "Step 2" and "Step 3" as above.


    4. Troubleshooting:

    1 - Wi-Fi is not turned on in PC
    You might get an error stating as below when you try the "Step 3":
    3atb1.png

    The hosted network couldn't be started.
    A device attached to the system is not functioning.

    This is because the WI-Fi adapter is turned off in your PC. Just turn it on which usually will be a physical button or a function key in your keyboard. Now try "Step 3" again and you shouldn't be getting the error.

    2 - Insufficient resources error
    You might also get an error stating as below when you try the "Step 3":
    3btb2.png

    The hosted network couldn't be started.
    The group or resource is not in the correct state to perform the requested operation.

    This can happen if the Virtual WiFi Miniport adapter is not working properly. Try the below steps to resolve it:
    a. Under network connections, if you already have a Virtual WiFi Miniport adapter then make sure its not disabled. If yes enable it back by right clicking and selecting enable.

    b. OR - if you don't find the WiFi Miniport adapter at all then do as below:
    i. Open Run and type "devmgmt.msc" and press enter
    ii. Now you will get Device Manager window. Here expand the Network Adapters tab.
    iii. Identify the actual WiFi adapter and right click on it and select disable.
    iv. Now right click on it again and select enable
    3ctb21.png

    After this the adapter settings will have rested and the "Step 3" should be a no problem.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This is my second guide here in XDA. Hope it was useful and helping you enjoy the internet in your device. Do post your comments here if you have tried it out. Also do not hesitate to post here for any queries.

    I also request you to look at my first guide Access Windows PC files directly from Android through Wi-Fi.

    Thank you for reading.

    Change log:
    v0.1 [07-Oct-12]
    -Initial guide
    3
    I've created a GUI solution to your method. It is lightweight (less than 200kb) and works only with a click :)
    Download : sdrv.ms/TmzOfU
    2
    -Reserved for guide extension-
    2
    i was able to create the virtual AP using the steps provided by the OP. However, my phone will pass authentication, will show obtaining IP address and then it won't connect. Then the status will show as Saved, Secured. It will reconnect and then a message will appear the says "Attention! network disabled. Poor connection."

    anyone has any ideas how to fix this?
    Well looks like the device is having problem in taking the IP address. You sure have shared the internet from LAN properties?

    1. Make sure that virtual wifi adapter created has an IP address. System automatically sets it to 192.168.137.1.

    2. You can try is try setting the IP address manually in your S2 to 192.168.137.xxx, anything except 192.168. 137.1 and xxx can't be greater than 225.

    Now this would skip the" obtaining IP address" when connecting.

    Sent from my GT-I9100 using Tapatalk 2
    1
    Bookmarked, will try out ASAP! :)
    Do provide the feedback here :)

    Sent from my GT-I9100 using Tapatalk 2