1. Check your Wifi card
Check whether your wifi card support AccessPoint (AP) infrastructure mode
2. Install "hostapd"
The latest version was buggy when I'm writing this blog. So install the just before version and hold it's updation.
64 Bit
3. Install dnsmasq
4. Install ap-hotspot
Install ap-hotspot, it's a set of scripts that helps you to easily configure the hotspot settings.
Download the .deb file from the below links and double click to install.
Ubuntu 12.04 - Click to download
Ubuntu 12.10 - Click to download
Ubuntu 13.04 - Click to download
Ubuntu 13.10 - Click to download
Ubuntu 14.04 - Click to download
5. Configure WiFi hotspot
6. Start/Stop/Restart WiFi hotspot
7. Common Issues/Errors
Another process already running error
When you try to start the ap-hotspot it says 'Another process already running'
Hope this helps and saved your time...
Check whether your wifi card support AccessPoint (AP) infrastructure mode
iw listYour wifi card is good to go if the output shows something like
Supported interface modes: * -- * -- * AP * AP/VLAN * --AP means AccessPoint (AP) infrastructure mode.
2. Install "hostapd"
The latest version was buggy when I'm writing this blog. So install the just before version and hold it's updation.
64 Bit
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_2.1-0ubuntu1.2_amd64.deb sudo dpkg -i hostapd*.deb sudo apt-mark hold hostapd32 Bit
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_2.1-0ubuntu1.2_i386.deb sudo dpkg -i hostapd*.deb sudo apt-mark hold hostapd
3. Install dnsmasq
apt-get install dnsmasq
4. Install ap-hotspot
Install ap-hotspot, it's a set of scripts that helps you to easily configure the hotspot settings.
Download the .deb file from the below links and double click to install.
Ubuntu 12.04 - Click to download
Ubuntu 12.10 - Click to download
Ubuntu 13.04 - Click to download
Ubuntu 13.10 - Click to download
Ubuntu 14.04 - Click to download
5. Configure WiFi hotspot
sudo ap-hotspot configure
6. Start/Stop/Restart WiFi hotspot
sudo ap-hotspot start sudo ap-hotspot stop sudo ap-hotspot restart
7. Common Issues/Errors
Another process already running error
When you try to start the ap-hotspot it says 'Another process already running'
sudo ap-hotspot start Another process is already runningTo fix this issue remove hotspot.pid from /tmp
sudo rm /tmp/hotspot.pid sudo ap-hotspot start
Hope this helps and saved your time...
sudo ap-hotspot debug
ReplyDeleteStarting Wireless Hotspot...
* Stopping advanced IEEE 802.11 management hostapd
...done.
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)
insserv: warning: current start runlevel(s) (empty) of script `hostapd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `hostapd' overrides LSB defaults (0 1 6).
insserv: warning: current start runlevel(s) (empty) of script `dnsmasq' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `dnsmasq' overrides LSB defaults (0 1 6).
* Restarting DNS forwarder and DHCP server configuration syntax check
...fail!
net.ipv4.ip_forward = 1
Try to reinstall the dnsmasq, and make sure you installed the correct version of ap-hotspot. Please let me know if the issues persist...
Deleteits stuck near 'obtaining ip address...'. What to do ?
ReplyDeleteI guess it's problem with the dnsmasq...try reinstalling it....
DeleteUhhhh ! Finally find something that really works !! :)
ReplyDeleteHappy that this post helped...!
DeleteHi, I got this working, but how do I now transfer files from my android phone running jelly bean to my laptop running ubuntu 14.04? I tried pinging from phone to laptop and from laptop to phone but the pings failed. They do seem to be connected to each other though...
ReplyDeleteTurn the USB sharing On, which will be promoted on the mobile device when plugged in. Then your mobile's internal storage will be mounted like a usb pendrive and you can transfer files.
DeleteThanks for this post. I always knew that it was possible to do this I just never needed to up until this trip I'm taking in a couple weeks.
ReplyDeleteHappy to hear that my post helped
DeleteI get this message :-
ReplyDeletesudo ap-hotspot configure
Your wireless card or driver does not support Access Point mode
my driver should support because output of
iw list |grep AP
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
and
lspci -k|grep -A 3 -i "network"
01:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
Subsystem: Intel Corporation PRO/Wireless 3945ABG Network Connection
Kernel driver in use: iwl3945
02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
Subsystem: Elitegroup Computer Systems Device 0090
Seems like your wifi card is not compatible for creating access points.
DeleteThanks Nikhil, this worked fine and saved the day.
ReplyDeleteMy 2 cents, I used the repo version of hostapd and ap-hotspot , and this worked for me.
Happy that my post helped..!!
Deleteok i conected with my android now how to share files between my ubuntu and adroid device
ReplyDeleteWell this tutorials describes how to setup a hotspot on your ubuntu machine, so that you can share the internet on laptop with your android device. This won't help to transfer files between laptop and mobile. For transferring files just connect your android device via usb cable to your laptop.
DeleteThank you very much...... iam very happy on this post
ReplyDeletesudo ap-hotspot start
ReplyDeletePlease disconnect WiFi before proceeding
i'm also getting same error wht to do?????
DeleteCheck if your wifi adapter is already connected to a network, If so disconnect it and follow the the steps
ReplyDeletethnx...its working
ReplyDeletethanks for the help
ReplyDeletehello!! in my lapy it is showing that ap-hotspot is running but i cant get it in my android mobile what can i do for this prlblm??
ReplyDeletewget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
ReplyDeleteNOT WORKING SERVER ERROR
PLS HELP
Hi Akhil,
DeleteThanks for pointing out.
I have updated the links, please check now.
anand@Anand-Lap:/tmp$ sudo ap-hotspot debug
ReplyDeleteStarting Wireless Hotspot...
* Stopping DNS forwarder and DHCP server dnsmasq
...done.
update-rc.d: warning: start runlevel arguments (none) do not match hostapd Default-Start values (2 3 4 5)
update-rc.d: warning: stop runlevel arguments (none) do not match hostapd 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/K80hostapd
/etc/rc3.d/K80hostapd
/etc/rc4.d/K80hostapd
/etc/rc5.d/K80hostapd
/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: start runlevel arguments (none) do not match dnsmasq Default-Start values (2 3 4 5)
update-rc.d: warning: stop runlevel arguments (none) do not match dnsmasq 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/K85dnsmasq
/etc/rc3.d/K85dnsmasq
/etc/rc4.d/K85dnsmasq
/etc/rc5.d/K85dnsmasq
/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
...done.
net.ipv4.ip_forward = 1
Try the two commands before ap-hotspot
Deletesudo nmcli nm wifi off
sudo rfkill unblock wlan