If you have a single wired Internet connection, you can easily setup an ad-hoc wireless network with Ubuntu and share the Internet connection among multiple devices. Unfortunately, some devices including Android & Windows Phones may not support ad-hoc wireless networks.
UPDATE 2024: This tutorial is outdated! It may no longer works in current Ubuntu releases!
So this tutorial is going to show you how to turn your Ubuntu laptop into a wireless access point in another way with Android phones support.
To get started, press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the commands below one by one to install ap-hotspot.
Ap-hotspot is an open-source project that automatically creates an infrastructure (Access Point mode) wireless hotspot in Ubuntu that should work with Android and Windows Phone devices
sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install ap-hotspot
Supports for Ubuntu 13.10, Ubuntu 13.04, Ubuntu 12.10, Ubuntu 12.04 and Ubuntu 14.04. download & install the ap-hotspot deb for saucy at this page.
For Ubuntu 14.04, due to bug you need to downgrade hostapd
to make ap-hotspot work.
- First uninstall the buggy
hostapd
in Ubuntu 14.04 via:sudo apt-get remove hostapd
- Copy and paste the command below into terminal that matches your OS type – check out via System Setting -> Details – and hit run to download, install, and hold the old version of hostapd.While running the commands below, type in your user password in terminal when prompt.
For 64-bit system:
cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd
For 32-bit system:
cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd
Once installed, execute below command to configure your wifi hotspot:
sudo ap-hotspot configure
It will detect the wired & wireless interfaces and ask you to confirm that if they are correct (run ifconfig
if you’re not sure). Then you’ll be asked to enter a wifi hotspot name and setup a password.
Finally start the wireless hotspot via:
sudo ap-hotspot start
Now you’re able to connect to wifi hotspot via your Android phone!
To stop the wireless hotspot, execute this command in Ubuntu terminal:
sudo ap-hotspot stop
UPDATE: Please report issues at: https://github.com/hotice/AP-Hotspot/.
Tip: For the error “Access Point Mode is not supported by this device”, you may take a look at this page.
This metod working with 3g mobile modem ?
Yes, it does.
great man , i run it on kali linux and working but unfortunatuly network only with no internet , i dont know why ?? maybe (firewall or missing command ……
if you have idea check with me ……. any way thanks
Thanks a lot, I got it working on my Ubuntu 13.10 -> Android tablet
thanks…
very very usefull
hey .. i m used to do this on ubuntu 13.10 .. and it works fine , i can conneect my tablet .. but yesterday i changed to Elementary Os .. i found the access point and when i connect to it , it stuck on obtaining Ip adress ..
Hi. I have TTL = 1 on my laptop. My phone hasn’t internet access. How can I lower or raise the TTL value?
The IPV4 settings are accessible through proc filesystem at /proc/sys/net/ipv4.
Check the current TTL value, run:
To set a new TTL value, 255 as example:
@Ji m
when i run sudo ap-hotspot configure this command
terminal says: Your wireless card does not support Access Point mode
what should i do
Please report this issue at: “https://github.com/hotice/AP-Hotspot/issues” and ask the developer to add support your wireless card.
To check out network info, run:
Hi,
Thank you for the post. I am using ubunutu 12.04. I have followed the instruction given above to create the network. But, my android tab couldn’t connect to this network, it struck at obtaining IP address. I have searched for this, but i didn’t find any solution. Can you suggest me what i should i do to solve this problem? Thanks.
I am having same issue.
@Ji m
After starting the hotspot, my phone sees the connection but cannot access it. It keeps showing an invalid password error. Any ideas how to fix this?
Hi, thank you for the post, I am using ubuntu 12.10, I am installing on a Dell Latitude E5530.
Any ideas how to fix this?
$ sudo ap-hotspot configure
Your wireless card does not support Access Point mode
hello i have ubuntu 14.04 , and i successfully configure hotspot as u describe above,
and i am able to connect my mobile with hotspot but when i am running any application which uses internet it could not load, seems that i am connected but no internet access…
what i do?
Sorry @rohit. This app is a little buggy on 14.04 and please go to the project page (link at the end of article) to get help.
can i do this on linux mint 16?
mine is not working, it says “starting wireless hotspot….” waiting for 15 min it still not active, how can i fix this?
hello i have ubuntu 12.10 , and i successfully configure hotspot as u describe above,
and i am able to connect my mobile with hotspot but when i am running any application which uses internet it could not load, seems that i am connected but no internet access…
what i do?
Really work for connecting a Nokia Lumia
Hi hotspot is configured well but it only showing obtaning ip address and won’t connect
?
I installed ap-hotspot. I entered hotspot name and password. But when I try to connect any device it says authentication problem. I am unable to connect any device.
check if you have entered password with spelling mistakes on ap-hotspot configure and the device. ;)
Same problem here :/ Found any solution ?
Not working in linux mint 17 cinnamon :(
Sorry, the tutorial was tested on Ubuntu 13.10. Please try the KDE’s network manager, see the link at the end of article (UPDATE 2).
when i give the command sudo add-apt-repository ppa:nilarimogard/webupd8
it says pycurl.error: (7, “couldn’t connect to host”) even though i am connected to internet
it is not working, it says “starting wireless hotspot….” waiting for 15 min it still not active, how can i fix this?
Try KDE’s network manager, see update 2
Dear
Its not working with linux mint 17 though I used it with linux mint 15. can you update it for linux mint 17?
Linux Mint 17 is based on Ubuntu 14.04, see the “UPDATE 2”
Dear Sir,
Thanks for your article, I am able connect my laptop with mobile. But unfortunately on my mobile, Satus is showing as: Limited connectivity and also I am not able to access the internet on mobile.
Kindly help me.. waiting for your response.
also kindly show me the steps, what setting do I need on mobile (already done the seeting on laptop) for accesing the wired internet connection on mobile.
Hi, @Rashme. Please use the method mentioned in Update2
Sir I am using ubuntu 12.04
Dear sir,for your prompt reply. But I am having ubuntu 12.04
Hi,
Thank you for the post. I am using ubunutu 12.04. I have followed the instruction given above to create the network. But, my android tab couldn’t connect to this network, it struck at obtaining IP address. I have searched for this, but i didn’t find any solution. Can you suggest me what i should i do to solve this problem? Thanks.
GAH, nevermind!!! I was looking at the end of the article. I found it in the middle while scrolling up.
its not working on ubuntu 12.04. it is showing that wireless hotspot is active but my mobile is not searching it. also not showing in wireless connection.
Sorry man, Hotspot was working good. It may or may not work nowadays, please visit the project page (in the end of post) to get more information.
Now I’m using KDE’s network applet to handle this in Ubuntu 14.04 (not tested in 12.04), you can try it from the link in the “update2” (in the middle of post) section.
it is not working, it says “starting wireless hotspot….” waiting for 15 min it still not active, how can i fix this?
On the machines or phones you are trying to connect with, select “only wpa2” for encryption. Then you will be able to connect AND obtain an IP-address.
you can use this tool to create hotspot in ubuntu. if somehow it doesn’t install, install libqtgui from synaptic package manager
http://launchpad.net/mobhotspot
Hi Sir, i m using ubuntu 12.04 when i entered the command “sudo ap-hotspot configure” in terminal, it is showing that “Your wireless card does not support Access Point mode” why ? and what i have to do now ?
Hello, I am running ubuntu 14.04. It’s not working for me. After running the command to start the Hotspot, it is continuously showing “Starting Wireless Hotspot…..”. and doing nothing after that…
The same happens to me. I am running 14.04 x86_64, After running the command to start the Hotspot, it is continuously showing “Starting Wireless Hotspot…..”. and doing nothing after that…
sudeep@syslap:~$ sudo rm /tmp/hotspot.pid
rm: cannot remove ‘/tmp/hotspot.pid’: No such file or directory
sudeep@syslap:~$ sudo ap-hotspot start
Starting Wireless Hotspot…
Any help would be appreciated!
Thanks
This is because new version of hostapd in 14.04 default repository is buggy. See:
http://askubuntu.com/questions/453877/wifi-hotspot-in-ubuntu-14-04
Or, you can use KDE’s network manager to create a wifi hotspot.. see the “UPDATE 2” in the middle of the post.
If it doesn’t work in Elementary OS try to find here:
http://elementaryos.org/answers/making-ap-hotspot-work
Thanks! Great command but not working with my lan connection.
Hi, how do I keep a check of the devices that connected to my hotspot ?
Dunno wt happend i did go through all steps but at last step
parthdave@ubuntu:~$ sudo ap-hotspot start
Please disconnect WiFi before proceeding
parthdave@ubuntu:~$ sudo ap-hotspot debug
Starting Wireless Hotspot…
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)
update-rc.d: warning: hostapd start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: hostapd stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/hostapd …
Removing any system startup links for /etc/init.d/hostapd …
/etc/rc0.d/K20hostapd
/etc/rc1.d/K20hostapd
/etc/rc2.d/S20hostapd
/etc/rc3.d/S20hostapd
/etc/rc4.d/S20hostapd
/etc/rc5.d/S20hostapd
/etc/rc6.d/K20hostapd
Adding system startup for /etc/init.d/hostapd …
/etc/rc0.d/K20hostapd -> ../init.d/hostapd
/etc/rc1.d/K20hostapd -> ../init.d/hostapd
/etc/rc6.d/K20hostapd -> ../init.d/hostapd
/etc/rc2.d/K80hostapd -> ../init.d/hostapd
/etc/rc3.d/K80hostapd -> ../init.d/hostapd
/etc/rc4.d/K80hostapd -> ../init.d/hostapd
/etc/rc5.d/K80hostapd -> ../init.d/hostapd
update-rc.d: warning: dnsmasq start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: dnsmasq stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/dnsmasq …
Removing any system startup links for /etc/init.d/dnsmasq …
/etc/rc0.d/K85dnsmasq
/etc/rc1.d/K85dnsmasq
/etc/rc2.d/S15dnsmasq
/etc/rc3.d/S15dnsmasq
/etc/rc4.d/S15dnsmasq
/etc/rc5.d/S15dnsmasq
/etc/rc6.d/K85dnsmasq
Adding system startup for /etc/init.d/dnsmasq …
/etc/rc0.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc1.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc6.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc2.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc3.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc4.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc5.d/K85dnsmasq -> ../init.d/dnsmasq
* Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
…fail!
net.ipv4.ip_forward = 1
Wireless Hotspot active
parthdave@ubuntu:~$ sudo ap-hotspot start
Another process is already running
please solve this problem…
Perfect! Got it working on Xubuntu 12.04 with a few additional easy steps.
After a successfull install, when trying to connect Android phone and tablet to the hotspot they were just stuck at optaining IP address.
The following steps fixed that:
1) Run in a terminal: sudo ap-hotspot debug
– I got a message in the last line:
“Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for 127.0.0.1: …..fail!”
2) The solution is here where you have to make a simple change to NetworkManager.conf: http://ubuntuforums.org/showthread.php?t=1968155&page=4&p=11923702#post11923702
Summary of the solution, quoted from the link:
Run this from a terminal:
sudo nano /etc/NetworkManager/NetworkManager.conf
Change the line that says:
dns=dnsmasq
To:
#dns=dnsmasq
Restart Network Manager:
sudo service network-manager restart
Verify /etc/resolv.conf does not say: nameserver 127.0.0.1
cat /etc/resolv.conf
3) sudo ap-hotspot stop
4) sudo ap-hotspot debug
– Now it should say:
“Restarting DNS forwarder and DHCP server dnsmasq
…done.”
And now the Android phone and tablet can obtain IP addresses and it’s quite fast!
The Xubuntu is running on an Acer Aspire One AO751h.
Android version 4.4.2 on LG L70 phone and Nexus tablet.
in Ubuntu 12.04 LTS you knwow if works? I have android 4.0 and say: “obtaining ip adress..” Help me please
Thanks agli. It worked for me. Guys don’t look for the internet connection symbol. In my case intetnet is connecte, but on internet connection symbol it is showing as it’s not connected.
Worked for me too. thanks.
Saved Me :)
Thanks Agli !
This was precisely the problem I was facing. In spite of the setting the Android device failed to obtain a valid IP address. Now after commenting the dnsmasq I am able to connect 12.04 to my android device. Thank you very much,
Tell me how to complete authentication of password while connecting from android.
Hi Ji M
Im using Dell Vostro 1450 series laptop with Ubuntu 12.04.
I have installed ap-hotspot by referring this article but it ends up with following message after i run this cmd – sudo ap-hotspot configure.
i would like to inform you that the issue with faulty hostapd has probably been fixed now as i did not encounter any problems setting up my wifi hotspot. ap-hotspot works perfectly and even better than mhotspot in windows.
Thanks a lot. Where other methods failed, this one worked.
thanks it’s also working on linux 17
Works great for ubuntu 14.04…. I can able to access the net from my android phone…. Thanks man….
i m using ubuntu 14.4 . 32 bit OS
when i tried exactly same,,
on terminal it displayed ..
nilesh@nilesh-HP-Compaq-6720s:/tmp$ sudo ap-hotspot start
sudo: ap-hotspot: command not found
run again sudo apt-get install tyhen try to configure
hi i have succesfuly installed the hotspot but to conect to my android its asking for a password? where can i find the password to connect my mobile to my laptop?
thank you
Wonderful. It worked like a magic on my linux mint – nexus5 combo :).
Many many thanks for this toturial,
It works with me and I’m able to access internet on android, Iphone, laptob (windows/ ubuntu) when I use WPA2 key or I keep it open.
However, when I I try using Wep key to connect I obtain only “saved” but unable to connect in all devices. can you explain plaese. how to fix it.
For me everything is okay till end but when I give sudo ap-hotspot start it doesnt start
It comes till Starting Wireless Hotspot in blue and doesnt proceed further…Can you help me please
When i start the application then it says
WiFi is disabled, please enable WiFi before running this script
when i stop the wifi then it says
WiFi is disabled, please enable WiFi before running this script
please suggest what to do ..please its urgent .. Thanks in advance .
Thanks a lot.
Finally it worked!
I have got Ubuntu12.04 and everything works fine…my handset even detects it but on connecting “Authenticating” keeps on repeating..
Thanks a lot to Agli for sharing the
solution for not obtaining an IP address
I am on ubuntu 12.04 and I obtained the ap-hotspot deb without adding any PPA.
Everything works fine
Thanks to Ji m too
i have followed all the steps thoroughly but after “sudo ap-hotspot configure” it says command not found
i tried ur method. all went ok but it keeps on saying starting wireless hotspot…….
but never starts… what should i do?
How to protect the hotspot with password.when password gives it is not getting.please give advice to solve it.
i am really thankful to u. I started using sony vaio with os ubantu yesterday and first search i made on google to find the solution to generate wifi . Fortunately, i found you and now i am writing this comment using my android phone connected through wifi , created by my laptop….. thanks again
I tried to create a hotspot on my laptop. When I entered the command
sudo ap-hotspot configure
I got the response that sudo: ap-hotspot: command not found
The process ended what should I do?
I am a new user of Ubuntu 14.04.
Thnq, I did everythng u said and it is working. But I need something else, now I need to get which and all devices are connected to my laptop through this hotspot. And need to send information to those devices as some kind of notification. Pls help me with this..
I’m using Ubuntu 13.10
This works on 14.04 without removing anything.
Just install hostapd as said above.
Connection problem while installing ap-hotspot : ‘404 not found’ something like that. What should i do?
how to create hotspot in ubuntu 15.04? these methods not working for me…
after installing INTERNET is connect but is not working in Ubuntu 12.04
Your instructions don”t work. I don’t know if it’s due to my laptop running Ubuntu 15.04 or if anything is outdated.
Could you write a guide for Ubuntu 15.04 ? Thanks a lot.
Not Found
The requested URL /ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb was not found on this server.
Apache/2.2.22 (Ubuntu) Server at archive.ubuntu.com Port 80
Hi Ji M,
I got the error message below, I am using ubuntu 14.04LTS 64bit.
HTTP request sent, awaiting response… 404 Not Found
2015-10-21 23:39:37 ERROR 404: Not Found.
iam using dell studio 1345 with wireless 1397 minicard iam unable to make access point with ap-hotspot
it shows “your wireless card doesnt support accesspoint mode.
kindly guide me to download latest drivers for the dell 1397 minicard.
thanks in advance.
hi, do we update for this settings. mine is not working but perfectly fine before the most recent update and upgrade of my system. thank you in advance.
after enter the above command in terminal
the following error shows in terminal
/tmp$ cd /tmp && wget “http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb” && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd
–2015-11-26 21:46:35– “http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb”
Resolving archive.ubuntu.com (archive.ubuntu.com)… 91.189.91.14, 91.189.88.149, 91.189.92.201, …
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.91.14|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2015-11-26 21:46:36 ERROR 404: Not Found.
Pls suggest me
My installation and configuration is finished. My android device showing my hotspot but when i enter password andl click to connect the process go running or running but not connecting. Please tell me what i do to resolve this problem?
will this work with ubuntu 13.10 -> iOS 9 iPad?
Deb url not found
64 bit:
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
32 bit:
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb
Yes, that’s all. Substituted “archive.ubuntu.com” by “old-realeases.ubuntu.com” and it worked. Thanks.
…but it doesn’t create the ap-hotspot app @ Ubuntu 15
Thanks dude.. it worked
I was looking for a good solution for easily creating a hotspot on ubuntu a few months back, but somehow I missed ap-hotspot. Other solutions proposed by the interwebz either didn’t work or were too complicated to handle quickly. Therefore I set out to write my own set of scripts to facilitate the process.
I would be happy if some of you were to check out my project at https://github.com/keysie/ubuntu-hotspot and let me know how it works for you.
Hello Sir, I already created ap-hotspot and can be used normally , but when the WI-FI connection tip password mistake . why ?
wget to the deb file is not reachable @ step 2: so stumbled for the working one which is down here.
http://launchpadlibrarian.net/158293980/hostapd_1.0-3ubuntu2.1_amd64.deb
Tested and working 100%. Thanks for the write up on this.
When use this command cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb && sudo dpkg -i hostapd*.deb && sudo apt-mark hold hostapd
I am getting following error
Connecting to archive.ubuntu.com (archive.ubuntu.com)|2001:67c:1560:8001::11|:443… failed: Network is unreachable
My ubuntu version is 14.04
This is what I get when i run the command for 32 bit on ubuntu 14.04
–2016-10-12 19:30:58– http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb
Resolving archive.ubuntu.com (archive.ubuntu.com)… 91.189.88.162, 91.189.88.152, 91.189.88.161, …
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.162|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2016-10-12 19:30:58 ERROR 404: Not Found.
http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb gives a 404. Please update the link with
http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb