https://wiki.archlinux.org/api.php?action=feedcontributions&user=LiamMayfair&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:23:16ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Redshift&diff=538643Redshift2018-08-29T22:26:36Z<p>LiamMayfair: Add note about Redshift package patched to support Wayland in the AUR</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Graphics]]<br />
[[Category:Eye candy]]<br />
[[ja:Redshift]]<br />
[[ru:Redshift]]<br />
From the [http://jonls.dk/redshift/ Redshift project web page]:<br />
<br />
:[[Wikipedia:Redshift (software)|Redshift]] adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. This program is inspired by [http://justgetflux.com f.lux].<br />
<br />
{{Note| <br />
* Redshift does not support [[Wayland]] since it offers no way to adjust the color temperature [https://github.com/jonls/redshift/issues/55]. However, there is a patched version available in the AUR: {{AUR|redshift-wayland-git}}<br />
* [[GNOME]] provides features like Redshift out-of-the-box and has [[Wayland]] support. Enable the Night Light in Display settings.<br />
}}<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|redshift}} package. Alternatively, install the {{AUR|redshift-minimal}} package, for a version with minimal dependencies.<br />
<br />
=== Front ends ===<br />
<br />
The ''redshift-gtk'' command comes with the {{Pkg|redshift}} package and provides a system tray icon for controlling Redshift. See optional dependencies.<br />
<br />
Alternatives are {{AUR|redshiftgui-bin}} (GTK) and {{AUR|redshift-qt}}, {{AUR|redshiftconf}} or {{Pkg|plasma5-applets-redshift-control}} and {{AUR|plasma5-applets-redshift-control-git}} (Qt).<br />
<br />
== Configuration ==<br />
<br />
Redshift will at least need your location to start (unless {{ic|-O}} is used), meaning the latitude and longitude of your location. Redshift employs several routines for obtaining your location. If none of them works (e.g. none of the used helper programs is installed), you need to enter your location manually.<br />
<br />
Redshift reads the configuration file {{ic|~/.config/redshift/redshift.conf}}, if it exists. However, Redshift does not create that configuration file, so you may want to create it manually. See [https://raw.githubusercontent.com/jonls/redshift/master/redshift.conf.sample redshift.conf.sample].<br />
<br />
{{note|There seems to be a bug in Redshift that causes the transition option in the configuration file to not work as described: Instead of handling the transition between day and night it '''only''' changes the transition between application start-up and shutdown (and delay the latter as a consequence). See the [[talk:redshift#Day and night transition|talk page]] and the [https://github.com/jonls/redshift/issues/270 issue on the Redshift project page] for more information.}}<br />
<br />
=== Quick start ===<br />
<br />
To just get it up and running with a basic setup, issue:<br />
<br />
$ redshift -l ''LATITUDE'':''LONGITUDE''<br />
<br />
where ''LATITUDE'' is the latitude and ''LONGITUDE'' is the longitude of your location.<br />
<br />
{{Tip|You can get the coordinates of a place with [http://www.geonames.org/ GeoNames.org].}}<br />
<br />
To instantly adjusts the color temperature of your screen use:<br />
<br />
$ redshift -O ''TEMPERATURE''<br />
<br />
where ''TEMPERATURE'' is the desired color temperature (between {{ic|1000}} and {{ic|25000}}).<br />
<br />
=== Autostart ===<br />
<br />
There are several options to have redshift automatically started:<br />
<br />
* By using a [[systemd]] [[Systemd#Using units|user unit]]. Two services are provided: {{ic|redshift.service}} or {{ic|redshift-gtk.service}}. Activate only one of them depending on whether or not you want the system tray icon.<br />
* By adding a shell script with the contents {{ic|redshift &> /dev/null &}} in {{ic|/etc/X11/xinit/xinitrc.d/}}, and then make it executable with {{ic|chmod +x script_name.sh}}.<br />
* By adding {{ic|pgrep redshift &> /dev/null {{!}}{{!}} redshift &> /dev/null &}} to {{ic|~/.xinitrc}} if you are using {{ic|startx}}<br />
* By right-clicking the system tray icon when Redshift-GTK or plasma5-applets-redshift-control is already launched and selecting 'Autostart'.<br />
* By using your preferred window manager or desktop environment's autostart methods. For example in i3, the following line could be added to the config file: {{ic|exec --no-startup-id redshift-gtk}}. On other desktop environments, [[Desktop entries]] inside {{Ic|~/.config/autostart}} can be used.<br />
<br />
{{Note|The Redshift services files contains {{ic|1=Restart=always}} so the service will restart infinitely (see {{man|5|systemd.service}}).}}<br />
<br />
=== Automatic location based on GeoClue2 ===<br />
<br />
In order to allow access Redshift to use GeoClue2, add the following lines to {{ic|/etc/geoclue/geoclue.conf}}:<br />
<br />
{{hc|/etc/geoclue/geoclue.conf|2=<br />
[redshift]<br />
allowed=true<br />
system=false<br />
users=<br />
}}<br />
<br />
[[Restart]] {{ic|redshift.service}} and/or any other Redshift instance to apply the chances.<br />
<br />
{{Note|<br />
* If using [[GNOME]], also toggle Location Services to "On" in ''Settings > Privacy''.<br />
* Due possible bugs with geoclue2 and Redshift [https://github.com/jonls/redshift/issues/318], it may be required to use the {{ic|manual}} location-provider instead, e.g. for Paris:<br />
<br />
{{hc|~/.config/redshift/redshift.conf|2=<br />
[redshift]<br />
...<br />
; Set the location-provider: 'geoclue2', 'manual'<br />
; type 'redshift -l list' to see possible values.<br />
; The location provider settings are in a different section.<br />
location-provider=manual<br />
<br />
...<br />
<br />
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)<br />
; are negative numbers.<br />
[manual]<br />
lat=48.853<br />
lon=2.349<br />
}}<br />
<br />
* If using [[i3wm]] or similar, you will also need to enable the geoclue agent on startup. As well as {{ic|systemctl --user enable redshift-gtk}} or {{ic|redshift}} user service.<br />
<br />
{{hc|~/.i3/config|2=<br />
...<br />
exec --no-startup-id /usr/lib/geoclue-2.0/demos/agent<br />
...}}<br />
}}<br />
<br />
=== Automatic location based on GPS ===<br />
<br />
You can also use {{Pkg|gpsd}} to automatically determine your [[GPS]] location and use it as an input for Redshift. Create the following script and pass {{ic|$lat}} and {{ic|$lon}} to {{ic|redshift -l $lat;$lon}}:<br />
<br />
#!/bin/bash<br />
date<br />
#gpsdata=$( gpspipe -w -n 10 | grep -m 1 lon )<br />
gpsdata=$( gpspipe -w | grep -m 1 TPV )<br />
lat=$( echo "$gpsdata" | jsawk 'return this.lat' )<br />
lon=$( echo "$gpsdata" | jsawk 'return this.lon' )<br />
alt=$( echo "$gpsdata" | jsawk 'return this.alt' )<br />
dt=$( echo "$gpsdata" | jsawk 'return this.time' )<br />
echo "$dt"<br />
echo "You are here: $lat, $lon at $alt"<br />
<br />
For more information, see [https://bbs.archlinux.org/viewtopic.php?pid=1389735#p1389735 this] forums thread.<br />
<br />
=== Use real screen brightness ===<br />
<br />
Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen. [http://jonls.dk/redshift/#known-bugs-and-limitations]<br />
<br />
Changing screen backlight is possible with redshift hooks and {{pkg|xorg-xrandr}} and {{pkg|xorg-xbacklight}} but, please see [[Backlight#xbacklight]] as there are some limitations and you may have to find another method of controlling the backlight depending on your hardware.<br />
<br />
You need to create a file in {{ic|~/.config/redshift/hooks}} and make it executable. You can use and edit the following example:<br />
<br />
$ mkdir -p ~/.config/redshift/hooks<br />
<br />
Create and adjust the following script:<br />
<br />
{{hc|~/.config/redshift/hooks/brightness.sh|output=<br />
#!/bin/sh<br />
<br />
# Set brightness via xbrightness when redshift status changes<br />
<br />
# Set brightness values for each status.<br />
# Range from 1 to 100 is valid<br />
brightness_day="100"<br />
brightness_transition="50"<br />
brightness_night="10"<br />
# Set fade time for changes to one minute<br />
fade_time=60000<br />
<br />
case $1 in<br />
period-changed)<br />
case $3 in<br />
night)<br />
xbacklight -set $brightness_night -time $fade_time<br />
;;<br />
transition)<br />
xbacklight -set $brightness_transition -time $fade_time<br />
;;<br />
daytime)<br />
xbacklight -set $brightness_day -time $fade_time<br />
;;<br />
esac<br />
;;<br />
esac<br />
}}<br />
<br />
Make it [[executable]]:<br />
<br />
$ chmod +x ~/.config/redshift/hooks/brightness.sh<br />
<br />
[[Restart]] the {{ic|redshift.service}} to apply changes.<br />
<br />
Check the service status as it should '''not''' contain the following message:<br />
<br />
redshift[..]: No outputs have backlight property<br />
<br />
== Troubleshooting ==<br />
<br />
=== Screen 1 could not be found ===<br />
<br />
Locate configuration-file "redshift.conf" in your distribution and change "screen 1" to "screen 0".<br />
<br />
=== Left/right clicking the tray icon does not work ===<br />
<br />
Install {{Pkg|libappindicator-gtk3}}. See [https://github.com/jonls/redshift/issues/363 redshift issue 363] and {{Bug|49971}}.<br />
<br />
=== Redshift makes the screen quickly flicker between the set color value of the screen and the default color value ===<br />
<br />
Make sure there are not multiple instances of redshift running.<br />
<br />
=== Redshift works fine when invoked as a command but fails when run as a systemd service ===<br />
<br />
The [[systemd]] unit has a line in the {{ic|redshift.service}} file that makes the service wait until the {{ic|display-manager.service}} unit is started by a [[display manager]] before the unit will invoke {{ic|redshift}}. If you do not use a display manager, [[edit]] the {{ic|redshift.service}} user service and delete the {{ic|1=After=display-manager.service}} line. Run {{ic|systemctl --user daemon-reload}} and the service should initialize properly.<br />
<br />
=== Redshift temporarily resets using some wine apps that reset gamma values ===<br />
<br />
If you notice that using some wine apps, redshift seems to reset temporarily upon launch, or adjusting settings, or etc, then there is a useful registry key that seems to alleviate this. See [https://www.winehq.org/pipermail/wine-bugs/2015-January/403770.html] and [https://wiki.winehq.org/UsefulRegistryKeys]. Set or create the string value<br />
<br />
{{hc|HKEY_CURRENT_USER\Software\Wine\X11 Driver|2=<br />
UseXVidMode="N"<br />
}}<br />
<br />
using the registry editor, or import/set it otherwise.<br />
<br />
=== Redshift GDBus.Error:org.freedesktop.DBus.Error.AccessDenied on start ===<br />
<br />
If running {{ic|$ redshift}} and you are getting:<br />
<br />
{{hc|$ redshift|<br />
Trying location provider `geoclue2'...<br />
Using provider `geoclue2'.<br />
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.<br />
Unable to connect to GeoClue.<br />
Unable to get location from provider.or {{ic|$redshift-gtk}} and are getting the following error:<br />
}}<br />
<br />
or running {{ic|$ redshift-gtk}} and getting the similar error:<br />
<br />
{{hc|$ redshift-gtk|<br />
Failed to run Redshift<br />
Trying location provider `geoclue2'...<br />
Unable to start GeoClue client:<br />
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:<br />
'redshift' disallowed, no agent for UID 1000.<br />
Unable to connect to GeoClue.<br />
Unable to get location from provider.<br />
}}<br />
<br />
You can create a [[systemd]] unit file in {{ic|~/.config/systemd/user/geoclue-agent.service}} with the following config:<br />
<br />
{{hc|~/.config/systemd/user/geoclue-agent.service|2=<br />
[Unit]<br />
Description=redshift needs to get a (geo)clue<br />
<br />
[Service]<br />
ExecStart=/usr/lib/geoclue-2.0/demos/agent<br />
<br />
[Install]<br />
WantedBy=default.target<br />
}}<br />
<br />
Start and enable the service with systemctl: {{ic|$ systemctl --user enable --now geoclue-agent.service}} and try running redshift again.<br />
<br />
== See also ==<br />
<br />
* [http://jonls.dk/redshift Redshift website]<br />
* [http://github.com/jonls/redshift Redshift on github]<br />
* {{App|sct|set color temperature|http://www.tedunangst.com/flak/post/sct-set-color-temperature|{{AUR|sct}}}}<br />
* {{AUR|xflux-gui-git}}<br />
* [[Wikipedia:Redshift_(software)]]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=GPGPU&diff=480004GPGPU2017-06-17T15:59:24Z<p>LiamMayfair: Add ccminer to list of CUDA software</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Graphics]]<br />
[[ja:GPGPU]]<br />
{{Related articles start}}<br />
{{Related|Catalyst}}<br />
{{Related|Nvidia}}<br />
{{Related|Hardware video acceleration}}<br />
{{Related articles end}}<br />
<br />
GPGPU stands for [[Wikipedia:GPGPU|General-purpose computing on graphics processing units]].<br />
In Linux, there are currently two major GPGPU frameworks: [[Wikipedia:OpenCL|OpenCL]] and [[Wikipedia:CUDA|CUDA]]<br />
<br />
==OpenCL==<br />
<br />
OpenCL (Open Computing Language) is an open, royalty-free parallel programming specification developed by the Khronos Group, a non-profit consortium.<br />
<br />
The OpenCL specification describes a programming language, a general environment that is required to be present, and a C API to enable programmers to call into this environment.<br />
<br />
===OpenCL Runtime===<br />
To '''execute''' programs that use OpenCL, a compatible hardware runtime needs to be installed.<br />
<br />
====AMD/ATI====<br />
* {{Pkg|opencl-mesa}}: free runtime for [[AMDGPU]] and [[Radeon]]<br />
* {{AUR|opencl-amd}}: proprietary standalone runtime for [[AMDGPU]]<br />
* {{AUR|amdgpu-pro-opencl}}: proprietary runtime for [[AMDGPU PRO]]<br />
* {{AUR|opencl-catalyst}}: AMD proprietary runtime, soon to be deprecated in favor of [[AMDGPU]]<br />
* {{AUR|amdapp-sdk}}: AMD CPU runtime<br />
<br />
====NVIDIA====<br />
* {{Pkg|opencl-nvidia}}: official [[NVIDIA]] runtime<br />
<br />
====Intel====<br />
* {{AUR|intel-opencl-runtime}}: official Intel CPU runtime, also supports non-Intel CPUs<br />
* {{pkg|beignet}}: open-source implementation for Intel IvyBridge+ iGPUs<br />
<br />
====Others====<br />
* {{AUR|pocl}}: LLVM-based OpenCL implementation<br />
<br />
===OpenCL ICD loader (libOpenCL.so)===<br />
<br />
The OpenCL ICD loader is supposed to be a platform-agnostic library that provides the means to load device-specific drivers through the OpenCL API.<br />
Most OpenCL vendors provide their own implementation of an OpenCL ICD loader, and these should all work with the other vendors' OpenCL implementations.<br />
Unfortunately, most vendors do not provide completely up-to-date ICD loaders, and therefore Arch Linux has decided to provide this library from a separate project ({{Pkg|ocl-icd}}) which currently provides a functioning implementation of the current OpenCL API.<br />
<br />
The other ICD loader libraries are installed as part of each vendor's SDK. If you want to ensure the ICD loader from the {{Pkg|ocl-icd}} package is used, you can create a file in {{ic|/etc/ld.so.conf.d}} which adds {{ic|/usr/lib}} to the dynamic program loader's search directories:<br />
<br />
{{hc|/etc/ld.so.conf.d/00-usrlib.conf|2=<nowiki><br />
/usr/lib</nowiki>}}<br />
<br />
This is necessary because all the SDKs add their runtime's lib directories to the search path through {{ic|ld.so.conf.d}} files.<br />
<br />
The available packages containing various OpenCL ICDs are:<br />
* {{Pkg|ocl-icd}}: recommended, most up-to-date<br />
* {{AUR|libopencl}} by AMD. Provides OpenCL 2.0. It is distributed by AMD under a restrictive license and therefore cannot be included into the official repositories.<br />
* {{AUR|intel-opencl}} by Intel. Provides OpenCL 2.0.<br />
<br />
{{Note|ICD Loader's vendor is mentioned only to identify each loader, it is otherwise completely irrelevant. ICD loaders are vendor-agnostic and may be used interchangeably (as long as they are implemented correctly).}}<br />
<br />
===OpenCL Development===<br />
For OpenCL '''development''', the bare minimum additional packages required, are:<br />
* {{Pkg|ocl-icd}}: OpenCL ICD loader implementation, up to date with the latest OpenCL specification.<br />
* {{Pkg|opencl-headers}}: OpenCL C/C++ API headers.<br />
<br />
The vendors' SDKs provide a multitude of tools and support libraries:<br />
* {{AUR|intel-opencl-sdk}}: [http://software.intel.com/en-us/articles/opencl-sdk/ Intel OpenCL SDK] (old version, new OpenCL SDKs are included in the INDE and Intel Media Server Studio)<br />
* {{AUR|amdapp-sdk}}: This package is installed as {{ic|/opt/AMDAPP}} and apart from SDK files it also contains a number of code samples ({{ic|/opt/AMDAPP/SDK/samples/}}). It also provides the {{ic|clinfo}} utility which lists OpenCL platforms and devices present in the system and displays detailed information about them. As [http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx AMD APP SDK] itself contains CPU OpenCL driver, no extra driver is needed to execute OpenCL on CPU devices (regardless of its vendor). GPU OpenCL drivers are provided by the {{AUR|catalyst}} package (an optional dependency).<br />
* {{Pkg|cuda}}: Nvidia's GPU SDK which includes support for OpenCL 1.1.<br />
<br />
===Implementations===<br />
To see which OpenCL implementations are currently active on your system, use the following command:<br />
$ ls /etc/OpenCL/vendors<br />
<br />
====Language bindings====<br />
* '''JavaScript/HTML5''': [http://www.khronos.org/webcl/ WebCL]<br />
* '''[[Python]]''': {{pkg|python-pyopencl}}<br />
* '''[[D]]''': [https://bitbucket.org/trass3r/cl4d/wiki/Home cl4d]<br />
* '''[[Haskell]]''': OpenCLRaw: {{AUR|haskell-openclraw-git}}{{Broken package link|{{aur-mirror|haskell-openclraw-git}}}}<br />
* '''[[Java]]''': [http://jogamp.org/jocl/www/ JOCL] (a part of [http://jogamp.org/ JogAmp])<br />
* '''[[Mono|Mono/.NET]]''': [http://sourceforge.net/projects/opentk/ Open Toolkit]<br />
* '''[[Go]]''': [https://github.com/samuel/go-opencl OpenCL bindings for Go]<br />
* '''Racket''': Racket has a native interface [http://planet.racket-lang.org/display.ss?owner=jaymccarthy&package=opencl.plt on PLaneT] that can be installed via raco.<br />
<br />
==CUDA==<br />
<br />
CUDA (Compute Unified Device Architecture) is [[NVIDIA]]'s proprietary, closed-source parallel computing architecture and framework. It requires a Nvidia GPU. It consists of several components:<br />
* required:<br />
** proprietary Nvidia kernel module<br />
** CUDA "driver" and "runtime" libraries<br />
* optional:<br />
** additional libraries: CUBLAS, CUFFT, CUSPARSE, etc.<br />
** CUDA toolkit, including the {{ic|nvcc}} compiler<br />
** CUDA SDK, which contains many code samples and examples of CUDA and OpenCL programs<br />
<br />
The kernel module and CUDA "driver" library are shipped in {{Pkg|nvidia}} and {{Pkg|opencl-nvidia}}. The "runtime" library and the rest of the CUDA toolkit are available in {{Pkg|cuda}}. The library is available [https://projects.archlinux.org/svntogit/community.git/commit/trunk?h=packages/cuda&id=1b62c8bcb9194b2de1b750bd62a8dce1e7e549f5 only in 64-bit version]. {{ic|cuda-gdb}} needs {{aur|ncurses5-compat-libs}} to be installed, see {{Bug|46598}}.<br />
<br />
===Development===<br />
<br />
The {{Pkg|cuda}} package installs all components in the directory {{ic|/opt/cuda}}. For compiling CUDA code, add {{ic|/opt/cuda/include}} to your include path in the compiler instructions. For example this can be accomplished by adding {{ic|-I/opt/cuda/include}} to the compiler flags/options. To use {{ic|nvcc}}, a {{ic|gcc}} wrapper provided by NVIDIA, just add {{ic|/opt/cuda/bin}} to your path.<br />
<br />
To find whether the installation was successful and if cuda is up and running, you can compile the samples installed on {{ic|/opt/cuda/samples}} (you can simply run {{ic|make}} inside the directory, altough is a good practice to copy the {{ic|/opt/cuda/samples}} directory to your home directory before compiling) and running the compiled examples. A nice way to check the installation is to run one of the examples, called {{ic|deviceQuery}}.<br />
<br />
{{Note|CUDA 8.0 is not compatible with GCC 6 (see {{Bug|49272}}). Therefore the {{Pkg|cuda}} package depends on {{Pkg|gcc5}} and creates symbolic links in {{ic|/opt/cuda/bin/}} for the older version to be picked up by {{ic|nvcc}}. You might also need to configure your build system to use the same GCC version for compiling host code.}}<br />
<br />
===Language bindings===<br />
* '''Fortran''': [http://www.pgroup.com/resources/cudafortran.htm PGI CUDA Fortran Compiler]<br />
* '''[[Haskell]]''': The [http://hackage.haskell.org/package/accelerate accelerate package] lists available CUDA backends <br />
* '''[[Java]]''': [http://www.jcuda.org/jcuda/JCuda.html JCuda]<br />
* '''[[Mathematica]]''': [http://reference.wolfram.com/mathematica/CUDALink/tutorial/Overview.html CUDAlink]<br />
* '''[[Mono|Mono/.NET]]''': [http://www.hoopoe-cloud.com/Solutions/CUDA.NET/Default.aspx CUDA.NET], [http://www.hybriddsp.com/ CUDAfy.NET]<br />
* '''Perl''': [http://psilambda.com/download/kappa-for-perl Kappa], [https://github.com/run4flat/perl-CUDA-Minimal CUDA-Minimal]<br />
* '''[[Python]]''': {{pkg|python-pycuda}} or [http://psilambda.com/download/kappa-for-python Kappa]<br />
* '''[[Ruby]]''', '''Lua''': [http://psilambda.com/products/kappa/ Kappa]<br />
<br />
===Driver issues===<br />
<br />
It might be necessary to use the legacy driver {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} to resolve permissions issues when running CUDA programs on systems with multiple GPUs.<br />
<br />
==List of OpenCL and CUDA accelerated software==<br />
{{Expansion|More application may support OpenCL.}}<br />
* [[Bitcoin]]<br />
* [[HandBrake]]<br />
* [[GIMP]] (experimental - see [http://www.h-online.com/open/news/item/GIMP-2-8-RC-1-arrives-with-GPU-acceleration-1518417.html])<br />
* {{Pkg|opencv}}<br />
* {{Pkg|pyrit}}<br />
* {{Pkg|darktable}} - OpenCL feature requires at least 1 GB RAM on GPU and ''Image support'' (check output of clinfo command).<br />
* {{Pkg|aircrack-ng}}<br />
* {{AUR|cuda_memtest}} - a GPU memtest. Despite its name, is supports both CUDA and OpenCL<br />
* [[Blender]] - CUDA support for Nvidia GPUs and OpenCL support for AMD GPUs. More information [http://blender.org/manual/render/cycles/features.html#features here].<br />
* [[BOINC]]<br />
* [https://github.com/tpruvot/ccminer/tree/linux ccminer]<br />
<br />
==Links and references==<br />
* [http://www.khronos.org/opencl/ OpenCL official homepage]<br />
* [http://www.nvidia.com/object/cuda_home_new.html CUDA official homepage]<br />
* [http://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt The ICD extension specification]<br />
* [http://developer.amd.com/appsdk AMD APP SDK homepage]<br />
* [https://developer.nvidia.com/cuda-toolkit CUDA Toolkit homepage]<br />
* [https://software.intel.com/en-us/intel-opencl Intel SDK for OpenCL Applications homepage]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454617Lenovo ThinkPad T460p2016-10-20T19:47:58Z<p>LiamMayfair: Reworded overview</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop with very good Linux support out of the box.<br />
<br />
== Firmware ==<br />
<br />
It is recommended that you peruse all the available options and features in the BIOS as there are many of them and in some cases you will get unexpected behaviours, e.g. swapping the Fn and Ctrl keys, enabling topmost keyboard row F1-F12 functionality as the default, etc. To access the BIOS, press ENTER key on boot-up. Enable Diagnostics mode bootup instead of Quick mode to make it easier to enter the BIOS.<br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS [https://github.com/rhinstaller/shim/issues/55 is unable to complete the signing process], thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454616Lenovo ThinkPad T460p2016-10-20T19:44:28Z<p>LiamMayfair: /* Installation */ Renamed Installation section to Firmware</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop and Linux support is very good.<br />
<br />
== Firmware ==<br />
<br />
It is recommended that you peruse all the available options and features in the BIOS as there are many of them and in some cases you will get unexpected behaviours, e.g. swapping the Fn and Ctrl keys, enabling topmost keyboard row F1-F12 functionality as the default, etc. To access the BIOS, press ENTER key on boot-up. Enable Diagnostics mode bootup instead of Quick mode to make it easier to enter the BIOS.<br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS [https://github.com/rhinstaller/shim/issues/55 is unable to complete the signing process], thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454615Lenovo ThinkPad T460p2016-10-20T19:43:42Z<p>LiamMayfair: Added installation section</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop and Linux support is very good.<br />
<br />
== Installation ==<br />
<br />
It is recommended that you peruse all the available options and features in the BIOS as there are many of them and in some cases you will get unexpected behaviours, e.g. swapping the Fn and Ctrl keys, enabling topmost keyboard row F1-F12 functionality as the default, etc. To access the BIOS, press ENTER key on boot-up. Enable Diagnostics mode bootup instead of Quick mode to make it easier to enter the BIOS. <br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS [https://github.com/rhinstaller/shim/issues/55 is unable to complete the signing process], thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454614Lenovo ThinkPad T460p2016-10-20T19:38:03Z<p>LiamMayfair: /* Overview */ Reword</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop and Linux support is very good.<br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS [https://github.com/rhinstaller/shim/issues/55 is unable to complete the signing process], thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Talk:Lenovo_ThinkPad_T460p&diff=454613Talk:Lenovo ThinkPad T460p2016-10-20T19:36:06Z<p>LiamMayfair: Added reasons why no hardware support info was added</p>
<hr />
<div>== Why I didn't provide a hardware component working status breakdown ==<br />
<br />
I am running Fedora 24 in this laptop at the time of creating this article so I didn't want to provide any specific support information as it wouldn't be relevant to Arch Linux so I tried to make the article as distro-agnostic as possible. It'd be great for someone else to provide a hardware support status table as usual, for instance.<br />
<br />
[[User:LiamMayfair|LiamMayfair]] ([[User talk:LiamMayfair|talk]]) 19:35, 20 October 2016 (UTC)</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454612Lenovo ThinkPad T460p2016-10-20T19:27:42Z<p>LiamMayfair: /* Failure to load 3rd party kernel modules */ Added source link for BIOS inability to complete signing process</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop and installing Linux in it is rather straightforward.<br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS [https://github.com/rhinstaller/shim/issues/55 is unable to complete the signing process], thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T460p&diff=454610Lenovo ThinkPad T460p2016-10-20T19:25:05Z<p>LiamMayfair: Created article including overview, hardware information and troubleshooting sections.</p>
<hr />
<div>[[Category:Lenovo]]<br />
<br />
==Overview==<br />
<br />
The '''Lenovo ThinkPad T460p''' is a high-performance laptop and installing Linux in it is rather straightforward.<br />
<br />
== Hardware information ==<br />
<br />
The output of ''lspci'' is<br />
<br />
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)<br />
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)<br />
00:01.2 PCI bridge: Intel Corporation Skylake PCIe Controller (x4) (rev 07)<br />
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)<br />
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)<br />
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)<br />
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)<br />
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)<br />
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)<br />
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br />
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)<br />
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)<br />
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)<br />
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)<br />
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)<br />
02:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<br />
03:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)<br />
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)<br />
<br />
The output of ''lsusb'' is<br />
<br />
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader<br />
Bus 001 Device 004: ID 8087:0a2b Intel Corp. <br />
Bus 001 Device 003: ID 138a:0090 Validity Sensors, Inc. <br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
== Troubleshooting ==<br />
<br />
== Failure to load 3rd party kernel modules ==<br />
<br />
In laptops with [[Secure Boot]] enabled, if you install a kernel module provided by a 3rd party or compiled by yourself, ''modprobe'' will not load it and will throw an error similar to this:<br />
<br />
modprobe: ERROR: could not insert 'vboxdrv': Required key not available<br />
<br />
Secure Boot will prevent this module from running until you provide a valid signature for it. Therefore, you can either [https://flavioprimo.xyz/linux/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ try to sign it yourself] or disable Secure Boot altogether. Unfortunately, the current Secure Boot firmware (v2.11 2016/09/26) installed in the ThinkPad T460 series BIOS is unable to complete the signing process, thus it is recommended to disable it in the BIOS configuration until this issue is resolved.<br />
<br />
See also: http://askubuntu.com/questions/802668/virtualbox-installation-gives-message-modprobe-vboxdrv-failed</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=414605Wpa supplicant2016-01-07T08:19:48Z<p>LiamMayfair: /* Password-related problems */</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[es:WPA supplicant]]<br />
[[it:WPA supplicant]]<br />
[[ja:WPA supplicant]]<br />
[[ru:WPA supplicant]]<br />
[[zh-cn:WPA supplicant]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
<br />
[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] is a cross-platform [[Wikipedia:Supplicant (computer)|supplicant]] with support for WEP, WPA and WPA2 ([[wikipedia:IEEE_802.11i|IEEE 802.11i]] / RSN (Robust Secure Network)). It is suitable for desktops, laptops and embedded systems.<br />
<br />
''wpa_supplicant'' is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wireless driver.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|wpa_supplicant}} package.<br />
<br />
Optionally also install {{Pkg|wpa_supplicant_gui}}, which provides ''wpa_gui'', a graphical front-end for ''wpa_supplicant''.<br />
<br />
== Overview ==<br />
<br />
The first step to connect to an encrypted wireless network is having ''wpa_supplicant'' obtain authentication from a WPA authenticator. In order to do this, ''wpa_supplicant'' must be configured so that it will be able to submit the correct credentials to the authenticator.<br />
<br />
Once the authentication is successful, it will be possible to connect to the network by normally obtaining an IP address by setting it manually with the [[Core utilities#ip|iproute2]] suite or using some networking program, like [[systemd-networkd]] or [[dhcpcd]], to configure an ''interface'' to obtain an IP address automatically via DHCP. See also the [[Wireless_network_configuration#Systemd_with_wpa_supplicant_and_static_IP|wireless]] and [[Network configuration#Configure the IP address|wired]] network configuration articles for methods and examples.<br />
<br />
== Connecting with wpa_cli ==<br />
<br />
This connection method allows scanning for the available networks, making use of ''wpa_cli'', a command line tool which can be used to interactively configure ''wpa_supplicant'' at runtime. See [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
In order to use ''wpa_cli'', a control interface must be specified for ''wpa_supplicant'', and it must be given the rights to update the configuration. Do this by creating a minimal configuration file:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<br />
ctrl_interface=/run/wpa_supplicant<br />
update_config=1<br />
}}<br />
<br />
Now start ''wpa_supplicant'' with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
{{Tip|To discover your wireless network interface name, issue the {{ic|ip link}} command.}}<br />
<br />
At this point run:<br />
<br />
# wpa_cli<br />
<br />
This will present an interactive prompt ({{ic|>}}), which has tab completion and descriptions of completed commands.<br />
<br />
{{Tip|The default location of the control socket is {{ic|/var/run/wpa_supplicant/}}, custom path can be set manually with the {{ic|-p}} option to match the ''wpa_supplicant'' configuration. It is also possible to specify the interface to be configured with the {{ic|-i}} option, otherwise the first found wireless interface managed by ''wpa_supplicant'' will be used.}}<br />
<br />
Use the {{ic|scan}} and {{ic|scan_results}} commands to see the available networks:<br />
<br />
> scan<br />
OK<br />
<3>CTRL-EVENT-SCAN-RESULTS<br />
> scan_results<br />
bssid / frequency / signal level / flags / ssid<br />
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID<br />
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID<br />
<br />
To associate with {{ic|MYSSID}}, add the network, set the credentials and enable it:<br />
<br />
> add_network<br />
0<br />
> set_network 0 ssid "MYSSID"<br />
> set_network 0 psk "passphrase"<br />
> enable_network 0<br />
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]<br />
<br />
If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command {{ic|set_network 0 psk "passphrase"}} with {{ic|set_network 0 key_mgmt NONE}}.<br />
<br />
{{Note|<br />
* Each network is indexed numerically, so the first network will have index 0.<br />
* The [[wikipedia:Pre-shared_key|PSK]] is computed from the ''quoted'' "passphrase" string, as also shown by the [[#Connecting with wpa_passphrase|wpa_passphrase]] command. Nonetheless, you can enter the PSK directly by passing it to {{ic|psk}} ''without'' quotes.}}<br />
<br />
Finally save this network in the configuration file:<br />
<br />
> save_config<br />
OK<br />
<br />
Once association is complete, all that is left to do is obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Connecting with wpa_passphrase ==<br />
<br />
This connection method allows quickly connecting to a network whose SSID is already known, making use of ''wpa_passphrase'', a command line tool which generates the minimal configuration needed by ''wpa_supplicant''. For example:<br />
<br />
{{hc|$ wpa_passphrase MYSSID passphrase|2=<br />
network={<br />
ssid="MYSSID"<br />
#psk="passphrase"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}<br />
}}<br />
<br />
This means that ''wpa_supplicant'' can be associated with ''wpa_passphrase'' and simply started with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c <(wpa_passphrase MYSSID passphrase)<br />
<br />
{{Note|Because of the process substitution, you '''cannot''' run this command with [[sudo]]: you will need a root shell, see also [[Help:Reading#Regular user or root]].}}<br />
<br />
{{Tip|<br />
* Use quotes, if the input contains spaces. For example: {{ic|"secret passphrase"}} <br />
* To discover your wireless network interface name, issue the {{ic|ip link}} command. <br />
* Some unusually complex passphrases may require input from a file, e.g. {{ic|wpa_passphrase MYSSID < passphrase.txt}}, or here strings, e.g. {{ic|wpa_passphrase MYSSID <<< "passphrase"}}.<br />
}}<br />
<br />
Finally, you should obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Advanced usage ==<br />
<br />
For networks of varying complexity, possibly employing extensive use of [[wikipedia:Extensible_Authentication_Protocol|EAP]], it will be useful to maintain a customised configuration file. For an overview of the configuration with examples, refer to [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]; for details on all the supported configuration parameters, refer to the example file {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
=== Configuration ===<br />
<br />
As is clear after reading [[#Connecting with wpa_passphrase]], a basic configuration file can be generated with:<br />
<br />
# wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf<br />
<br />
This will only create a {{ic|network}} section. A configuration file with some more common options may look like:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<nowiki><br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
fast_reauth=1<br />
ap_scan=1<br />
<br />
network={<br />
ssid="MYSSID"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}</nowiki><br />
}}<br />
<br />
The passphrase can alternatively be defined in clear text by enclosing it in quotes, if the resulting security problems are not of concern:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
psk="passphrase"<br />
}<br />
}}<br />
<br />
If the network does not have a passphrase, e.g. a public Wi-Fi:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
key_mgmt=NONE<br />
}<br />
}}<br />
<br />
Further {{ic|network}} blocks may be added manually, or using ''wpa_cli'' as illustrated in [[#Connecting with wpa_cli]]. In order to use ''wpa_cli'', a control interface must be set with the {{ic|ctrl_interface}} option. Setting {{ic|1=ctrl_interface_group=wheel}} allows users belonging to such group to execute ''wpa_cli''. Also add {{ic|1=update_config=1}} so that changes made with ''wpa_cli'' to {{ic|example.conf}} can be saved.<br />
<br />
{{ic|<nowiki>fast_reauth=1</nowiki>}} and {{ic|<nowiki>ap_scan=1</nowiki>}} are the ''wpa_supplicant'' options active globally at the time of writing. Whether you need them, or other global options too for that matter, depends on the type of network to connect to. If you need other global options, simply copy them over to the file from {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
Alternatively, {{ic|wpa_cli set}} can be used to see options' status or set new ones. Multiple network blocks may be appended to this configuration: the supplicant will handle association to and roaming between all of them. The strongest signal defined with a network block usually is connected to by default, one may define {{ic|priority<nowiki>=</nowiki>}} to influence behaviour. <br />
<br />
An advantage to be mentioned in using a customized configuration file at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is that it is used by default by [[dhcpcd]]. If you do so, you might want to make a backup of the original and delete the extensive network block examples in it. Otherwise, do not be surprised if your device suddenly connects to networks defined in them. In any case, changes to new versions of the configuration file should of course be [[Pacnew and Pacsave files|merged]].<br />
<br />
{{Tip|To configure a network block to a hidden wireless ''SSID'', which by definition will not turn up in a regular scan, the option {{ic|scan_ssid<nowiki>=</nowiki>1}} has to be defined in the network block.}}<br />
<br />
=== Connection ===<br />
<br />
==== Manual ====<br />
<br />
First start ''wpa_supplicant'' command, whose most commonly used arguments are:<br />
<br />
* {{ic|-B}} - Fork into background.<br />
* {{ic|-c ''filename''}} - Path to configuration file.<br />
* {{ic|-i ''interface''}} - Interface to listen on.<br />
* {{ic|-D ''driver''}} - Optionally specify the driver to be used. For a list of supported drivers see the output of {{ic|wpa_supplicant -h}}.<br />
** {{ic|nl80211}} is the current standard, but not all wireless chip's modules support it.<br />
** {{ic|wext}} is currently deprecated, but still widely supported.<br />
<br />
See [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)] for the full argument list. For example:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
followed by a method to obtain an ip address manually as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
==== At boot (systemd) ====<br />
<br />
The ''wpa_supplicant'' package provides multiple [[systemd]] service files:<br />
<br />
* {{ic|wpa_supplicant.service}} - uses [[D-Bus]], recommended for [[NetworkManager]] users.<br />
* {{ic|wpa_supplicant@.service}} - accepts the interface name as an argument and starts the ''wpa_supplicant'' daemon for this interface. It reads the configuration file in {{ic|/etc/wpa_supplicant/wpa_supplicant-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-nl80211@.service}} - also interface specific, but explicitly forces the {{ic|nl80211}} driver (see below). The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-nl80211-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-wired@.service}} - also interface specific, uses the {{ic|wired}} driver. The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-wired-''interface''.conf}}.<br />
<br />
To enable wireless at boot, enable one of the services above on a particular wireless interface. For example:<br />
<br />
# systemctl enable wpa_supplicant@''interface''<br />
<br />
Now choose and [[enable]] a service to obtain an ip address for the particular ''interface'' as indicated in the [[#Overview]], for example:<br />
<br />
# systemctl enable dhcpcd@''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
=== wpa_cli action script ===<br />
<br />
''wpa_cli'' can run in daemon mode and execute a specified script based on events from ''wpa_supplicant''. Two events are supported: {{ic|CONNECTED}} and {{ic|DISCONNECTED}}. Some [[environment variables]] are available to the script, see [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
The following example will use [[desktop notifications]] to notify the user about the events:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
case "$2" in<br />
CONNECTED)<br />
notify-send "WPA supplicant: connection established";<br />
;;<br />
DISCONNECTED)<br />
notify-send "WPA supplicant: connection lost";<br />
;;<br />
esac<br />
}}<br />
<br />
Remember to make the script executable, then use the {{ic|-a}} flag to pass the script path to ''wpa_cli'':<br />
<br />
$ wpa_cli -a ''/path/to/script''<br />
<br />
== Troubleshooting ==<br />
=== nl80211 driver not supported on some hardware ===<br />
<br />
On some (especially old) hardware, ''wpa_supplicant'' may fail with the following error:<br />
<br />
Successfully initialized wpa_supplicant<br />
nl80211: Driver does not support authentication/association or connect commands<br />
wlan0: Failed to initialize driver interface<br />
<br />
This indicates that the standard {{ic|nl80211}} driver does not support the given hardware. The deprecated {{ic|wext}} driver might still support the device:<br />
<br />
# wpa_supplicant -B -i wlan0 '''-D wext''' -c /etc/wpa_supplicant/example.conf<br />
<br />
If the command works to connect, and the user wishes to use [[systemd]] to manage the wireless connection, it is necessary to [[systemd#Editing provided units|edit]] the {{ic|wpa_supplicant@.service}} unit provided by the package and modify the {{ic|ExecStart}} line accordingly:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant@.service.d/wext.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I '''-Dwext'''<br />
}}<br />
<br />
=== Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015) ===<br />
When you use [[WPA supplicant]] (wlan) to connect to your network you might have the problem that the shutdown takes a very long time. That is because systemd runs against a 3 minute timeout. The reason is that WPA supplicant is shut down to early and you do not have the network online when systemd tries to unmount your share(-s). As a workaround (fix) you can add the following settings to the {{ic|wpa_supplicant.service}} file. This can be done by [[Systemd#Drop-in snippets]]. The result looks like this:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant.service.d/override.conf|<nowiki><br />
[Unit]<br />
After=dbus.service<br />
Before=network.target<br />
Wants=network.target<br />
</nowiki>}}<br />
<br />
See more about this bug here: https://github.com/systemd/systemd/issues/1435<br />
<br />
This bug is not fixed in version 2.3 of {{Pkg|wpa_supplicant}}. In version 2.5 they added {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} but still miss {{ic|<nowiki>After=dbus.service</nowiki>}}. So after an update to 2.5 you can remove the {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} from your {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}. After this bug has been fixed you can just remove {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}.<br />
<br />
=== Password-related problems ===<br />
<br />
{{Pkg|wpa_supplicant}} may not work properly if directly passed via stdin particularly long or complex passphrases which include special characters. This may lead to errors such as {{ic|failed 4-way WPA handshake, PSK may be wrong}} when launching {{Pkg|wpa_supplicant}}.<br />
<br />
In order to solve this try using here strings {{ic|wpa_passphrase <MYSSID> <<< "<passphrase>"}} or passing a file to the {{ic|-c}} flag instead:<br />
<br />
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf<br />
<br />
In some instances it was found that storing the passphrase cleartext in the {{ic|psk}} key of the {{ic|wpa_supplicant.conf}} {{ic|network}} block gave positive results (see [[http://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-4-way-handshake-failed-843394/]]). However, this approach is rather insecure. Using {{ic|wpa_cli}} to create this file instead of manually writing it gives the best results most of the time and therefore is the recommended way to proceed.<br />
<br />
=== Lots of possibly unrelated error messages appear when running wpa_supplicant ===<br />
<br />
If you're using a configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) to launch {{Pkg|wpa_supplicant}} and you're getting lots of different errors at once, you may be using the default template file, which contains many different sample {{ic|network}} blocks. If none of these are commented out or removed, {{Pkg|wpa_supplicant}} will attempt to read them all and consequentially fail. Make sure you only specify {{ic|network}} blocks for wireless access points you will actually associate with. Creating an empty {{ic|wpa_supplicant.conf}} file and filling it up with the output obtained from {{ic|wpa_passphrase}} or using {{ic|wpa_cli}} instead to handle this task should be enough.<br />
<br />
=== Failed to open config file ===<br />
<br />
If you get the following error when launching {{Pkg|wpa_supplicant}} you may need to create a valid {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. Running {{ic|wpa_cli}} or pasting the output of {{ic|wpa_passphrase}} into it should solve this issue.<br />
<br />
Successfully initialized wpa_supplicant<br />
Failed to open config file '/dev/fd/63', error: No such file or directory<br />
Failed to read or parse configuration '/dev/fd/63'.<br />
<br />
== See also ==<br />
<br />
* [http://hostap.epitest.fi/wpa_supplicant/ WPA Supplicant home]<br />
* [https://gist.github.com/buhman/7162560 wpa_cli usage examples]<br />
* [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)]<br />
* [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]<br />
* [http://linux.die.net/man/8/wpa_cli wpa_cli(8)]<br />
* [http://wireless.kernel.org/en/users/Documentation/wpa_supplicant Kernel.org wpa_supplicant documentation]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=414604Wpa supplicant2016-01-07T08:19:05Z<p>LiamMayfair: /* Failed to open config file */</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[es:WPA supplicant]]<br />
[[it:WPA supplicant]]<br />
[[ja:WPA supplicant]]<br />
[[ru:WPA supplicant]]<br />
[[zh-cn:WPA supplicant]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
<br />
[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] is a cross-platform [[Wikipedia:Supplicant (computer)|supplicant]] with support for WEP, WPA and WPA2 ([[wikipedia:IEEE_802.11i|IEEE 802.11i]] / RSN (Robust Secure Network)). It is suitable for desktops, laptops and embedded systems.<br />
<br />
''wpa_supplicant'' is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wireless driver.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|wpa_supplicant}} package.<br />
<br />
Optionally also install {{Pkg|wpa_supplicant_gui}}, which provides ''wpa_gui'', a graphical front-end for ''wpa_supplicant''.<br />
<br />
== Overview ==<br />
<br />
The first step to connect to an encrypted wireless network is having ''wpa_supplicant'' obtain authentication from a WPA authenticator. In order to do this, ''wpa_supplicant'' must be configured so that it will be able to submit the correct credentials to the authenticator.<br />
<br />
Once the authentication is successful, it will be possible to connect to the network by normally obtaining an IP address by setting it manually with the [[Core utilities#ip|iproute2]] suite or using some networking program, like [[systemd-networkd]] or [[dhcpcd]], to configure an ''interface'' to obtain an IP address automatically via DHCP. See also the [[Wireless_network_configuration#Systemd_with_wpa_supplicant_and_static_IP|wireless]] and [[Network configuration#Configure the IP address|wired]] network configuration articles for methods and examples.<br />
<br />
== Connecting with wpa_cli ==<br />
<br />
This connection method allows scanning for the available networks, making use of ''wpa_cli'', a command line tool which can be used to interactively configure ''wpa_supplicant'' at runtime. See [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
In order to use ''wpa_cli'', a control interface must be specified for ''wpa_supplicant'', and it must be given the rights to update the configuration. Do this by creating a minimal configuration file:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<br />
ctrl_interface=/run/wpa_supplicant<br />
update_config=1<br />
}}<br />
<br />
Now start ''wpa_supplicant'' with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
{{Tip|To discover your wireless network interface name, issue the {{ic|ip link}} command.}}<br />
<br />
At this point run:<br />
<br />
# wpa_cli<br />
<br />
This will present an interactive prompt ({{ic|>}}), which has tab completion and descriptions of completed commands.<br />
<br />
{{Tip|The default location of the control socket is {{ic|/var/run/wpa_supplicant/}}, custom path can be set manually with the {{ic|-p}} option to match the ''wpa_supplicant'' configuration. It is also possible to specify the interface to be configured with the {{ic|-i}} option, otherwise the first found wireless interface managed by ''wpa_supplicant'' will be used.}}<br />
<br />
Use the {{ic|scan}} and {{ic|scan_results}} commands to see the available networks:<br />
<br />
> scan<br />
OK<br />
<3>CTRL-EVENT-SCAN-RESULTS<br />
> scan_results<br />
bssid / frequency / signal level / flags / ssid<br />
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID<br />
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID<br />
<br />
To associate with {{ic|MYSSID}}, add the network, set the credentials and enable it:<br />
<br />
> add_network<br />
0<br />
> set_network 0 ssid "MYSSID"<br />
> set_network 0 psk "passphrase"<br />
> enable_network 0<br />
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]<br />
<br />
If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command {{ic|set_network 0 psk "passphrase"}} with {{ic|set_network 0 key_mgmt NONE}}.<br />
<br />
{{Note|<br />
* Each network is indexed numerically, so the first network will have index 0.<br />
* The [[wikipedia:Pre-shared_key|PSK]] is computed from the ''quoted'' "passphrase" string, as also shown by the [[#Connecting with wpa_passphrase|wpa_passphrase]] command. Nonetheless, you can enter the PSK directly by passing it to {{ic|psk}} ''without'' quotes.}}<br />
<br />
Finally save this network in the configuration file:<br />
<br />
> save_config<br />
OK<br />
<br />
Once association is complete, all that is left to do is obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Connecting with wpa_passphrase ==<br />
<br />
This connection method allows quickly connecting to a network whose SSID is already known, making use of ''wpa_passphrase'', a command line tool which generates the minimal configuration needed by ''wpa_supplicant''. For example:<br />
<br />
{{hc|$ wpa_passphrase MYSSID passphrase|2=<br />
network={<br />
ssid="MYSSID"<br />
#psk="passphrase"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}<br />
}}<br />
<br />
This means that ''wpa_supplicant'' can be associated with ''wpa_passphrase'' and simply started with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c <(wpa_passphrase MYSSID passphrase)<br />
<br />
{{Note|Because of the process substitution, you '''cannot''' run this command with [[sudo]]: you will need a root shell, see also [[Help:Reading#Regular user or root]].}}<br />
<br />
{{Tip|<br />
* Use quotes, if the input contains spaces. For example: {{ic|"secret passphrase"}} <br />
* To discover your wireless network interface name, issue the {{ic|ip link}} command. <br />
* Some unusually complex passphrases may require input from a file, e.g. {{ic|wpa_passphrase MYSSID < passphrase.txt}}, or here strings, e.g. {{ic|wpa_passphrase MYSSID <<< "passphrase"}}.<br />
}}<br />
<br />
Finally, you should obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Advanced usage ==<br />
<br />
For networks of varying complexity, possibly employing extensive use of [[wikipedia:Extensible_Authentication_Protocol|EAP]], it will be useful to maintain a customised configuration file. For an overview of the configuration with examples, refer to [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]; for details on all the supported configuration parameters, refer to the example file {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
=== Configuration ===<br />
<br />
As is clear after reading [[#Connecting with wpa_passphrase]], a basic configuration file can be generated with:<br />
<br />
# wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf<br />
<br />
This will only create a {{ic|network}} section. A configuration file with some more common options may look like:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<nowiki><br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
fast_reauth=1<br />
ap_scan=1<br />
<br />
network={<br />
ssid="MYSSID"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}</nowiki><br />
}}<br />
<br />
The passphrase can alternatively be defined in clear text by enclosing it in quotes, if the resulting security problems are not of concern:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
psk="passphrase"<br />
}<br />
}}<br />
<br />
If the network does not have a passphrase, e.g. a public Wi-Fi:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
key_mgmt=NONE<br />
}<br />
}}<br />
<br />
Further {{ic|network}} blocks may be added manually, or using ''wpa_cli'' as illustrated in [[#Connecting with wpa_cli]]. In order to use ''wpa_cli'', a control interface must be set with the {{ic|ctrl_interface}} option. Setting {{ic|1=ctrl_interface_group=wheel}} allows users belonging to such group to execute ''wpa_cli''. Also add {{ic|1=update_config=1}} so that changes made with ''wpa_cli'' to {{ic|example.conf}} can be saved.<br />
<br />
{{ic|<nowiki>fast_reauth=1</nowiki>}} and {{ic|<nowiki>ap_scan=1</nowiki>}} are the ''wpa_supplicant'' options active globally at the time of writing. Whether you need them, or other global options too for that matter, depends on the type of network to connect to. If you need other global options, simply copy them over to the file from {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
Alternatively, {{ic|wpa_cli set}} can be used to see options' status or set new ones. Multiple network blocks may be appended to this configuration: the supplicant will handle association to and roaming between all of them. The strongest signal defined with a network block usually is connected to by default, one may define {{ic|priority<nowiki>=</nowiki>}} to influence behaviour. <br />
<br />
An advantage to be mentioned in using a customized configuration file at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is that it is used by default by [[dhcpcd]]. If you do so, you might want to make a backup of the original and delete the extensive network block examples in it. Otherwise, do not be surprised if your device suddenly connects to networks defined in them. In any case, changes to new versions of the configuration file should of course be [[Pacnew and Pacsave files|merged]].<br />
<br />
{{Tip|To configure a network block to a hidden wireless ''SSID'', which by definition will not turn up in a regular scan, the option {{ic|scan_ssid<nowiki>=</nowiki>1}} has to be defined in the network block.}}<br />
<br />
=== Connection ===<br />
<br />
==== Manual ====<br />
<br />
First start ''wpa_supplicant'' command, whose most commonly used arguments are:<br />
<br />
* {{ic|-B}} - Fork into background.<br />
* {{ic|-c ''filename''}} - Path to configuration file.<br />
* {{ic|-i ''interface''}} - Interface to listen on.<br />
* {{ic|-D ''driver''}} - Optionally specify the driver to be used. For a list of supported drivers see the output of {{ic|wpa_supplicant -h}}.<br />
** {{ic|nl80211}} is the current standard, but not all wireless chip's modules support it.<br />
** {{ic|wext}} is currently deprecated, but still widely supported.<br />
<br />
See [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)] for the full argument list. For example:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
followed by a method to obtain an ip address manually as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
==== At boot (systemd) ====<br />
<br />
The ''wpa_supplicant'' package provides multiple [[systemd]] service files:<br />
<br />
* {{ic|wpa_supplicant.service}} - uses [[D-Bus]], recommended for [[NetworkManager]] users.<br />
* {{ic|wpa_supplicant@.service}} - accepts the interface name as an argument and starts the ''wpa_supplicant'' daemon for this interface. It reads the configuration file in {{ic|/etc/wpa_supplicant/wpa_supplicant-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-nl80211@.service}} - also interface specific, but explicitly forces the {{ic|nl80211}} driver (see below). The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-nl80211-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-wired@.service}} - also interface specific, uses the {{ic|wired}} driver. The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-wired-''interface''.conf}}.<br />
<br />
To enable wireless at boot, enable one of the services above on a particular wireless interface. For example:<br />
<br />
# systemctl enable wpa_supplicant@''interface''<br />
<br />
Now choose and [[enable]] a service to obtain an ip address for the particular ''interface'' as indicated in the [[#Overview]], for example:<br />
<br />
# systemctl enable dhcpcd@''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
=== wpa_cli action script ===<br />
<br />
''wpa_cli'' can run in daemon mode and execute a specified script based on events from ''wpa_supplicant''. Two events are supported: {{ic|CONNECTED}} and {{ic|DISCONNECTED}}. Some [[environment variables]] are available to the script, see [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
The following example will use [[desktop notifications]] to notify the user about the events:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
case "$2" in<br />
CONNECTED)<br />
notify-send "WPA supplicant: connection established";<br />
;;<br />
DISCONNECTED)<br />
notify-send "WPA supplicant: connection lost";<br />
;;<br />
esac<br />
}}<br />
<br />
Remember to make the script executable, then use the {{ic|-a}} flag to pass the script path to ''wpa_cli'':<br />
<br />
$ wpa_cli -a ''/path/to/script''<br />
<br />
== Troubleshooting ==<br />
=== nl80211 driver not supported on some hardware ===<br />
<br />
On some (especially old) hardware, ''wpa_supplicant'' may fail with the following error:<br />
<br />
Successfully initialized wpa_supplicant<br />
nl80211: Driver does not support authentication/association or connect commands<br />
wlan0: Failed to initialize driver interface<br />
<br />
This indicates that the standard {{ic|nl80211}} driver does not support the given hardware. The deprecated {{ic|wext}} driver might still support the device:<br />
<br />
# wpa_supplicant -B -i wlan0 '''-D wext''' -c /etc/wpa_supplicant/example.conf<br />
<br />
If the command works to connect, and the user wishes to use [[systemd]] to manage the wireless connection, it is necessary to [[systemd#Editing provided units|edit]] the {{ic|wpa_supplicant@.service}} unit provided by the package and modify the {{ic|ExecStart}} line accordingly:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant@.service.d/wext.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I '''-Dwext'''<br />
}}<br />
<br />
=== Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015) ===<br />
When you use [[WPA supplicant]] (wlan) to connect to your network you might have the problem that the shutdown takes a very long time. That is because systemd runs against a 3 minute timeout. The reason is that WPA supplicant is shut down to early and you do not have the network online when systemd tries to unmount your share(-s). As a workaround (fix) you can add the following settings to the {{ic|wpa_supplicant.service}} file. This can be done by [[Systemd#Drop-in snippets]]. The result looks like this:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant.service.d/override.conf|<nowiki><br />
[Unit]<br />
After=dbus.service<br />
Before=network.target<br />
Wants=network.target<br />
</nowiki>}}<br />
<br />
See more about this bug here: https://github.com/systemd/systemd/issues/1435<br />
<br />
This bug is not fixed in version 2.3 of {{Pkg|wpa_supplicant}}. In version 2.5 they added {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} but still miss {{ic|<nowiki>After=dbus.service</nowiki>}}. So after an update to 2.5 you can remove the {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} from your {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}. After this bug has been fixed you can just remove {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}.<br />
<br />
=== Password-related problems ===<br />
<br />
{{Pkg|wpa_supplicant}} may not work properly if directly passed via stdin particularly long or complex passphrases which include special characters. This may lead to errors such as {{ic|failed 4-way WPA handshake, PSK may be wrong}} when launching {{Pkg|wpa_supplicant}}.<br />
<br />
In order to solve this try using here strings {{ic|wpa_passphrase MYSSID <<< "<passphrase>"}} or passing a file to the {{ic|-c}} flag instead:<br />
<br />
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf<br />
<br />
In some instances it was found that storing the passphrase cleartext in the {{ic|psk}} key of the {{ic|wpa_supplicant.conf}} {{ic|network}} block gave positive results (see [[http://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-4-way-handshake-failed-843394/]]). However, this approach is rather insecure. Using {{ic|wpa_cli}} to create this file instead of manually writing it gives the best results most of the time and therefore is the recommended way to proceed.<br />
<br />
=== Lots of possibly unrelated error messages appear when running wpa_supplicant ===<br />
<br />
If you're using a configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) to launch {{Pkg|wpa_supplicant}} and you're getting lots of different errors at once, you may be using the default template file, which contains many different sample {{ic|network}} blocks. If none of these are commented out or removed, {{Pkg|wpa_supplicant}} will attempt to read them all and consequentially fail. Make sure you only specify {{ic|network}} blocks for wireless access points you will actually associate with. Creating an empty {{ic|wpa_supplicant.conf}} file and filling it up with the output obtained from {{ic|wpa_passphrase}} or using {{ic|wpa_cli}} instead to handle this task should be enough.<br />
<br />
=== Failed to open config file ===<br />
<br />
If you get the following error when launching {{Pkg|wpa_supplicant}} you may need to create a valid {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. Running {{ic|wpa_cli}} or pasting the output of {{ic|wpa_passphrase}} into it should solve this issue.<br />
<br />
Successfully initialized wpa_supplicant<br />
Failed to open config file '/dev/fd/63', error: No such file or directory<br />
Failed to read or parse configuration '/dev/fd/63'.<br />
<br />
== See also ==<br />
<br />
* [http://hostap.epitest.fi/wpa_supplicant/ WPA Supplicant home]<br />
* [https://gist.github.com/buhman/7162560 wpa_cli usage examples]<br />
* [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)]<br />
* [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]<br />
* [http://linux.die.net/man/8/wpa_cli wpa_cli(8)]<br />
* [http://wireless.kernel.org/en/users/Documentation/wpa_supplicant Kernel.org wpa_supplicant documentation]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=414603Wpa supplicant2016-01-07T08:18:39Z<p>LiamMayfair: /* Lots of possibly unrelated error messages appear when running wpa_supplicant */</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[es:WPA supplicant]]<br />
[[it:WPA supplicant]]<br />
[[ja:WPA supplicant]]<br />
[[ru:WPA supplicant]]<br />
[[zh-cn:WPA supplicant]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
<br />
[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] is a cross-platform [[Wikipedia:Supplicant (computer)|supplicant]] with support for WEP, WPA and WPA2 ([[wikipedia:IEEE_802.11i|IEEE 802.11i]] / RSN (Robust Secure Network)). It is suitable for desktops, laptops and embedded systems.<br />
<br />
''wpa_supplicant'' is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wireless driver.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|wpa_supplicant}} package.<br />
<br />
Optionally also install {{Pkg|wpa_supplicant_gui}}, which provides ''wpa_gui'', a graphical front-end for ''wpa_supplicant''.<br />
<br />
== Overview ==<br />
<br />
The first step to connect to an encrypted wireless network is having ''wpa_supplicant'' obtain authentication from a WPA authenticator. In order to do this, ''wpa_supplicant'' must be configured so that it will be able to submit the correct credentials to the authenticator.<br />
<br />
Once the authentication is successful, it will be possible to connect to the network by normally obtaining an IP address by setting it manually with the [[Core utilities#ip|iproute2]] suite or using some networking program, like [[systemd-networkd]] or [[dhcpcd]], to configure an ''interface'' to obtain an IP address automatically via DHCP. See also the [[Wireless_network_configuration#Systemd_with_wpa_supplicant_and_static_IP|wireless]] and [[Network configuration#Configure the IP address|wired]] network configuration articles for methods and examples.<br />
<br />
== Connecting with wpa_cli ==<br />
<br />
This connection method allows scanning for the available networks, making use of ''wpa_cli'', a command line tool which can be used to interactively configure ''wpa_supplicant'' at runtime. See [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
In order to use ''wpa_cli'', a control interface must be specified for ''wpa_supplicant'', and it must be given the rights to update the configuration. Do this by creating a minimal configuration file:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<br />
ctrl_interface=/run/wpa_supplicant<br />
update_config=1<br />
}}<br />
<br />
Now start ''wpa_supplicant'' with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
{{Tip|To discover your wireless network interface name, issue the {{ic|ip link}} command.}}<br />
<br />
At this point run:<br />
<br />
# wpa_cli<br />
<br />
This will present an interactive prompt ({{ic|>}}), which has tab completion and descriptions of completed commands.<br />
<br />
{{Tip|The default location of the control socket is {{ic|/var/run/wpa_supplicant/}}, custom path can be set manually with the {{ic|-p}} option to match the ''wpa_supplicant'' configuration. It is also possible to specify the interface to be configured with the {{ic|-i}} option, otherwise the first found wireless interface managed by ''wpa_supplicant'' will be used.}}<br />
<br />
Use the {{ic|scan}} and {{ic|scan_results}} commands to see the available networks:<br />
<br />
> scan<br />
OK<br />
<3>CTRL-EVENT-SCAN-RESULTS<br />
> scan_results<br />
bssid / frequency / signal level / flags / ssid<br />
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID<br />
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID<br />
<br />
To associate with {{ic|MYSSID}}, add the network, set the credentials and enable it:<br />
<br />
> add_network<br />
0<br />
> set_network 0 ssid "MYSSID"<br />
> set_network 0 psk "passphrase"<br />
> enable_network 0<br />
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]<br />
<br />
If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command {{ic|set_network 0 psk "passphrase"}} with {{ic|set_network 0 key_mgmt NONE}}.<br />
<br />
{{Note|<br />
* Each network is indexed numerically, so the first network will have index 0.<br />
* The [[wikipedia:Pre-shared_key|PSK]] is computed from the ''quoted'' "passphrase" string, as also shown by the [[#Connecting with wpa_passphrase|wpa_passphrase]] command. Nonetheless, you can enter the PSK directly by passing it to {{ic|psk}} ''without'' quotes.}}<br />
<br />
Finally save this network in the configuration file:<br />
<br />
> save_config<br />
OK<br />
<br />
Once association is complete, all that is left to do is obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Connecting with wpa_passphrase ==<br />
<br />
This connection method allows quickly connecting to a network whose SSID is already known, making use of ''wpa_passphrase'', a command line tool which generates the minimal configuration needed by ''wpa_supplicant''. For example:<br />
<br />
{{hc|$ wpa_passphrase MYSSID passphrase|2=<br />
network={<br />
ssid="MYSSID"<br />
#psk="passphrase"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}<br />
}}<br />
<br />
This means that ''wpa_supplicant'' can be associated with ''wpa_passphrase'' and simply started with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c <(wpa_passphrase MYSSID passphrase)<br />
<br />
{{Note|Because of the process substitution, you '''cannot''' run this command with [[sudo]]: you will need a root shell, see also [[Help:Reading#Regular user or root]].}}<br />
<br />
{{Tip|<br />
* Use quotes, if the input contains spaces. For example: {{ic|"secret passphrase"}} <br />
* To discover your wireless network interface name, issue the {{ic|ip link}} command. <br />
* Some unusually complex passphrases may require input from a file, e.g. {{ic|wpa_passphrase MYSSID < passphrase.txt}}, or here strings, e.g. {{ic|wpa_passphrase MYSSID <<< "passphrase"}}.<br />
}}<br />
<br />
Finally, you should obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Advanced usage ==<br />
<br />
For networks of varying complexity, possibly employing extensive use of [[wikipedia:Extensible_Authentication_Protocol|EAP]], it will be useful to maintain a customised configuration file. For an overview of the configuration with examples, refer to [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]; for details on all the supported configuration parameters, refer to the example file {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
=== Configuration ===<br />
<br />
As is clear after reading [[#Connecting with wpa_passphrase]], a basic configuration file can be generated with:<br />
<br />
# wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf<br />
<br />
This will only create a {{ic|network}} section. A configuration file with some more common options may look like:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<nowiki><br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
fast_reauth=1<br />
ap_scan=1<br />
<br />
network={<br />
ssid="MYSSID"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}</nowiki><br />
}}<br />
<br />
The passphrase can alternatively be defined in clear text by enclosing it in quotes, if the resulting security problems are not of concern:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
psk="passphrase"<br />
}<br />
}}<br />
<br />
If the network does not have a passphrase, e.g. a public Wi-Fi:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
key_mgmt=NONE<br />
}<br />
}}<br />
<br />
Further {{ic|network}} blocks may be added manually, or using ''wpa_cli'' as illustrated in [[#Connecting with wpa_cli]]. In order to use ''wpa_cli'', a control interface must be set with the {{ic|ctrl_interface}} option. Setting {{ic|1=ctrl_interface_group=wheel}} allows users belonging to such group to execute ''wpa_cli''. Also add {{ic|1=update_config=1}} so that changes made with ''wpa_cli'' to {{ic|example.conf}} can be saved.<br />
<br />
{{ic|<nowiki>fast_reauth=1</nowiki>}} and {{ic|<nowiki>ap_scan=1</nowiki>}} are the ''wpa_supplicant'' options active globally at the time of writing. Whether you need them, or other global options too for that matter, depends on the type of network to connect to. If you need other global options, simply copy them over to the file from {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
Alternatively, {{ic|wpa_cli set}} can be used to see options' status or set new ones. Multiple network blocks may be appended to this configuration: the supplicant will handle association to and roaming between all of them. The strongest signal defined with a network block usually is connected to by default, one may define {{ic|priority<nowiki>=</nowiki>}} to influence behaviour. <br />
<br />
An advantage to be mentioned in using a customized configuration file at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is that it is used by default by [[dhcpcd]]. If you do so, you might want to make a backup of the original and delete the extensive network block examples in it. Otherwise, do not be surprised if your device suddenly connects to networks defined in them. In any case, changes to new versions of the configuration file should of course be [[Pacnew and Pacsave files|merged]].<br />
<br />
{{Tip|To configure a network block to a hidden wireless ''SSID'', which by definition will not turn up in a regular scan, the option {{ic|scan_ssid<nowiki>=</nowiki>1}} has to be defined in the network block.}}<br />
<br />
=== Connection ===<br />
<br />
==== Manual ====<br />
<br />
First start ''wpa_supplicant'' command, whose most commonly used arguments are:<br />
<br />
* {{ic|-B}} - Fork into background.<br />
* {{ic|-c ''filename''}} - Path to configuration file.<br />
* {{ic|-i ''interface''}} - Interface to listen on.<br />
* {{ic|-D ''driver''}} - Optionally specify the driver to be used. For a list of supported drivers see the output of {{ic|wpa_supplicant -h}}.<br />
** {{ic|nl80211}} is the current standard, but not all wireless chip's modules support it.<br />
** {{ic|wext}} is currently deprecated, but still widely supported.<br />
<br />
See [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)] for the full argument list. For example:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
followed by a method to obtain an ip address manually as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
==== At boot (systemd) ====<br />
<br />
The ''wpa_supplicant'' package provides multiple [[systemd]] service files:<br />
<br />
* {{ic|wpa_supplicant.service}} - uses [[D-Bus]], recommended for [[NetworkManager]] users.<br />
* {{ic|wpa_supplicant@.service}} - accepts the interface name as an argument and starts the ''wpa_supplicant'' daemon for this interface. It reads the configuration file in {{ic|/etc/wpa_supplicant/wpa_supplicant-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-nl80211@.service}} - also interface specific, but explicitly forces the {{ic|nl80211}} driver (see below). The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-nl80211-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-wired@.service}} - also interface specific, uses the {{ic|wired}} driver. The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-wired-''interface''.conf}}.<br />
<br />
To enable wireless at boot, enable one of the services above on a particular wireless interface. For example:<br />
<br />
# systemctl enable wpa_supplicant@''interface''<br />
<br />
Now choose and [[enable]] a service to obtain an ip address for the particular ''interface'' as indicated in the [[#Overview]], for example:<br />
<br />
# systemctl enable dhcpcd@''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
=== wpa_cli action script ===<br />
<br />
''wpa_cli'' can run in daemon mode and execute a specified script based on events from ''wpa_supplicant''. Two events are supported: {{ic|CONNECTED}} and {{ic|DISCONNECTED}}. Some [[environment variables]] are available to the script, see [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
The following example will use [[desktop notifications]] to notify the user about the events:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
case "$2" in<br />
CONNECTED)<br />
notify-send "WPA supplicant: connection established";<br />
;;<br />
DISCONNECTED)<br />
notify-send "WPA supplicant: connection lost";<br />
;;<br />
esac<br />
}}<br />
<br />
Remember to make the script executable, then use the {{ic|-a}} flag to pass the script path to ''wpa_cli'':<br />
<br />
$ wpa_cli -a ''/path/to/script''<br />
<br />
== Troubleshooting ==<br />
=== nl80211 driver not supported on some hardware ===<br />
<br />
On some (especially old) hardware, ''wpa_supplicant'' may fail with the following error:<br />
<br />
Successfully initialized wpa_supplicant<br />
nl80211: Driver does not support authentication/association or connect commands<br />
wlan0: Failed to initialize driver interface<br />
<br />
This indicates that the standard {{ic|nl80211}} driver does not support the given hardware. The deprecated {{ic|wext}} driver might still support the device:<br />
<br />
# wpa_supplicant -B -i wlan0 '''-D wext''' -c /etc/wpa_supplicant/example.conf<br />
<br />
If the command works to connect, and the user wishes to use [[systemd]] to manage the wireless connection, it is necessary to [[systemd#Editing provided units|edit]] the {{ic|wpa_supplicant@.service}} unit provided by the package and modify the {{ic|ExecStart}} line accordingly:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant@.service.d/wext.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I '''-Dwext'''<br />
}}<br />
<br />
=== Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015) ===<br />
When you use [[WPA supplicant]] (wlan) to connect to your network you might have the problem that the shutdown takes a very long time. That is because systemd runs against a 3 minute timeout. The reason is that WPA supplicant is shut down to early and you do not have the network online when systemd tries to unmount your share(-s). As a workaround (fix) you can add the following settings to the {{ic|wpa_supplicant.service}} file. This can be done by [[Systemd#Drop-in snippets]]. The result looks like this:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant.service.d/override.conf|<nowiki><br />
[Unit]<br />
After=dbus.service<br />
Before=network.target<br />
Wants=network.target<br />
</nowiki>}}<br />
<br />
See more about this bug here: https://github.com/systemd/systemd/issues/1435<br />
<br />
This bug is not fixed in version 2.3 of {{Pkg|wpa_supplicant}}. In version 2.5 they added {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} but still miss {{ic|<nowiki>After=dbus.service</nowiki>}}. So after an update to 2.5 you can remove the {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} from your {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}. After this bug has been fixed you can just remove {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}.<br />
<br />
=== Password-related problems ===<br />
<br />
{{Pkg|wpa_supplicant}} may not work properly if directly passed via stdin particularly long or complex passphrases which include special characters. This may lead to errors such as {{ic|failed 4-way WPA handshake, PSK may be wrong}} when launching {{Pkg|wpa_supplicant}}.<br />
<br />
In order to solve this try using here strings {{ic|wpa_passphrase MYSSID <<< "<passphrase>"}} or passing a file to the {{ic|-c}} flag instead:<br />
<br />
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf<br />
<br />
In some instances it was found that storing the passphrase cleartext in the {{ic|psk}} key of the {{ic|wpa_supplicant.conf}} {{ic|network}} block gave positive results (see [[http://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-4-way-handshake-failed-843394/]]). However, this approach is rather insecure. Using {{ic|wpa_cli}} to create this file instead of manually writing it gives the best results most of the time and therefore is the recommended way to proceed.<br />
<br />
=== Lots of possibly unrelated error messages appear when running wpa_supplicant ===<br />
<br />
If you're using a configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) to launch {{Pkg|wpa_supplicant}} and you're getting lots of different errors at once, you may be using the default template file, which contains many different sample {{ic|network}} blocks. If none of these are commented out or removed, {{Pkg|wpa_supplicant}} will attempt to read them all and consequentially fail. Make sure you only specify {{ic|network}} blocks for wireless access points you will actually associate with. Creating an empty {{ic|wpa_supplicant.conf}} file and filling it up with the output obtained from {{ic|wpa_passphrase}} or using {{ic|wpa_cli}} instead to handle this task should be enough.<br />
<br />
=== Failed to open config file ===<br />
<br />
If you get the following error when launching {{Pkg|wpa_supplicant}} you may need to create a valid {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. Running ''wpa_cli'' or pasting the output of ''wpa_passphrase'' into it should solve this issue.<br />
<br />
Successfully initialized wpa_supplicant<br />
Failed to open config file '/dev/fd/63', error: No such file or directory<br />
Failed to read or parse configuration '/dev/fd/63'.<br />
<br />
== See also ==<br />
<br />
* [http://hostap.epitest.fi/wpa_supplicant/ WPA Supplicant home]<br />
* [https://gist.github.com/buhman/7162560 wpa_cli usage examples]<br />
* [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)]<br />
* [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]<br />
* [http://linux.die.net/man/8/wpa_cli wpa_cli(8)]<br />
* [http://wireless.kernel.org/en/users/Documentation/wpa_supplicant Kernel.org wpa_supplicant documentation]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=414602Wpa supplicant2016-01-07T08:17:59Z<p>LiamMayfair: /* Password-related problems */</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[es:WPA supplicant]]<br />
[[it:WPA supplicant]]<br />
[[ja:WPA supplicant]]<br />
[[ru:WPA supplicant]]<br />
[[zh-cn:WPA supplicant]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
<br />
[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] is a cross-platform [[Wikipedia:Supplicant (computer)|supplicant]] with support for WEP, WPA and WPA2 ([[wikipedia:IEEE_802.11i|IEEE 802.11i]] / RSN (Robust Secure Network)). It is suitable for desktops, laptops and embedded systems.<br />
<br />
''wpa_supplicant'' is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wireless driver.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|wpa_supplicant}} package.<br />
<br />
Optionally also install {{Pkg|wpa_supplicant_gui}}, which provides ''wpa_gui'', a graphical front-end for ''wpa_supplicant''.<br />
<br />
== Overview ==<br />
<br />
The first step to connect to an encrypted wireless network is having ''wpa_supplicant'' obtain authentication from a WPA authenticator. In order to do this, ''wpa_supplicant'' must be configured so that it will be able to submit the correct credentials to the authenticator.<br />
<br />
Once the authentication is successful, it will be possible to connect to the network by normally obtaining an IP address by setting it manually with the [[Core utilities#ip|iproute2]] suite or using some networking program, like [[systemd-networkd]] or [[dhcpcd]], to configure an ''interface'' to obtain an IP address automatically via DHCP. See also the [[Wireless_network_configuration#Systemd_with_wpa_supplicant_and_static_IP|wireless]] and [[Network configuration#Configure the IP address|wired]] network configuration articles for methods and examples.<br />
<br />
== Connecting with wpa_cli ==<br />
<br />
This connection method allows scanning for the available networks, making use of ''wpa_cli'', a command line tool which can be used to interactively configure ''wpa_supplicant'' at runtime. See [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
In order to use ''wpa_cli'', a control interface must be specified for ''wpa_supplicant'', and it must be given the rights to update the configuration. Do this by creating a minimal configuration file:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<br />
ctrl_interface=/run/wpa_supplicant<br />
update_config=1<br />
}}<br />
<br />
Now start ''wpa_supplicant'' with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
{{Tip|To discover your wireless network interface name, issue the {{ic|ip link}} command.}}<br />
<br />
At this point run:<br />
<br />
# wpa_cli<br />
<br />
This will present an interactive prompt ({{ic|>}}), which has tab completion and descriptions of completed commands.<br />
<br />
{{Tip|The default location of the control socket is {{ic|/var/run/wpa_supplicant/}}, custom path can be set manually with the {{ic|-p}} option to match the ''wpa_supplicant'' configuration. It is also possible to specify the interface to be configured with the {{ic|-i}} option, otherwise the first found wireless interface managed by ''wpa_supplicant'' will be used.}}<br />
<br />
Use the {{ic|scan}} and {{ic|scan_results}} commands to see the available networks:<br />
<br />
> scan<br />
OK<br />
<3>CTRL-EVENT-SCAN-RESULTS<br />
> scan_results<br />
bssid / frequency / signal level / flags / ssid<br />
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID<br />
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID<br />
<br />
To associate with {{ic|MYSSID}}, add the network, set the credentials and enable it:<br />
<br />
> add_network<br />
0<br />
> set_network 0 ssid "MYSSID"<br />
> set_network 0 psk "passphrase"<br />
> enable_network 0<br />
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]<br />
<br />
If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command {{ic|set_network 0 psk "passphrase"}} with {{ic|set_network 0 key_mgmt NONE}}.<br />
<br />
{{Note|<br />
* Each network is indexed numerically, so the first network will have index 0.<br />
* The [[wikipedia:Pre-shared_key|PSK]] is computed from the ''quoted'' "passphrase" string, as also shown by the [[#Connecting with wpa_passphrase|wpa_passphrase]] command. Nonetheless, you can enter the PSK directly by passing it to {{ic|psk}} ''without'' quotes.}}<br />
<br />
Finally save this network in the configuration file:<br />
<br />
> save_config<br />
OK<br />
<br />
Once association is complete, all that is left to do is obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Connecting with wpa_passphrase ==<br />
<br />
This connection method allows quickly connecting to a network whose SSID is already known, making use of ''wpa_passphrase'', a command line tool which generates the minimal configuration needed by ''wpa_supplicant''. For example:<br />
<br />
{{hc|$ wpa_passphrase MYSSID passphrase|2=<br />
network={<br />
ssid="MYSSID"<br />
#psk="passphrase"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}<br />
}}<br />
<br />
This means that ''wpa_supplicant'' can be associated with ''wpa_passphrase'' and simply started with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c <(wpa_passphrase MYSSID passphrase)<br />
<br />
{{Note|Because of the process substitution, you '''cannot''' run this command with [[sudo]]: you will need a root shell, see also [[Help:Reading#Regular user or root]].}}<br />
<br />
{{Tip|<br />
* Use quotes, if the input contains spaces. For example: {{ic|"secret passphrase"}} <br />
* To discover your wireless network interface name, issue the {{ic|ip link}} command. <br />
* Some unusually complex passphrases may require input from a file, e.g. {{ic|wpa_passphrase MYSSID < passphrase.txt}}, or here strings, e.g. {{ic|wpa_passphrase MYSSID <<< "passphrase"}}.<br />
}}<br />
<br />
Finally, you should obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Advanced usage ==<br />
<br />
For networks of varying complexity, possibly employing extensive use of [[wikipedia:Extensible_Authentication_Protocol|EAP]], it will be useful to maintain a customised configuration file. For an overview of the configuration with examples, refer to [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]; for details on all the supported configuration parameters, refer to the example file {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
=== Configuration ===<br />
<br />
As is clear after reading [[#Connecting with wpa_passphrase]], a basic configuration file can be generated with:<br />
<br />
# wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf<br />
<br />
This will only create a {{ic|network}} section. A configuration file with some more common options may look like:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<nowiki><br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
fast_reauth=1<br />
ap_scan=1<br />
<br />
network={<br />
ssid="MYSSID"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}</nowiki><br />
}}<br />
<br />
The passphrase can alternatively be defined in clear text by enclosing it in quotes, if the resulting security problems are not of concern:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
psk="passphrase"<br />
}<br />
}}<br />
<br />
If the network does not have a passphrase, e.g. a public Wi-Fi:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
key_mgmt=NONE<br />
}<br />
}}<br />
<br />
Further {{ic|network}} blocks may be added manually, or using ''wpa_cli'' as illustrated in [[#Connecting with wpa_cli]]. In order to use ''wpa_cli'', a control interface must be set with the {{ic|ctrl_interface}} option. Setting {{ic|1=ctrl_interface_group=wheel}} allows users belonging to such group to execute ''wpa_cli''. Also add {{ic|1=update_config=1}} so that changes made with ''wpa_cli'' to {{ic|example.conf}} can be saved.<br />
<br />
{{ic|<nowiki>fast_reauth=1</nowiki>}} and {{ic|<nowiki>ap_scan=1</nowiki>}} are the ''wpa_supplicant'' options active globally at the time of writing. Whether you need them, or other global options too for that matter, depends on the type of network to connect to. If you need other global options, simply copy them over to the file from {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
Alternatively, {{ic|wpa_cli set}} can be used to see options' status or set new ones. Multiple network blocks may be appended to this configuration: the supplicant will handle association to and roaming between all of them. The strongest signal defined with a network block usually is connected to by default, one may define {{ic|priority<nowiki>=</nowiki>}} to influence behaviour. <br />
<br />
An advantage to be mentioned in using a customized configuration file at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is that it is used by default by [[dhcpcd]]. If you do so, you might want to make a backup of the original and delete the extensive network block examples in it. Otherwise, do not be surprised if your device suddenly connects to networks defined in them. In any case, changes to new versions of the configuration file should of course be [[Pacnew and Pacsave files|merged]].<br />
<br />
{{Tip|To configure a network block to a hidden wireless ''SSID'', which by definition will not turn up in a regular scan, the option {{ic|scan_ssid<nowiki>=</nowiki>1}} has to be defined in the network block.}}<br />
<br />
=== Connection ===<br />
<br />
==== Manual ====<br />
<br />
First start ''wpa_supplicant'' command, whose most commonly used arguments are:<br />
<br />
* {{ic|-B}} - Fork into background.<br />
* {{ic|-c ''filename''}} - Path to configuration file.<br />
* {{ic|-i ''interface''}} - Interface to listen on.<br />
* {{ic|-D ''driver''}} - Optionally specify the driver to be used. For a list of supported drivers see the output of {{ic|wpa_supplicant -h}}.<br />
** {{ic|nl80211}} is the current standard, but not all wireless chip's modules support it.<br />
** {{ic|wext}} is currently deprecated, but still widely supported.<br />
<br />
See [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)] for the full argument list. For example:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
followed by a method to obtain an ip address manually as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
==== At boot (systemd) ====<br />
<br />
The ''wpa_supplicant'' package provides multiple [[systemd]] service files:<br />
<br />
* {{ic|wpa_supplicant.service}} - uses [[D-Bus]], recommended for [[NetworkManager]] users.<br />
* {{ic|wpa_supplicant@.service}} - accepts the interface name as an argument and starts the ''wpa_supplicant'' daemon for this interface. It reads the configuration file in {{ic|/etc/wpa_supplicant/wpa_supplicant-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-nl80211@.service}} - also interface specific, but explicitly forces the {{ic|nl80211}} driver (see below). The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-nl80211-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-wired@.service}} - also interface specific, uses the {{ic|wired}} driver. The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-wired-''interface''.conf}}.<br />
<br />
To enable wireless at boot, enable one of the services above on a particular wireless interface. For example:<br />
<br />
# systemctl enable wpa_supplicant@''interface''<br />
<br />
Now choose and [[enable]] a service to obtain an ip address for the particular ''interface'' as indicated in the [[#Overview]], for example:<br />
<br />
# systemctl enable dhcpcd@''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
=== wpa_cli action script ===<br />
<br />
''wpa_cli'' can run in daemon mode and execute a specified script based on events from ''wpa_supplicant''. Two events are supported: {{ic|CONNECTED}} and {{ic|DISCONNECTED}}. Some [[environment variables]] are available to the script, see [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
The following example will use [[desktop notifications]] to notify the user about the events:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
case "$2" in<br />
CONNECTED)<br />
notify-send "WPA supplicant: connection established";<br />
;;<br />
DISCONNECTED)<br />
notify-send "WPA supplicant: connection lost";<br />
;;<br />
esac<br />
}}<br />
<br />
Remember to make the script executable, then use the {{ic|-a}} flag to pass the script path to ''wpa_cli'':<br />
<br />
$ wpa_cli -a ''/path/to/script''<br />
<br />
== Troubleshooting ==<br />
=== nl80211 driver not supported on some hardware ===<br />
<br />
On some (especially old) hardware, ''wpa_supplicant'' may fail with the following error:<br />
<br />
Successfully initialized wpa_supplicant<br />
nl80211: Driver does not support authentication/association or connect commands<br />
wlan0: Failed to initialize driver interface<br />
<br />
This indicates that the standard {{ic|nl80211}} driver does not support the given hardware. The deprecated {{ic|wext}} driver might still support the device:<br />
<br />
# wpa_supplicant -B -i wlan0 '''-D wext''' -c /etc/wpa_supplicant/example.conf<br />
<br />
If the command works to connect, and the user wishes to use [[systemd]] to manage the wireless connection, it is necessary to [[systemd#Editing provided units|edit]] the {{ic|wpa_supplicant@.service}} unit provided by the package and modify the {{ic|ExecStart}} line accordingly:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant@.service.d/wext.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I '''-Dwext'''<br />
}}<br />
<br />
=== Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015) ===<br />
When you use [[WPA supplicant]] (wlan) to connect to your network you might have the problem that the shutdown takes a very long time. That is because systemd runs against a 3 minute timeout. The reason is that WPA supplicant is shut down to early and you do not have the network online when systemd tries to unmount your share(-s). As a workaround (fix) you can add the following settings to the {{ic|wpa_supplicant.service}} file. This can be done by [[Systemd#Drop-in snippets]]. The result looks like this:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant.service.d/override.conf|<nowiki><br />
[Unit]<br />
After=dbus.service<br />
Before=network.target<br />
Wants=network.target<br />
</nowiki>}}<br />
<br />
See more about this bug here: https://github.com/systemd/systemd/issues/1435<br />
<br />
This bug is not fixed in version 2.3 of {{Pkg|wpa_supplicant}}. In version 2.5 they added {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} but still miss {{ic|<nowiki>After=dbus.service</nowiki>}}. So after an update to 2.5 you can remove the {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} from your {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}. After this bug has been fixed you can just remove {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}.<br />
<br />
=== Password-related problems ===<br />
<br />
{{Pkg|wpa_supplicant}} may not work properly if directly passed via stdin particularly long or complex passphrases which include special characters. This may lead to errors such as {{ic|failed 4-way WPA handshake, PSK may be wrong}} when launching {{Pkg|wpa_supplicant}}.<br />
<br />
In order to solve this try using here strings {{ic|wpa_passphrase MYSSID <<< "<passphrase>"}} or passing a file to the {{ic|-c}} flag instead:<br />
<br />
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf<br />
<br />
In some instances it was found that storing the passphrase cleartext in the {{ic|psk}} key of the {{ic|wpa_supplicant.conf}} {{ic|network}} block gave positive results (see [[http://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-4-way-handshake-failed-843394/]]). However, this approach is rather insecure. Using {{ic|wpa_cli}} to create this file instead of manually writing it gives the best results most of the time and therefore is the recommended way to proceed.<br />
<br />
=== Lots of possibly unrelated error messages appear when running wpa_supplicant ===<br />
<br />
If you're using a configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) to launch {{Pkg|wpa_supplicant}} and you're getting lots of different errors at once, you may be using the default template file, which contains many different sample ''network'' blocks. If none of these are commented out or removed, {{Pkg|wpa_supplicant}} will attempt to read them all and consequentially fail. Make sure you only specify ''network'' blocks for wireless access points you will actually associate with. Creating an empty ''wpa_supplicant.conf'' file and filling it up with the output obtained from ''wpa_passphrase'' or using ''wpa_cli'' instead to handle this task should be enough.<br />
<br />
=== Failed to open config file ===<br />
<br />
If you get the following error when launching {{Pkg|wpa_supplicant}} you may need to create a valid {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. Running ''wpa_cli'' or pasting the output of ''wpa_passphrase'' into it should solve this issue.<br />
<br />
Successfully initialized wpa_supplicant<br />
Failed to open config file '/dev/fd/63', error: No such file or directory<br />
Failed to read or parse configuration '/dev/fd/63'.<br />
<br />
== See also ==<br />
<br />
* [http://hostap.epitest.fi/wpa_supplicant/ WPA Supplicant home]<br />
* [https://gist.github.com/buhman/7162560 wpa_cli usage examples]<br />
* [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)]<br />
* [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]<br />
* [http://linux.die.net/man/8/wpa_cli wpa_cli(8)]<br />
* [http://wireless.kernel.org/en/users/Documentation/wpa_supplicant Kernel.org wpa_supplicant documentation]</div>LiamMayfairhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=414601Wpa supplicant2016-01-07T08:16:47Z<p>LiamMayfair: Added more entries to Troubleshooting section for dealing with config file and passphrase issues.</p>
<hr />
<div>[[Category:Wireless networking]]<br />
[[Category:Network configuration]]<br />
[[es:WPA supplicant]]<br />
[[it:WPA supplicant]]<br />
[[ja:WPA supplicant]]<br />
[[ru:WPA supplicant]]<br />
[[zh-cn:WPA supplicant]]<br />
{{Related articles start}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related articles end}}<br />
<br />
[http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant] is a cross-platform [[Wikipedia:Supplicant (computer)|supplicant]] with support for WEP, WPA and WPA2 ([[wikipedia:IEEE_802.11i|IEEE 802.11i]] / RSN (Robust Secure Network)). It is suitable for desktops, laptops and embedded systems.<br />
<br />
''wpa_supplicant'' is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wireless driver.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|wpa_supplicant}} package.<br />
<br />
Optionally also install {{Pkg|wpa_supplicant_gui}}, which provides ''wpa_gui'', a graphical front-end for ''wpa_supplicant''.<br />
<br />
== Overview ==<br />
<br />
The first step to connect to an encrypted wireless network is having ''wpa_supplicant'' obtain authentication from a WPA authenticator. In order to do this, ''wpa_supplicant'' must be configured so that it will be able to submit the correct credentials to the authenticator.<br />
<br />
Once the authentication is successful, it will be possible to connect to the network by normally obtaining an IP address by setting it manually with the [[Core utilities#ip|iproute2]] suite or using some networking program, like [[systemd-networkd]] or [[dhcpcd]], to configure an ''interface'' to obtain an IP address automatically via DHCP. See also the [[Wireless_network_configuration#Systemd_with_wpa_supplicant_and_static_IP|wireless]] and [[Network configuration#Configure the IP address|wired]] network configuration articles for methods and examples.<br />
<br />
== Connecting with wpa_cli ==<br />
<br />
This connection method allows scanning for the available networks, making use of ''wpa_cli'', a command line tool which can be used to interactively configure ''wpa_supplicant'' at runtime. See [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
In order to use ''wpa_cli'', a control interface must be specified for ''wpa_supplicant'', and it must be given the rights to update the configuration. Do this by creating a minimal configuration file:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<br />
ctrl_interface=/run/wpa_supplicant<br />
update_config=1<br />
}}<br />
<br />
Now start ''wpa_supplicant'' with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
{{Tip|To discover your wireless network interface name, issue the {{ic|ip link}} command.}}<br />
<br />
At this point run:<br />
<br />
# wpa_cli<br />
<br />
This will present an interactive prompt ({{ic|>}}), which has tab completion and descriptions of completed commands.<br />
<br />
{{Tip|The default location of the control socket is {{ic|/var/run/wpa_supplicant/}}, custom path can be set manually with the {{ic|-p}} option to match the ''wpa_supplicant'' configuration. It is also possible to specify the interface to be configured with the {{ic|-i}} option, otherwise the first found wireless interface managed by ''wpa_supplicant'' will be used.}}<br />
<br />
Use the {{ic|scan}} and {{ic|scan_results}} commands to see the available networks:<br />
<br />
> scan<br />
OK<br />
<3>CTRL-EVENT-SCAN-RESULTS<br />
> scan_results<br />
bssid / frequency / signal level / flags / ssid<br />
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID<br />
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID<br />
<br />
To associate with {{ic|MYSSID}}, add the network, set the credentials and enable it:<br />
<br />
> add_network<br />
0<br />
> set_network 0 ssid "MYSSID"<br />
> set_network 0 psk "passphrase"<br />
> enable_network 0<br />
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]<br />
<br />
If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command {{ic|set_network 0 psk "passphrase"}} with {{ic|set_network 0 key_mgmt NONE}}.<br />
<br />
{{Note|<br />
* Each network is indexed numerically, so the first network will have index 0.<br />
* The [[wikipedia:Pre-shared_key|PSK]] is computed from the ''quoted'' "passphrase" string, as also shown by the [[#Connecting with wpa_passphrase|wpa_passphrase]] command. Nonetheless, you can enter the PSK directly by passing it to {{ic|psk}} ''without'' quotes.}}<br />
<br />
Finally save this network in the configuration file:<br />
<br />
> save_config<br />
OK<br />
<br />
Once association is complete, all that is left to do is obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Connecting with wpa_passphrase ==<br />
<br />
This connection method allows quickly connecting to a network whose SSID is already known, making use of ''wpa_passphrase'', a command line tool which generates the minimal configuration needed by ''wpa_supplicant''. For example:<br />
<br />
{{hc|$ wpa_passphrase MYSSID passphrase|2=<br />
network={<br />
ssid="MYSSID"<br />
#psk="passphrase"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}<br />
}}<br />
<br />
This means that ''wpa_supplicant'' can be associated with ''wpa_passphrase'' and simply started with:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c <(wpa_passphrase MYSSID passphrase)<br />
<br />
{{Note|Because of the process substitution, you '''cannot''' run this command with [[sudo]]: you will need a root shell, see also [[Help:Reading#Regular user or root]].}}<br />
<br />
{{Tip|<br />
* Use quotes, if the input contains spaces. For example: {{ic|"secret passphrase"}} <br />
* To discover your wireless network interface name, issue the {{ic|ip link}} command. <br />
* Some unusually complex passphrases may require input from a file, e.g. {{ic|wpa_passphrase MYSSID < passphrase.txt}}, or here strings, e.g. {{ic|wpa_passphrase MYSSID <<< "passphrase"}}.<br />
}}<br />
<br />
Finally, you should obtain an IP address as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
== Advanced usage ==<br />
<br />
For networks of varying complexity, possibly employing extensive use of [[wikipedia:Extensible_Authentication_Protocol|EAP]], it will be useful to maintain a customised configuration file. For an overview of the configuration with examples, refer to [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]; for details on all the supported configuration parameters, refer to the example file {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
=== Configuration ===<br />
<br />
As is clear after reading [[#Connecting with wpa_passphrase]], a basic configuration file can be generated with:<br />
<br />
# wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf<br />
<br />
This will only create a {{ic|network}} section. A configuration file with some more common options may look like:<br />
<br />
{{hc|/etc/wpa_supplicant/example.conf|2=<nowiki><br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
fast_reauth=1<br />
ap_scan=1<br />
<br />
network={<br />
ssid="MYSSID"<br />
psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d<br />
}</nowiki><br />
}}<br />
<br />
The passphrase can alternatively be defined in clear text by enclosing it in quotes, if the resulting security problems are not of concern:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
psk="passphrase"<br />
}<br />
}}<br />
<br />
If the network does not have a passphrase, e.g. a public Wi-Fi:<br />
<br />
{{bc|1=<br />
network={<br />
ssid="MYSSID"<br />
key_mgmt=NONE<br />
}<br />
}}<br />
<br />
Further {{ic|network}} blocks may be added manually, or using ''wpa_cli'' as illustrated in [[#Connecting with wpa_cli]]. In order to use ''wpa_cli'', a control interface must be set with the {{ic|ctrl_interface}} option. Setting {{ic|1=ctrl_interface_group=wheel}} allows users belonging to such group to execute ''wpa_cli''. Also add {{ic|1=update_config=1}} so that changes made with ''wpa_cli'' to {{ic|example.conf}} can be saved.<br />
<br />
{{ic|<nowiki>fast_reauth=1</nowiki>}} and {{ic|<nowiki>ap_scan=1</nowiki>}} are the ''wpa_supplicant'' options active globally at the time of writing. Whether you need them, or other global options too for that matter, depends on the type of network to connect to. If you need other global options, simply copy them over to the file from {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. <br />
<br />
Alternatively, {{ic|wpa_cli set}} can be used to see options' status or set new ones. Multiple network blocks may be appended to this configuration: the supplicant will handle association to and roaming between all of them. The strongest signal defined with a network block usually is connected to by default, one may define {{ic|priority<nowiki>=</nowiki>}} to influence behaviour. <br />
<br />
An advantage to be mentioned in using a customized configuration file at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is that it is used by default by [[dhcpcd]]. If you do so, you might want to make a backup of the original and delete the extensive network block examples in it. Otherwise, do not be surprised if your device suddenly connects to networks defined in them. In any case, changes to new versions of the configuration file should of course be [[Pacnew and Pacsave files|merged]].<br />
<br />
{{Tip|To configure a network block to a hidden wireless ''SSID'', which by definition will not turn up in a regular scan, the option {{ic|scan_ssid<nowiki>=</nowiki>1}} has to be defined in the network block.}}<br />
<br />
=== Connection ===<br />
<br />
==== Manual ====<br />
<br />
First start ''wpa_supplicant'' command, whose most commonly used arguments are:<br />
<br />
* {{ic|-B}} - Fork into background.<br />
* {{ic|-c ''filename''}} - Path to configuration file.<br />
* {{ic|-i ''interface''}} - Interface to listen on.<br />
* {{ic|-D ''driver''}} - Optionally specify the driver to be used. For a list of supported drivers see the output of {{ic|wpa_supplicant -h}}.<br />
** {{ic|nl80211}} is the current standard, but not all wireless chip's modules support it.<br />
** {{ic|wext}} is currently deprecated, but still widely supported.<br />
<br />
See [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)] for the full argument list. For example:<br />
<br />
# wpa_supplicant -B -i ''interface'' -c /etc/wpa_supplicant/example.conf<br />
<br />
followed by a method to obtain an ip address manually as indicated in the [[#Overview]], for example:<br />
<br />
# dhcpcd ''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
==== At boot (systemd) ====<br />
<br />
The ''wpa_supplicant'' package provides multiple [[systemd]] service files:<br />
<br />
* {{ic|wpa_supplicant.service}} - uses [[D-Bus]], recommended for [[NetworkManager]] users.<br />
* {{ic|wpa_supplicant@.service}} - accepts the interface name as an argument and starts the ''wpa_supplicant'' daemon for this interface. It reads the configuration file in {{ic|/etc/wpa_supplicant/wpa_supplicant-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-nl80211@.service}} - also interface specific, but explicitly forces the {{ic|nl80211}} driver (see below). The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-nl80211-''interface''.conf}}.<br />
* {{ic|wpa_supplicant-wired@.service}} - also interface specific, uses the {{ic|wired}} driver. The configuration file path is {{ic|/etc/wpa_supplicant/wpa_supplicant-wired-''interface''.conf}}.<br />
<br />
To enable wireless at boot, enable one of the services above on a particular wireless interface. For example:<br />
<br />
# systemctl enable wpa_supplicant@''interface''<br />
<br />
Now choose and [[enable]] a service to obtain an ip address for the particular ''interface'' as indicated in the [[#Overview]], for example:<br />
<br />
# systemctl enable dhcpcd@''interface''<br />
<br />
{{Tip|''dhcpcd'' has a hook that can lauch ''wpa_supplicant'' implicitly, see [[dhcpcd#10-wpa_supplicant]].}}<br />
<br />
=== wpa_cli action script ===<br />
<br />
''wpa_cli'' can run in daemon mode and execute a specified script based on events from ''wpa_supplicant''. Two events are supported: {{ic|CONNECTED}} and {{ic|DISCONNECTED}}. Some [[environment variables]] are available to the script, see [http://linux.die.net/man/8/wpa_cli wpa_cli(8)] for details.<br />
<br />
The following example will use [[desktop notifications]] to notify the user about the events:<br />
<br />
{{bc|<br />
#!/bin/bash<br />
<br />
case "$2" in<br />
CONNECTED)<br />
notify-send "WPA supplicant: connection established";<br />
;;<br />
DISCONNECTED)<br />
notify-send "WPA supplicant: connection lost";<br />
;;<br />
esac<br />
}}<br />
<br />
Remember to make the script executable, then use the {{ic|-a}} flag to pass the script path to ''wpa_cli'':<br />
<br />
$ wpa_cli -a ''/path/to/script''<br />
<br />
== Troubleshooting ==<br />
=== nl80211 driver not supported on some hardware ===<br />
<br />
On some (especially old) hardware, ''wpa_supplicant'' may fail with the following error:<br />
<br />
Successfully initialized wpa_supplicant<br />
nl80211: Driver does not support authentication/association or connect commands<br />
wlan0: Failed to initialize driver interface<br />
<br />
This indicates that the standard {{ic|nl80211}} driver does not support the given hardware. The deprecated {{ic|wext}} driver might still support the device:<br />
<br />
# wpa_supplicant -B -i wlan0 '''-D wext''' -c /etc/wpa_supplicant/example.conf<br />
<br />
If the command works to connect, and the user wishes to use [[systemd]] to manage the wireless connection, it is necessary to [[systemd#Editing provided units|edit]] the {{ic|wpa_supplicant@.service}} unit provided by the package and modify the {{ic|ExecStart}} line accordingly:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant@.service.d/wext.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I '''-Dwext'''<br />
}}<br />
<br />
=== Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015) ===<br />
When you use [[WPA supplicant]] (wlan) to connect to your network you might have the problem that the shutdown takes a very long time. That is because systemd runs against a 3 minute timeout. The reason is that WPA supplicant is shut down to early and you do not have the network online when systemd tries to unmount your share(-s). As a workaround (fix) you can add the following settings to the {{ic|wpa_supplicant.service}} file. This can be done by [[Systemd#Drop-in snippets]]. The result looks like this:<br />
<br />
{{hc|/etc/systemd/system/wpa_supplicant.service.d/override.conf|<nowiki><br />
[Unit]<br />
After=dbus.service<br />
Before=network.target<br />
Wants=network.target<br />
</nowiki>}}<br />
<br />
See more about this bug here: https://github.com/systemd/systemd/issues/1435<br />
<br />
This bug is not fixed in version 2.3 of {{Pkg|wpa_supplicant}}. In version 2.5 they added {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} but still miss {{ic|<nowiki>After=dbus.service</nowiki>}}. So after an update to 2.5 you can remove the {{ic|<nowiki>Before=network.target</nowiki>}} and {{ic|<nowiki>Wants=network.target</nowiki>}} from your {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}. After this bug has been fixed you can just remove {{ic|/etc/systemd/system/wpa_supplicant.service.d/override.conf}}.<br />
<br />
=== Password-related problems ===<br />
<br />
{{Pkg|wpa_supplicant}} may not work properly if directly passed via stdin particularly long or complex passphrases which include special characters. This may lead to errors such as {{ic|failed 4-way WPA handshake, PSK may be wrong}} when launching {{Pkg|wpa_supplicant}}.<br />
<br />
In order to solve this try using here strings {{ic|wpa_passphrase MYSSID <<< "<passphrase>"}} or passing a file to the ''-c'' flag instead:<br />
<br />
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf<br />
<br />
In some instances it was found that storing the passphrase cleartext in the ''psk'' key of the ''wpa_supplicant.conf'' ''network'' block gave positive results (see [[http://www.linuxquestions.org/questions/linux-wireless-networking-41/wpa-4-way-handshake-failed-843394/]]). However, this approach is rather insecure. Using ''wpa_cli'' to create this file instead of manually writing it gives the best results most of the time and therefore is the recommended way to proceed.<br />
<br />
=== Lots of possibly unrelated error messages appear when running wpa_supplicant ===<br />
<br />
If you're using a configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) to launch {{Pkg|wpa_supplicant}} and you're getting lots of different errors at once, you may be using the default template file, which contains many different sample ''network'' blocks. If none of these are commented out or removed, {{Pkg|wpa_supplicant}} will attempt to read them all and consequentially fail. Make sure you only specify ''network'' blocks for wireless access points you will actually associate with. Creating an empty ''wpa_supplicant.conf'' file and filling it up with the output obtained from ''wpa_passphrase'' or using ''wpa_cli'' instead to handle this task should be enough.<br />
<br />
=== Failed to open config file ===<br />
<br />
If you get the following error when launching {{Pkg|wpa_supplicant}} you may need to create a valid {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}. Running ''wpa_cli'' or pasting the output of ''wpa_passphrase'' into it should solve this issue.<br />
<br />
Successfully initialized wpa_supplicant<br />
Failed to open config file '/dev/fd/63', error: No such file or directory<br />
Failed to read or parse configuration '/dev/fd/63'.<br />
<br />
== See also ==<br />
<br />
* [http://hostap.epitest.fi/wpa_supplicant/ WPA Supplicant home]<br />
* [https://gist.github.com/buhman/7162560 wpa_cli usage examples]<br />
* [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant(8)]<br />
* [http://linux.die.net/man/5/wpa_supplicant.conf wpa_supplicant.conf(5)]<br />
* [http://linux.die.net/man/8/wpa_cli wpa_cli(8)]<br />
* [http://wireless.kernel.org/en/users/Documentation/wpa_supplicant Kernel.org wpa_supplicant documentation]</div>LiamMayfair