https://wiki.archlinux.org/api.php?action=feedcontributions&user=Jeff+story&feedformat=atomArchWiki - User contributions [en]2024-03-28T10:08:57ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User_talk:Jeff_story&diff=634442User talk:Jeff story2020-09-06T01:57:12Z<p>Jeff story: Replaced content with "~~~~"</p>
<hr />
<div>[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 01:57, 6 September 2020 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User_talk:Jeff_story&diff=634441User talk:Jeff story2020-09-06T01:55:05Z<p>Jeff story: </p>
<hr />
<div>[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 01:55, 6 September 2020 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User_talk:Jeff_story&diff=634439User talk:Jeff story2020-09-06T01:45:58Z<p>Jeff story: Blanked the page</p>
<hr />
<div></div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=479274User:Jeff story/Webfs2017-06-05T17:03:04Z<p>Jeff story: Reverting, can't get to properly render</p>
<hr />
<div>[[Category:Web server]]<br />
[[ja:Webfs]]<br />
[http://linux.bytesex.org/misc/webfs.html Webfs] is a simple http server for mostly static content. <br />
<br />
== Installation ==<br />
It is available as {{Pkg|webfs}}.<br />
<br />
== Configuration ==<br />
The configuration file is {{ic|/etc/conf.d/webfsd}}. You need to create an {{ic|index.html}} file if you want to make it web browser readable, and point to {{ic|index.html}} in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for downloading programs in an embedded Linux install.<br />
<br />
An example {{ic|/etc/conf.d/webfsd}}.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
<br />
\ <head><title>192.168.1.1:8080/index.html/</title></head> <br />
<br />
<body bgcolor=white text=black link=darkblue vlink=firebrick alink=red><br />
<br />
<h1>Local Network File Server<a href="/"></a><a href="/">Index</a></h1><hr noshade size=1><pre><br />
<br />
<b>access user group date size name</b><br />
<br />
drwxr-xr-x 1000 1000 Aug 17 2015 &lt;DIR&gt; <a href="../">..</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 3236 B <a href="flash_erase">flash_erase2</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 3236 B <a href="fw_printenv">fw_printenv</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="fw_setenv">fw_setenv</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="nanddump">nanddump</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="nandwrite">nandwrite</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="wget">wget</a><br />
<br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="bin">bin</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="etc">etc</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="lib">lib</a><br />
<br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="sample">sample</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
<br />
<br />
<br />
____________________________________________________________<br />
<br />
wget examples: <br />
<br />
wget 192.168.2.2/nanddump <br />
wget 192.168.2.2/etc/ipkg.conf <br />
wget -r -nd http://whatever.com/~popular/page/ <br />
<br />
-r = retrieve recursively <br />
-nd = not create directories <br />
<br />
</pre><hr noshade size=1><br />
<br />
<small> Arch Linux / Server = <a href="http://bytesex.org/webfs.html"> webfs/1.21 </a> &nbsp; 05/Jun/2017 13:55:19 GMT</small><br />
</body></small><br />
</body></nowiki><br />
<br />
== See also ==<br />
* {{ic|man webfsd}}[https://manned.org/webfsd.1]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=479273User:Jeff story/Webfs2017-06-05T16:50:37Z<p>Jeff story: a better, that matches auto generated pages, example</p>
<hr />
<div>[[Category:Web server]]<br />
[[ja:Webfs]]<br />
[http://linux.bytesex.org/misc/webfs.html Webfs] is a simple http server for mostly static content. <br />
<br />
== Installation ==<br />
It is available as {{Pkg|webfs}}.<br />
<br />
== Configuration ==<br />
The configuration file is {{ic|/etc/conf.d/webfsd}}. You need to create an {{ic|index.html}} file if you want to make it web browser readable, and point to {{ic|index.html}} in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for downloading programs in an embedded Linux install.<br />
<br />
An example {{ic|/etc/conf.d/webfsd}}.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
<head><title>192.168.2.2:80/index.html/</title></head><br />
<br />
<body bgcolor=white text=black link=darkblue vlink=firebrick alink=red><br />
<br />
<h1>Local Network File Server<a href="/"></a> <a href="/">Index</a> </h1> <hr noshade size=1> <pre><br />
<br />
<b>access user group date size name</b><br />
<br />
drwxr-xr-x 1000 1000 Aug 17 2015 &lt;DIR&gt; <a href="../">..</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 3236 B <a href="flash_erase">flash_erase2</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 3236 B <a href="fw_printenv">fw_printenv</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="fw_setenv">fw_setenv</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="nanddump">nanddump</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="nandwrite">nandwrite</a><br />
-rwxr-xr-x 1000 1000 Feb 15 2016 4248 B <a href="wget">wget</a><br />
<br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="bin">bin</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="etc">etc</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="lib">lib</a><br />
<br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="sample">sample</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
-rwxr-xr-x 1000 1000 June 5 2017 0000 B <a href="actual file name">web name</a><br />
<br />
<br />
<br />
____________________________________________________________<br />
<br />
wget examples: <br />
<br />
wget 192.168.2.2/nanddump <br />
wget 192.168.2.2/etc/ipkg.conf <br />
wget -r -nd http://whatever.com/~popular/page/ <br />
<br />
-r = retrieve recursively <br />
-nd = not create directories <br />
<br />
</pre><hr noshade size=1><br />
<br />
<small> Arch Linux / Server = <a href="http://bytesex.org/webfs.html"> webfs/1.21 </a> &nbsp; 05/Jun/2017 13:55:19 GMT</small><br />
</body></small><br />
</body></nowiki><br />
<br />
== See also ==<br />
* {{ic|man webfsd}}[https://manned.org/webfsd.1]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=478198User:Jeff story/Webfs2017-05-24T16:13:02Z<p>Jeff story: add link to online man page</p>
<hr />
<div>[[Category:Web server]]<br />
[[ja:Webfs]]<br />
[http://linux.bytesex.org/misc/webfs.html Webfs] is a simple http server for mostly static content. <br />
<br />
== Installation ==<br />
It is available as {{Pkg|webfs}}.<br />
<br />
== Configuration ==<br />
The configuration file is {{ic|/etc/conf.d/webfsd}}. You need to create an {{ic|index.html}} file if you want to make it web browser readable, and point to {{ic|index.html}} in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for downloading programs in an embedded Linux install.<br />
<br />
An example {{ic|/etc/conf.d/webfsd}}.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
An {{ic|index.html}} example.<br />
<br />
<nowiki><!DOCTYPE HTML><br />
<html><br />
<head><br />
<title>Downloads</title><br />
</head><br />
<body><br />
<h>Local network File Server</h><br />
<table><tr><th></th><br />
<th><a href="./">Program</a></th><br />
<th><a href="?C=M;O=A"></a></th><br />
<th><a href="?C=S;O=A"></a></th><br />
<th><a href="?C=D;O=A"></a></th></tr><br />
<tr><th colspan="5"><hr></th></tr><br />
<br />
<tr><td valign="top"></td><td><a href="flash_erase">flash_erase</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_printenv">fw_printenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_setenv">fw_setenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="nanddump">nanddump</a><br />
<br />
<tr><td valign="top"></td><td><a href="nandwrite">nandwrite</a><br />
<br />
<tr><th colspan="5"><hr></th></tr><br />
</table><br />
<br />
<address>webfs 1.21-12 (Arch) Server 192.168.2.2 Port 80</address><br />
</body></html></nowiki><br />
<br />
== See also ==<br />
* {{ic|man webfsd}}[https://manned.org/webfsd.1]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456184User:Jeff story/Webfs2016-11-06T22:09:43Z<p>Jeff story: clarify</p>
<hr />
<div>Webfs is a simple http server for mostly static content. It is available in the Arch community repo.<br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for downloading programs in an embedded Linux install.<br />
<br />
An example /etc/conf.d/webfsd.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
An index.html example.<br />
<br />
<nowiki><!DOCTYPE HTML><br />
<html><br />
<head><br />
<title>Downloads</title><br />
</head><br />
<body><br />
<h>Local network File Server</h><br />
<table><tr><th></th><th><a href="./">Program</a></th><th><a href="?C=M;O=A"></a></th><th><a href="?C=S;O=A"></a></th><th><a href="?C=D;O=A"></a></th></tr><tr><th colspan="5"><hr></th></tr><br />
<br />
<tr><td valign="top"></td><td><a href="flash_erase">flash_erase</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_printenv">fw_printenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_setenv">fw_setenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="nanddump">nanddump</a><br />
<br />
<tr><td valign="top"></td><td><a href="nandwrite">nandwrite</a><br />
<br />
<tr><th colspan="5"><hr></th></tr><br />
</table><br />
<br />
<address>webfs 1.21-12 (Arch) Server 192.168.2.2 Port 80</address><br />
</body></html></nowiki><br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456171User:Jeff story/Webfs2016-11-06T21:41:58Z<p>Jeff story: clarify</p>
<hr />
<div>Webfs is a simple http server for mostly static content. It is available in the Arch community repo.<br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for uploading programs in an embedded Linux install.<br />
<br />
An example /etc/conf.d/webfsd.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
An index.html example.<br />
<br />
<nowiki><!DOCTYPE HTML><br />
<html><br />
<head><br />
<title>Downloads</title><br />
</head><br />
<body><br />
<h>Local network File Server</h><br />
<table><tr><th></th><th><a href="./">Program</a></th><th><a href="?C=M;O=A"></a></th><th><a href="?C=S;O=A"></a></th><th><a href="?C=D;O=A"></a></th></tr><tr><th colspan="5"><hr></th></tr><br />
<br />
<tr><td valign="top"></td><td><a href="flash_erase">flash_erase</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_printenv">fw_printenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_setenv">fw_setenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="nanddump">nanddump</a><br />
<br />
<tr><td valign="top"></td><td><a href="nandwrite">nandwrite</a><br />
<br />
<tr><th colspan="5"><hr></th></tr><br />
</table><br />
<br />
<address>webfs 1.21-12 (Arch) Server 192.168.2.2 Port 80</address><br />
</body></html></nowiki><br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456170User:Jeff story/Webfs2016-11-06T21:41:15Z<p>Jeff story: clarify</p>
<hr />
<div>Webfs is a simple http server for mostly static content. It is available in the Arch community repo.<br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for uploading programs to an embedded Linux install.<br />
<br />
An example /etc/conf.d/webfsd.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
An index.html example.<br />
<br />
<nowiki><!DOCTYPE HTML><br />
<html><br />
<head><br />
<title>Downloads</title><br />
</head><br />
<body><br />
<h>Local network File Server</h><br />
<table><tr><th></th><th><a href="./">Program</a></th><th><a href="?C=M;O=A"></a></th><th><a href="?C=S;O=A"></a></th><th><a href="?C=D;O=A"></a></th></tr><tr><th colspan="5"><hr></th></tr><br />
<br />
<tr><td valign="top"></td><td><a href="flash_erase">flash_erase</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_printenv">fw_printenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_setenv">fw_setenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="nanddump">nanddump</a><br />
<br />
<tr><td valign="top"></td><td><a href="nandwrite">nandwrite</a><br />
<br />
<tr><th colspan="5"><hr></th></tr><br />
</table><br />
<br />
<address>webfs 1.21-12 (Arch) Server 192.168.2.2 Port 80</address><br />
</body></html></nowiki><br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456168User:Jeff story/Webfs2016-11-06T21:37:49Z<p>Jeff story: add examples</p>
<hr />
<div>Webfs is a simple http server for mostly static content. It is available in the Arch community repo.<br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
The examples below are a local network server, used for working on an embedded Linux install.<br />
<br />
An example /etc/conf.d/webfsd.<br />
<br />
<nowiki><br />
#<br />
# Parameters passed to webfsd(1)<br />
#<br />
<br />
WEBFSD_ARGS="-p 80 -u nobody -R /home/jeff/www -f index.html"<br />
<br />
</nowiki><br />
An index.html example.<br />
<br />
<nowiki><!DOCTYPE HTML><br />
<html><br />
<head><br />
<title>Downloads</title><br />
</head><br />
<body><br />
<h>Local network File Server</h><br />
<table><tr><th></th><th><a href="./">Program</a></th><th><a href="?C=M;O=A"></a></th><th><a href="?C=S;O=A"></a></th><th><a href="?C=D;O=A"></a></th></tr><tr><th colspan="5"><hr></th></tr><br />
<br />
<tr><td valign="top"></td><td><a href="flash_erase">flash_erase</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_printenv">fw_printenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="fw_setenv">fw_setenv</a><br />
<br />
<tr><td valign="top"></td><td><a href="nanddump">nanddump</a><br />
<br />
<tr><td valign="top"></td><td><a href="nandwrite">nandwrite</a><br />
<br />
<tr><th colspan="5"><hr></th></tr><br />
</table><br />
<br />
<address>webfs 1.21-12 (Arch) Server 192.168.2.2 Port 80</address><br />
</body></html></nowiki><br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456167User:Jeff story/Webfs2016-11-06T20:59:25Z<p>Jeff story: add available in repo</p>
<hr />
<div>Webfs is a simple http server for mostly static content. It is available in the Arch community repo.<br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It is set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User:Jeff_story/Webfs&diff=456166User:Jeff story/Webfs2016-11-06T20:56:21Z<p>Jeff story: Create a new page.</p>
<hr />
<div>Webfs is a simple http server for mostly static content. <br />
<br />
The configuration file is /etc/conf.d/webfsd. You need to create an index.html file if you want to make it web browser readable, and point to index.html in the configuration file.<br />
<br />
It's set up for systemd. Use systemctl to start, stop, enable, disable webfsd.service.<br />
<br />
<br />
<br />
See: man webfsd<br />
<br />
http://linux.bytesex.org/misc/webfs.html</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=User_talk:Jeff_story/Webfs&diff=456165User talk:Jeff story/Webfs2016-11-06T20:43:48Z<p>Jeff story: Created page with "Not much info available on this. Please fix what I get wrong and add to it.--~~~~"</p>
<hr />
<div>Not much info available on this. Please fix what I get wrong and add to it.--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 20:43, 6 November 2016 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406040Talk:Ratpoison2015-10-21T21:29:50Z<p>Jeff story: </p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
{{Unsigned|22:21, 21 October 2015|Jeff story}}<br />
<br />
:I'll say this once: refrain from making baseless accusations, and focus on the article. <br />
:As to the section, it won't work as /usr/share is not user-writeable - either use a root prompt (#), or replace the ''cd'' with ''cp''. There's also {{ic|unrat.c}}. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:46, 21 October 2015 (UTC)<br />
<br />
<br />
::Alad, Thank you and advice taken. I wasn't aware of unrat.c. I found info on mouse usage in ratpoison practically nonexistent. Ratpoison is old and possibly uncommonly used today, not to mention with mouse? Have you tried or used unrat.c? I'd be interested in how it differs from sloppy. If not, I'll have to test it.<br />
::--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:23, 21 October 2015 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406037Talk:Ratpoison2015-10-21T21:27:31Z<p>Jeff story: /* To enable focus follows mouse: */</p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
{{Unsigned|22:21, 21 October 2015|Jeff story}}<br />
<br />
:I'll say this once: refrain from making baseless accusations, and focus on the article. <br />
:As to the section, it won't work as /usr/share is not user-writeable - either use a root prompt (#), or replace the ''cd'' with ''cp''. There's also {{ic|unrat.c}}. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:46, 21 October 2015 (UTC)<br />
<br />
<br />
<br />
::Thank you and advice taken.<br />
::--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:00, 21 October 2015 (UTC)<br />
<br />
:::Alad, I wasn't aware of unrat.c. I found info on mouse usage in ratpoison practically nonexistent. Ratpoison is old and possibly uncommonly used today? Have you tried or used unrat.c? I'd be interested in how it differs from sloppy. If not, I'll have to test it.<br />
:::--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:23, 21 October 2015 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406034Talk:Ratpoison2015-10-21T21:24:26Z<p>Jeff story: </p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
{{Unsigned|22:21, 21 October 2015|Jeff story}}<br />
<br />
:I'll say this once: refrain from making baseless accusations, and focus on the article. <br />
:As to the section, it won't work as /usr/share is not user-writeable - either use a root prompt (#), or replace the ''cd'' with ''cp''. There's also {{ic|unrat.c}}. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:46, 21 October 2015 (UTC)<br />
<br />
<br />
<br />
Thank you and advice taken.<br />
--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:00, 21 October 2015 (UTC)<br />
<br />
I wasn't aware of unrat.c. I found info on mouse usage in ratpoison practically nonexistent. Ratpoison is old and possibly uncommonly used today? Have you tried or used unrat.c? I'd be interested in how it differs from sloppy. If not, I'll have to test it.--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:23, 21 October 2015 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406032Talk:Ratpoison2015-10-21T21:01:50Z<p>Jeff story: /* To enable focus follows mouse: */</p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
{{Unsigned|22:21, 21 October 2015|Jeff story}}<br />
<br />
:I'll say this once: refrain from making baseless accusations, and focus on the article. <br />
:As to the section, it won't work as /usr/share is not user-writeable - either use a root prompt (#), or replace the ''cd'' with ''cp''. There's also {{ic|unrat.c}}. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:46, 21 October 2015 (UTC)<br />
<br />
<br />
<br />
Thank you and advice taken.<br />
--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:00, 21 October 2015 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406031Talk:Ratpoison2015-10-21T21:00:15Z<p>Jeff story: /* To enable focus follows mouse: */</p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
{{Unsigned|22:21, 21 October 2015|Jeff story}}<br />
<br />
:I'll say this once: refrain from making baseless accusations, and focus on the article. <br />
:As to the section, it won't work as /usr/share is not user-writeable - either use a root prompt (#), or replace the ''cd'' with ''cp''. There's also {{ic|unrat.c}}. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 20:46, 21 October 2015 (UTC)<br />
--[[User:Jeff story|Jeff story]] ([[User talk:Jeff story|talk]]) 21:00, 21 October 2015 (UTC)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406030Ratpoison2015-10-21T20:58:21Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
# cd /usr/share/ratpoison/<br />
# gcc -o sloppy sloppy.c -lX11<br />
# ./sloppy<br />
<br />
To enable it upon ratpoison startup, put the following in ~/.ratpoisonrc<br />
<br />
exec /usr/share/ratpoison/sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406029Ratpoison2015-10-21T20:54:47Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ ./sloppy<br />
<br />
To enable it upon ratpoison startup, put the following in ~/.ratpoisonrc<br />
<br />
exec /usr/share/ratpoison/sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406028Ratpoison2015-10-21T20:54:11Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ ./sloppy<br />
<br />
To enable it upon ratpoison startup, put the following in ~/.ratpoisonrc<br />
<br />
exec /usr/share/ratpoison/sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406027Ratpoison2015-10-21T20:53:04Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ ./sloppy<br />
<br />
To enable it upon ratpoison startup, put exec /usr/share/ratpoison/sloppy in ~/.ratpoisonrc<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406023Ratpoison2015-10-21T20:33:31Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ ./sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406022Ratpoison2015-10-21T20:32:45Z<p>Jeff story: /* Focus follows mouse */</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in ratpoison. To enable it:<br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Ratpoison&diff=406021Ratpoison2015-10-21T20:30:02Z<p>Jeff story: Add information</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[uk:Ratpoison]]<br />
{{Poor writing|Poor style, duplicate content}}<br />
[http://www.nongnu.org/ratpoison/ Ratpoison] is a tiling [[window manager]] written in C, that allows the user to manage applications without a mouse. The user interface is inspired by [[Screen]].<br />
<br />
== Installation ==<br />
<br />
Ratpoison can be [[installed]] with package {{Pkg|ratpoison}} or {{AUR|ratpoison-git}}{{Broken package link|{{aur-mirror|ratpoison-git}}}} for the development version.<br />
<br />
== Configuration ==<br />
<br />
To use ratpoison as your windowmanager, you have to create/edit the file {{Ic|~/.xinitrc}}.<br />
<br />
Example .xinitrc:<br />
<br />
{{bc|<nowiki><br />
# The black/white grid as background doesn't suit my taste.<br />
xsetroot -solid black &<br />
# Ratpoison is compatible with xcompmgr! now you can have real transparency<br />
xcompmgr -c -f -D 5 &<br />
#fire up ratpoison!<br />
exec /usr/bin/ratpoison<br />
</nowiki>}}<br />
<br />
== Using ratpoison ==<br />
<br />
After X11 starts up you will see a black screen and a little textbox on the upper right of it that says "Welcome to Ratpoison".<br />
Now type {{ic|Ctrl+t}} and then {{ic|?}} to get a list of keybindings. If you are used to GNU screen, you will feel at home very soon.<br />
<br />
You are able to define custom keystrokes and even override existing ones in {{Ic|~/.ratpoisonrc}}<br />
<br />
Example:<br />
<br />
{{bc|<nowiki><br />
# Overriding CTRL+t 'c' to start aterm instead of xterm<br />
bind c exec aterm<br />
<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
So, if you type {{ic|Ctrl+t}} and then {{ic|f}}, ratpoison will fire up Firefox.<br />
<br />
Here is another .ratpoisonrc i'm using on my computers:<br />
<br />
{{bc|<nowiki><br />
exec xsetroot -cursor_name left_ptr<br />
startup_message off<br />
<br />
escape C-z<br />
<br />
# Make a screenshot<br />
alias sshot exec import -window root ~/screenshot-$(date +%F).jpg<br />
definekey top M-C-Print sshot<br />
<br />
#virtual desks<br />
gnewbg one<br />
gnewbg two<br />
<br />
definekey top M-l exec ratpoison -c "select -" -c "gprev" -c "next"<br />
definekey top M-h exec ratpoison -c "select -" -c "gnext" -c "next"<br />
<br />
#switch between windows<br />
definekey top M-j next<br />
definekey top M-k prev<br />
<br />
#apps<br />
unbind c<br />
bind c exec urxvt -tr<br />
#bind c exec aterm<br />
<br />
bind g exec gftp<br />
bind f exec firefox<br />
</nowiki>}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Java Swing Applications ===<br />
<br />
Java Swing GUI applications assume tiling window managers, and don't go to fullscreen properly with the default ratpoison configuration. However, there is a way to "trick" the Java swing window into thinking it's in a tiling window manager and getting it to go to fullscreen correctly.<br />
<br />
First, install the <tt>wmname</tt> package. Then add this line to your <tt>.ratpoisonrc</tt>:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec wmname LG3D<br />
}}<br />
<br />
Voila! Java Swing applications should properly fullscreen now.<br />
<br />
=== Multiple workspaces ===<br />
<br />
By default, ratpoison only has one workspace, but using a script called rpws (installed by default) you can have more.<br />
<br />
Just edit your .ratpoisonrc, and add:<br />
<br />
{{hc|~/.ratpoisonrc|<br />
exec /usr/bin/rpws init 6 -k<br />
}}<br />
<br />
That creates 6 workspaces. By default, you can access to them by using {{ic|Alt+F1}} to access the first, {{ic|Alt+F2}} to access the second, etc.<br />
<br />
You can also add binds to them, like this:<br />
<br />
bind C-1 exec rpws 1<br />
bind C-2 exec rpws 2<br />
...<br />
<br />
That allows to access them with {{ic|Ctrl+t}} {{ic|Ctrl+1}} (assuming {{ic|Ctrl+t}} as your escape key)<br />
<br />
=== Urxvt and xterm ===<br />
<br />
Urxvt and xterm, as they are installed by default, send resize hints to the window manager. This works in most tiling window managers, but not in ratpoison. The end result is that URxvt/xterm resizes itself in multiples of the font size, rather than resizing to the whole screen, and chances that there are unfilled gaps are high. There are two solutions to this problem, documented below.<br />
<br />
==== Install a Patched URxvt ====<br />
<br />
If you use URxvt, the {{AUR|rxvt-unicode-fontspacing-noinc-vteclear-secondarywheel}} package, among other improvements, sends no resize hints to the window manager. If you install this version of URxvt rather than the default, URxvt will resize properly within ratpoison.<br />
<br />
==== Adjust the Border ====<br />
<br />
We can use the xterm/urxvt option internalBorder and set the border of ratpoison to 0.<br />
<br />
A trial and error process must be done to find the exact number of internalBorder for each combination of resolution and font size. (the border of ratpoison must be set to 0 before doing the tests)<br />
The term command line option -b can be used to test for the correct number and then can be saved on the following files.<br />
<br />
{{hc|~/.Xresources|<br />
urxvt*internalBorder: 8 #change urxvt to xterm if necessary. Using the font terminus in urxvt at 14px size, 8 is the correct number here.<br />
}}<br />
{{hc|~/.ratpoisonrc|<br />
set border 0<br />
}}<br />
<br />
If a combination cannot be found, you could try changing the font size and the font family also. (that changes the required border number)<br />
<br />
=== Launch on startup ===<br />
<br />
Examples for launching programs when ratpoison starts. File {{ic|~/.ratpoisonrc}} is executed by ratpoison on startup.<br />
<br />
{{hc|Launch urxvt with a tmux session|<nowiki><br />
exec urxvt -e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"<br />
</nowiki>}}<br />
<br />
{{hc|Launch optimized chromium|<nowiki><br />
exec bash -c 'pidof chromium &>/dev/null || exec /usr/bin/chromium --disk-cache-dir=~/tmp/cache'<br />
</nowiki>}}<br />
<br />
=== Wallpaper and transparency ===<br />
<br />
Example for setting transparency using [[xcompmgr]] and nitrogen.<br />
First start nitrogen and set the desired wallpaper. Then use this in your .ratpoisonrc<br />
<br />
{{hc|Wallpaper and transparency|<nowiki><br />
exec xcompmgr -c -f -D 5 &<br />
exec nitrogen --restore</nowiki><br />
}}<br />
<br />
== Useful keybindings ==<br />
<br />
<br />
{| class="wikitable"<br />
| {{ic|Ctrl+t}} {{ic|!}} <''Program Name''> Start any program<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|?}} Show key bindings<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|c}} Start an X terminal<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|n}} Switch to next window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|p}} Switch to previous window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|1}}-{{ic|9}} Switch to windows 1-9<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|k}} Close the current window<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+k}} XKill the current application<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|s}},{{ic|Shift+s}} Split the current frame into two vertical,horizontal ones<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Tab}}, {{ic|←}}, {{ic|↑}}, {{ic|→}}, {{ic|↓}} Switch to the next, left. top, right, bottom frame.<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|Shift+q}} Make the current frame the only one<br />
|-<br />
| {{ic|Ctrl+t}} {{ic|:}} Execute a ratpoison command<br />
|}<br />
<br />
==Focus follows mouse==<br />
<br />
The Arch linux ratpoison package installs the build script, sloppy.c, in /usr/share/ratpoison/. It can be used to enable focus follows mouse in the applications running within ratpoison. To enable it:<br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
<br />
<br />
== Ratpoison and display managers ==<br />
<br />
Many [[display manager|display managers]] (e.g., [[LightDM]]) source the available sessions from {{ic|/usr/share/xsessions/}} and most window managers and desktop environments create .desktop files there. However ratpoison instead creates a {{ic|ratpoison.desktop}} file in {{ic|/etc/X11/sessions/}}. To allow display managers to find ratpoison one may need to copy the ratpoison.desktop file from {{ic|/etc/X11/sessions/ratpoison.desktop}} to {{ic|/usr/share/xsessions/ratpoison.desktop}}. If the {{ic|/usr/share/xsessions}} directory does not exist, create it as root.<br />
<br />
== See also ==<br />
<br />
* [http://ratpoison.wxcvbn.org/ The Ratpoison wiki]<br />
* [http://stumpwm.svkt.org/cgi-bin/ratpoison.pl?action=browse;id=keys X11 Keys in Ratpoison]<br />
* [http://www.ormiret.com/?q=node/11 Ratpoison config sample]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68622 Share your Ratpoison (experience) forum thread]<br />
* [https://github.com/jbaber/ratpoison_scripts Collection of scripts for the Ratpoison window manager]<br />
* [http://www.nongnu.org/stumpwm/ Stumpwm - a successor to Ratpoison written in Common lisp]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406020Talk:Ratpoison2015-10-21T20:21:50Z<p>Jeff story: </p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406019Talk:Ratpoison2015-10-21T20:21:31Z<p>Jeff story: </p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
[code]<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy<br />
[/code]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:Ratpoison&diff=406018Talk:Ratpoison2015-10-21T20:20:17Z<p>Jeff story: /* To enable focus follows mouse: */ new section</p>
<hr />
<div>== To enable focus follows mouse: ==<br />
<br />
I'd like to add this info to the wiki. Since it's actually useful and includes commands, it will likely get deleted based on past wiki admin behavior. <br />
<br />
Possibly this comment could be allowed remain in place? <br />
<br />
$ cd /usr/share/ratpoison/<br />
$ gcc -o sloppy sloppy.c -lX11<br />
$ /usr/share/ratpoison/sloppy</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Arch_based_distributions_(active)&diff=335592Arch based distributions (active)2014-09-14T22:27:13Z<p>Jeff story: updated links to reflect project updates</p>
<hr />
<div>[[Category:About Arch]]<br />
[[es:Arch Based Distributions (Active)]]<br />
[[fr:LiveCD]]<br />
[[it:ArchBang]]<br />
[[ja:Arch Based Distributions (Active)]]<br />
[[ru:Arch Based Distributions (Active)]]<br />
[[zh-CN:Arch Based Distributions (Active)]]<br />
{{Related articles start}}<br />
{{Related|Arch based distributions (inactive)}}<br />
{{Related articles end}}<br />
== Specialty distributions ==<br />
<br />
This list includes distributions that use Arch Linux [[official repositories]] and generally follow the [[The Arch Way]]<br />
<br />
=== Antergos ===<br />
<br />
Antergos is an elegant and very customizable system for the desktop, and even as a server with the 'base' install. <br />
<br />
It started life under the name of Cinnarch, combining the Cinnamon desktop with the Arch Linux distribution, but the project has moved on from its original goals and now offers a choice of several desktops, including: KDE, GNOME 3 (default), MATE, Cinnamon, Openbox and Xfce.<br />
<br />
Antergos is Archlinux-based via Arch's repositories and can be installed by booting the live ISO image and using its graphical installer, Cnchi.<br />
<br />
*Homepage: http://antergos.com/<br />
*Forums: http://forum.antergos.com/<br />
*IRC: irc://irc.freenode.net/antergos<br />
*Wiki: http://wiki.antergos.com/<br />
*Screenshots: http://www.linuxscreenshots.org/?distro=antergos<br />
<br />
=== ArchAssault ===<br />
<br />
ArchAssault, everything you love about Arch Linux but with the security professional and hackers in mind. Currently supporting i686, x86_64, armv6h, armv7h. You can use the installer ISO or just add the repo to your existing Arch Linux install. It is simple to add and remove the repo as you need and get back to a clean Vanilla Arch install. There is an ever growing list of tools and follow the Arch standards.<br />
<br />
The ARM line is to help you build the security devices of your dreams with many Open Source devices on the market. The project also supports some of the Open Source AutoPilot hardware out there. This will allow you to add a payload brain to your drones with ease and add capabilities.<br />
<br />
*Homepage: https://archassault.org/<br />
*IRC: irc://irc.freenode.net/ArchAssault<br />
*Wiki: http://wiki.archassault.org/<br />
<br />
=== ArchBang ===<br />
<br />
ArchBang LIVE CD = Arch Linux w/ Openbox (the name is inspired by CrunchBang Linux, which is Debian Linux w/ Openbox)<br />
<br />
*Homepage: http://www.archbang.org/<br />
*Forums: http://bbs.archbang.org/<br />
*IRC: irc://irc.freenode.net/archbang<br />
*Wiki: http://wiki.archbang.org/<br />
*Screenshots: http://www.linuxscreenshots.org/?distro=archbang<br />
<br />
=== ArchEX ===<br />
<br />
ArchEX, based on Arch Linux, is one of the Linux Live DVDs created by C.A. Exton, the desktop environment of which is LXDE.<br />
<br />
*Homepage: http://archex.exton.net/<br />
<br />
=== BBQLinux ===<br />
<br />
BBQLinux is a user-friendly Linux distribution made for Android developers and everyone who prefers a ready-to-use system. It has everything on board to build AOSP or AOSP-based Distributions like OmniROM or CyanogenMod.<br />
The default desktop environment is "MATE". It is using vanilla Arch repos, the AUR and a BBQLinux specific repo.<br />
BBQLinux can be installed by booting the Live DVD and using our graphical Installer called "BBQLinux Installer". <br />
<br />
*Homepage: http://bbqlinux.org/<br />
*IRC: irc://irc.freenode.net/bbqlinux<br />
*Screenshots: http://bbqlinux.org/screenshots<br />
<br />
=== BlackArch Linux ===<br />
<br />
BlackArch Linux is a distribution for pentesters and security researchers. It supports over 600 tools and a live ISO with multiple window managers. The BlackArch package repository is compatible with normal/existing/your Arch installations.<br />
<br />
*Homepage http://blackarch.org/<br />
*IRC irc://irc.freenode.net/blackarch<br />
*Documentation: http://blackarch.org/guide.html<br />
<br />
=== Bluestar Linux ===<br />
<br />
Bluestar Linux is targeted at the desktop and is mainly focused on providing a user-friendly KDE environment with a full suite of graphical tools and applications. Out-of-the-box, both editions provide multilingual support that spans the globe. The Bluestar Full Edition provides a complete development environment and an augmented multimedia, networking, graphics and office tool-set. Both editions also have correlated versions supporting the Intel GMA3600 (GMA500) GPU at a 1024x600 native resolution by default, and other resolutions via configuration. Although still under development, Bluestar Linux easily supports everyday use, and changes and updates are documented on a regular basis. Fixes are always incorporated into subsequent releases which occur at least twice a month.<br />
<br />
*Homepage: http://bluestarlinux.org/<br />
*Forums: http://bluestarlinux.org/index.php?action=forum<br />
*Documentation: http://bluestarlinux.org/index.php?action=articles<br />
*Screenshots: http://bluestarlinux.org/index.php?action=gallery<br />
<br />
=== Bridge Linux ===<br />
<br />
Bridge Linux is an Arch-based distro providing a workable OS out-of-the-box, while still using vanilla Arch repos and the AUR. Possible desktop environments at this time are LXDE, Openbox, GNOME, Cinnamon, Xfce, and KDE.<br />
<br />
*Homepage: http://millertechnologies.net<br />
*Forums: http://millertechnologies.net/forum<br />
*Screenshots: http://www.linuxscreenshots.org/?distro=bridge<br />
<br />
=== CTKArch ===<br />
<br />
Formerly CTKArchLive. A lightweight Arch-based liveCD using c²DE (openbox) that includes English and French locales.<br />
<br />
*Homepage: http://ctkarch.org/<br />
<br />
=== Evo/Lution Linux ===<br />
<br />
Evo is the live CD based on Arch Linux that cannot be installed. It is simply a platform to run the net-based Lution-AIS installer which downloads the latest packages from the Arch repositories to provide the most up-to-date system possible. Forked from the AIS and AUI scripts developed by helmuthdu, Lution-AIS is a powerful command-line installer that provides multiple desktop environments / window managers, display managers, network managers, and boot options.<br />
<br />
*Homepage: http://www.evolutionlinux.com<br />
*Forums: http://www.evolutionlinux.com/forums/index.php<br />
*Wiki: http://www.evolutionlinux.info<br />
<br />
=== TalkingArch ===<br />
<br />
TalkingArch is respin of the Arch Linux live CD/USB image modified to include speech and braille output for blind and visually impaired users.<br />
<br />
*Homepage: http://talkingarch.tk/<br />
<br />
== Ports to other kernels or architectures ==<br />
<br />
This list includes distributions that does not use Arch Linux's [[official repositories]], because of used kernel or hardware architecture but generally follow [[The Arch Way]]<br />
<br />
=== Arch BSD ===<br />
<br />
Arch BSD began in July 2010 in which an attempt to bring pacman to FreeBSD, to ease the pain of upgrading and maintaining a system with ports, or from outdated packages.<br />
Following [[The Arch Way]] philosophy, Arch BSD is lightweight, flexible, simple and aims to be very UNIX-like.<br />
<br />
*Homepage: http://www.archbsd.net/<br />
*Forums: https://bbs.archbsd.net/<br />
*IRC: irc://irc.freenode.net/archbsd<br />
*Wiki: https://wiki.archbsd.net/<br />
<br />
=== Arch Linux ARM ===<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=117251 Arch Linux ARM is the new unified effort from PlugApps & ArchMobile].<br />
<br />
*Homepage: http://archlinuxarm.org/<br />
*Forums: http://archlinuxarm.org/forum/<br />
*IRC: irc://irc.freenode.net/archlinux-arm<br />
<br />
=== MSYS2 ===<br />
<br />
''"MSYS2 is an updated, modern version of MSYS, both of which are Cygwin (POSIX compatibility layer) forks with the aim of better interoperability with native Windows software.''<br />
<br />
''The name is a contraction of Minimal SYStem 2, and aims to provide support to facilitate using the bash shell, Autotools, revision control systems and the like for building native Windows applications using MinGW-w64 toolchains.''<br />
<br />
''We wanted a package management system to provide easy installation of packages, and ported Arch Linux's Pacman. This brings many powerful features such as dependency resolution and simple complete system upgrades, as well as providing the build system (makepkg) which is used to make these packages."''<br />
<br />
:Source: [http://sourceforge.net/projects/msys2/ MSYS2 | SourceForge.net]<br />
<br />
*Homepage: http://sourceforge.net/p/msys2/<br />
*Forums: http://sourceforge.net/p/msys2/discussion/<br />
*Wiki: http://sourceforge.net/p/msys2/wiki/<br />
*Screenshots: http://msys2.github.io/<br />
<br />
=== Parabola GNU/Linux ===<br />
<br />
Parabola GNU/Linux is a fully free (as in freedom) distribution [http://www.gnu.org/distros/free-distros.html approved by the Free Software Foundation]. It's packages are optimized for i686, x86_64, and Loongson 2F (mips64el) CPUs.<br />
<br />
Parabola uses [https://wiki.parabolagnulinux.org/Repositories its own repositories], which are almost identical to Arch's [[official repositories]], but with non-free or problematic packages removed (see [https://repo.parabolagnulinux.org/docs/blacklist.txt blacklist] for difference) and other free software replacements available.<br />
<br />
*Homepage: http://parabolagnulinux.org/<br />
*Wiki: http://wiki.parabolagnulinux.org/<br />
*IRC: irc://irc.freenode.net/parabola<br />
<br />
== Meta distributions ==<br />
<br />
=== Archiso ===<br />
<br />
[[Archiso]] is a very simple set of bash scripts that allow for building live bootable CD/DVD/USB images based on Arch Linux. It uses a small uncomplicated code base and is actively developed. archiso is the tool used by Arch Linux to generate the official CD/USB images. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, to install disks, to special interest live systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. <br />
<br />
*Documentation: [[Archiso|Archiso - ArchWiki]]<br />
<br />
== Live distributions ==<br />
<br />
=== alphaOS ===<br />
<br />
alphaOS is a simple and minimalistic Linux distribution for the x86-64 architecture, built using Linux Live Kit set of scripts developed by Tomas M. It is based on Arch Linux and uses pacman as the default package manager. This operating system features highly configurable and lightweight Openbox window manager. Modular by design, alphaOS makes it easy to add desired functionality.<br />
<br />
*Homepage: http://alphaos.tuxfamily.org/<br />
*Forums: http://alphaos.tuxfamily.org/forum/<br />
*Screenshots: [http://alphaos.tuxfamily.org/forum/viewtopic.php?f=13&t=705 forum thread]<br />
<br />
=== Archboot ===<br />
<br />
Archboot is designed for installation or rescue operations. It provides both the i686 and x86_64 architectures on one CD. It uses hwdetect and a different install script from the official Arch Linux install images. It runs in RAM using iniramfs, without any special filesystems like squashfs,<br />
thus it is limited to the RAM which is installed in your system.<br />
<br />
*Documentation: [[Archboot|Archboot - ArchWiki]]<br />
<br />
=== DidJiX ===<br />
<br />
DidJiX is the free and open source digital DJ software Mixxx (http://www.mixxx.org/) powered by the simple and lightweight distribution Linux ArchLinux (https://www.archlinux.org/) on a usb live system! DidJiX is build with the Archiso project ([[Archiso]])<br />
<br />
*Homepage: http://easy.open.and.free.fr/didjix/<br />
*Screenshots: http://easy.open.and.free.fr/didjix/screenshots.html<br />
<br />
=== PoliArch ===<br />
<br />
PoliArch is an Italian distribution and live CD featuring a number of system rescue and data recovery tools.<br />
<br />
*Homepage: http://www.poliarch.org/<br />
*Screenshots: http://www.linuxscreenshots.org/?distro=poliarch<br />
<br />
== Arch-influenced distributions ==<br />
<br />
===Alpine Linux===<br />
<br />
Alpine Linux is a run-from-RAM linux distribution. Its original target was small appliances like routers, VPN gateways, or embedded x86 devices. However, it supports hosting other Linux guest OSes under VServer control, making it an attractive hosting solution as well. Though Alpine Linux may not actually be based on Arch, its [http://git.alpinelinux.org/cgit/aports/tree/main/abuild/APKBUILD build system] is heavily inspired by Arch's. [http://lists.busybox.net/pipermail/busybox/2009-January/068280.html 2][http://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&oldid=2701#depends_.26_makedepends 3]<br />
<br />
*Homepage: http://alpinelinux.org/<br />
*Forums: http://alpinelinux.org/forum/<br />
*IRC: irc://irc.freenode.net/alpine-linux<br />
*Wiki: http://wiki.alpinelinux.org/<br />
<br />
=== Chakra ===<br />
<br />
Chakra is a distribution heavily geared towards KDE4. The fresh install is GTK-free. All GTK apps are installed in a sandbox-like environment known as [http://chakraos.org/wiki/index.php?title=Bundles bundles]. The project seeks for ease of use, using several home-grown graphical utilites for installing and maintanence. Warning: it is still under heavy development, nevertheless it is already suitable for everyday use. Expect some changes in the base system in the near future, like switching from Pacman to Akabei.<br />
<br />
*Homepage: http://chakraos.org/<br />
*Forums: http://chakraos.org/forum/<br />
*IRC: irc://irc.freenode.net/chakra<br />
*Wiki: http://chakraos.org/wiki/<br />
*Screenshots: http://www.linuxscreenshots.org/?distro=chakra<br />
<br />
=== Enlisy ===<br />
<br />
Enlisy is an i686 optimized Linux distribution for Pentium 2 based processors and higher. It is also as simple as possible when it comes to the construction of its underlying core. Enlisy uses its own package manager Apport, which is is based on Libpysrc and Libpypac, which are inspired by Arch's package manager Pacman. Enlisy also uses InitNG for the init system.<br />
<br />
*Homepage: http://www.enlisy.net/en/<br />
<br />
=== Frugalware ===<br />
<br />
''"Frugalware Linux is a general-purpose Linux distribution designed for intermediate users who are familiar with command-line operations. It is based on Slackware, but uses a different package management system, Pacman."''<br />
<br />
:Source: [[Wikipedia:Frugalware|Wikipedia]]<br />
<br />
*Homepage: http://frugalware.org/<br />
*Forums: http://forums.frugalware.org/<br />
*IRC: irc://irc.freenode.net/frugalware<br />
*Wiki: http://wiki.frugalware.org/<br />
*Documentation: http://frugalware.org/docs/<br />
*Screenshots: http://frugalware.org/screenshots/<br />
<br />
=== KaOS ===<br />
<br />
''"The idea behind KaOS is to create a tightly integrated rolling and transparent distribution for the modern desktop, build from scratch with a very specific focus. Focus on one DE (KDE), one toolkit (Qt), one architecture (x86_64) plus a focus on evaluating and selecting the most suitable tools and applications. All work is geared toward packaging, not developing new tools or applications."''<br />
<br />
:Source: [http://kaosx.us/ KaOS A lean KDE distribution]<br />
<br />
*Homepage: http://kaosx.us/<br />
*Forums: http://kaosx.us/phpBB3/<br />
*IRC: irc://irc.freenode.net/kaosx<br />
*Screenshots: http://kaosx.us/gallery/<br />
<br />
=== LinHES ===<br />
<br />
LinHES ('''Lin'''ux '''H'''ome '''E'''ntertainment '''S'''ystem) is a distro based heavily on Arch and centered around [http://mythtv.org MythTV], with the expressed goal of being a HES-appliance. Utilizing open source software and off the shelf hardware, you'll be able to assemble a box that can serve as a PVR, Jukebox, Image Viewer, and Game Station. Users can go from a blank hard drive to fully functional MythTV system in literally 15-20 min. For more information, please see the [[LinHES]] wikipage.<br />
<br />
*Homepage: http://linhes.org/<br />
*Forums: http://forum.linhes.org/<br />
*Wiki: http://linhes.org/<br />
<br />
=== Manjaro Linux ===<br />
<br />
Manjaro Linux is a user friendly distribution based on the Xfce, KDE, and Openbox environments. The LXDE, Cinnamon, GNOME, i3, MATE and e17 environments are supported by the Community. It comes with a custom installer and additional scripts to install a preconfigured and out of the box working system.<br />
<br />
*Homepage: http://manjaro.org/<br />
*Forums: http://forum.manjaro.org/<br />
*IRC: irc://irc.freenode.net/manjaro<br />
*Wiki: http://wiki.manjaro.org/<br />
<br />
=== Mesk Linux ===<br />
<br />
Mesk Linux is a project aiming at showcasing Arch to Arabic-speaking users . The project is also working on localizing Arch tools and documentation, providing a varitey of installable live mediums (usb, dvds ... ). The distro is using OpenRC.<br />
<br />
*Homepage: http://mesklinux.org/<br />
*Forums: http://forum.mesklinux.org/<br />
*Wiki: http://wiki.mesklinux.org/</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Talk:NetworkManager&diff=291207Talk:NetworkManager2014-01-01T04:52:45Z<p>Jeff story: /* DHCP service is enabled by default */ new section</p>
<hr />
<div>== GNOME 3 and nm-applet ==<br />
<br />
Looks like GNOME 3 doesn't need nm-applet any more. Moreover, it competes with the shell's network agent for new connections. Does anyone copy this? Should this be mentioned on the page?<br />
<br />
== DHCP service is enabled by default ==<br />
<br />
https://wiki.archlinux.org/index.php/Installation_Guide#Connect_to_the_internet<br />
<br />
Wiki quote: "Connect to the internet A DHCP service is already enabled for all available devices."<br />
<br />
'''DHCP IS ENABLED BY DEFAULT according to this, is it not true?'''<br />
<br />
Why do you Scimmia and Lahwaacz insist on NOT allowing some detailed clarity on this issue? I was given the excuse, oh we can't have systemctl commands here, they belong in systemctl section of wiki. WTF I call bullshit on this ... look at all the other wiki subjects that contain the required systemctl commands! <br />
<br />
I see more than one attempt to clarify "fix" this issue have been deleted by you, and your insistence that the "note" completely covers it. Now you've made it worse by removing the note from configure section and placing it in the install area!<br />
<br />
This needs to be in the beginning of the configure section: <br />
<br />
'''You must stop and disable the following service before NM will work : <br />
<br />
# systemctl stop dhcpcd.service<br />
# systemctl disable dhcpcd.service'''<br />
<br />
Then the note:<br />
<br />
'''Note: It may be a good idea to use systemctl --type=service to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.<br />
'''<br />
<br />
Then why not explain what to look for with this command specifically? Why not mention stop and disable it with the above commands?<br />
<br />
How could this so hard for such intelligent people to understand? Do you have some other motivation to not include it?</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=CUPS&diff=275586CUPS2013-09-15T09:19:45Z<p>Jeff story: /* Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
{{Note|<br />
{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists in installing {{Pkg|hplip}} first, retrieve the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, remove entierly {{Pkg|hplip}} and the unecessary dependencies. Finally, install the printer manually with the PPD file (can be achieve on the webui) then re-install {{Pkg|hplip}}. You should have after a reboot a fully working printer.}}<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.<br />
<br />
If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.<br />
<br />
1. Create a group for administering the cups scheduler:<br />
<br />
# groupadd lpadmin<br />
<br />
2. Add yourself to the newly created group:<br />
<br />
# usermod -aG lpadmin ''username''<br />
<br />
3. Tell cups to respect the newly created group:<br />
<br />
{{hc|/etc/cups/cups-files.conf|<br />
...<br />
SystemGroup sys root '''lpadmin'''<br />
...}}<br />
<br />
4. Restart cups:<br />
<br />
# systemctl restart cupsd<br />
<br />
5. Log out and log in again or restart your computer.<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Bus 002 Device 002: ID xxxx:yyyy Hewlett-Packard DeskJet D1360<br />
xxxx is the Printer_idVendor yyyy is the Printer_idProduct<br />
<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=CUPS&diff=275584CUPS2013-09-15T09:19:06Z<p>Jeff story: /* Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
{{Note|<br />
{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists in installing {{Pkg|hplip}} first, retrieve the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, remove entierly {{Pkg|hplip}} and the unecessary dependencies. Finally, install the printer manually with the PPD file (can be achieve on the webui) then re-install {{Pkg|hplip}}. You should have after a reboot a fully working printer.}}<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.<br />
<br />
If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.<br />
<br />
1. Create a group for administering the cups scheduler:<br />
<br />
# groupadd lpadmin<br />
<br />
2. Add yourself to the newly created group:<br />
<br />
# usermod -aG lpadmin ''username''<br />
<br />
3. Tell cups to respect the newly created group:<br />
<br />
{{hc|/etc/cups/cups-files.conf|<br />
...<br />
SystemGroup sys root '''lpadmin'''<br />
...}}<br />
<br />
4. Restart cups:<br />
<br />
# systemctl restart cupsd<br />
<br />
5. Log out and log in again or restart your computer.<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Bus 002 Device 002: ID xxxx:yyyy Hewlett-Packard DeskJet D1360<br />
xxxx is the Printer_idVendor yyyy is the Printer_idProduct<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=CUPS&diff=275582CUPS2013-09-15T09:15:43Z<p>Jeff story: /* Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
{{Note|<br />
{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists in installing {{Pkg|hplip}} first, retrieve the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, remove entierly {{Pkg|hplip}} and the unecessary dependencies. Finally, install the printer manually with the PPD file (can be achieve on the webui) then re-install {{Pkg|hplip}}. You should have after a reboot a fully working printer.}}<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.<br />
<br />
If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.<br />
<br />
1. Create a group for administering the cups scheduler:<br />
<br />
# groupadd lpadmin<br />
<br />
2. Add yourself to the newly created group:<br />
<br />
# usermod -aG lpadmin ''username''<br />
<br />
3. Tell cups to respect the newly created group:<br />
<br />
{{hc|/etc/cups/cups-files.conf|<br />
...<br />
SystemGroup sys root '''lpadmin'''<br />
...}}<br />
<br />
4. Restart cups:<br />
<br />
# systemctl restart cupsd<br />
<br />
5. Log out and log in again or restart your computer.<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Bus 002 Device 002: ID xxxx:yyyy Hewlett-Packard DeskJet D1360<br />
xxxx is the Printer_idVendor yyyy is the Printer_idProduct<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=CUPS&diff=275581CUPS2013-09-15T09:14:37Z<p>Jeff story: /* Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
{{Note|<br />
{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists in installing {{Pkg|hplip}} first, retrieve the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, remove entierly {{Pkg|hplip}} and the unecessary dependencies. Finally, install the printer manually with the PPD file (can be achieve on the webui) then re-install {{Pkg|hplip}}. You should have after a reboot a fully working printer.}}<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.<br />
<br />
If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.<br />
<br />
1. Create a group for administering the cups scheduler:<br />
<br />
# groupadd lpadmin<br />
<br />
2. Add yourself to the newly created group:<br />
<br />
# usermod -aG lpadmin ''username''<br />
<br />
3. Tell cups to respect the newly created group:<br />
<br />
{{hc|/etc/cups/cups-files.conf|<br />
...<br />
SystemGroup sys root '''lpadmin'''<br />
...}}<br />
<br />
4. Restart cups:<br />
<br />
# systemctl restart cupsd<br />
<br />
5. Log out and log in again or restart your computer.<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
<br />
Bus 002 Device 002: ID xxxx:yyyy Hewlett-Packard DeskJet D1360<br />
The xxxx is the Printer_idVendor and yyyy is the Printer_idProduct<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=CUPS&diff=275580CUPS2013-09-15T09:12:59Z<p>Jeff story: /* Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
== CUPS Linux printing workflow ==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
== Installing the client package ==<br />
<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
=== Optional advanced network setup ===<br />
<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers. <br />
There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}<br />
<br />
=== Installing CUPS a 32 bit chroot environment ===<br />
<br />
If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.<br />
<br />
{{bc|# mkdir /path/to/chroot/var/run/cups<br />
# Example: # mkdir /opt/arch32/var/run/cups<br />
<br />
# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}<br />
<br />
== Installing the server packages ==<br />
<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
=== Printer driver ===<br />
<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
==== Download printer PPD ====<br />
<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==== Another source for printer drivers ====<br />
<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
== Hardware support and configuration ==<br />
<br />
=== USB printers ===<br />
<br />
{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
==== Blacklisting usblp ====<br />
<br />
{{Warning|As of {{Pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.<br />
<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.}}<br />
<br />
If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:<br />
<br />
{{hc|/etc/modprobe.d/blacklistusblp.conf|<br />
blacklist usblp<br />
}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} [[kernel module]] before proceeding.<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
=== Parallel port printers ===<br />
<br />
To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].<br />
<br />
Check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
=== HP Printer ===<br />
<br />
HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].<br />
<br />
To run with qt frontend:<br />
# hp-setup -u<br />
<br />
To run with command line:<br />
# hp-setup -i<br />
<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
{{Note|<br />
{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists in installing {{Pkg|hplip}} first, retrieve the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, remove entierly {{Pkg|hplip}} and the unecessary dependencies. Finally, install the printer manually with the PPD file (can be achieve on the webui) then re-install {{Pkg|hplip}}. You should have after a reboot a fully working printer.}}<br />
<br />
== Configuring ==<br />
<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
=== CUPS daemon ===<br />
<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hostname}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|<br />
* When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.<br />
* To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the HTTP protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root. Other admin groups (e.g. lpadmin or printadmin) may be added to the {{ic|SystemGroup}} line in {{ic|/etc/cups/cups-files.conf}} (you might have to add this line). See [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions at cups.org]. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post]. Create the group[s] ({{ic|man groupadd}}) and add the group[s] to users ({{ic|man usermod}}). cupsd must be restarted and the user must re-login for these changes to take affect.<br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username (root) and password. Follow the instructions above to add other users as cups administrators.<br />
<br />
==== Remote access to web interface ====<br />
<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
=== Command-line configuration ===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''<br />
<br />
The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the ''printer'' references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d ''printer''<br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p ''printer''<br />
<br />
;Deactivate a printer<br />
# cupsdisable ''printer''<br />
<br />
;Activate a printer<br />
# cupsenable ''printer''<br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject ''printer''<br />
Then disable it.<br />
# cupsdisable ''printer''<br />
Finally remove it.<br />
# lpadmin -x ''printer''<br />
<br />
;Print a file<br />
$ lpr ''file''<br />
$ lpr -# 17 ''file'' # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
=== Alternative CUPS interfaces ===<br />
<br />
==== GNOME ====<br />
<br />
You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.<br />
<br />
If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.<br />
<br />
1. Create a group for administering the cups scheduler:<br />
<br />
# groupadd lpadmin<br />
<br />
2. Add yourself to the newly created group:<br />
<br />
# usermod -aG lpadmin ''username''<br />
<br />
3. Tell cups to respect the newly created group:<br />
<br />
{{hc|/etc/cups/cups-files.conf|<br />
...<br />
SystemGroup sys root '''lpadmin'''<br />
...}}<br />
<br />
4. Restart cups:<br />
<br />
# systemctl restart cupsd<br />
<br />
5. Log out and log in again or restart your computer.<br />
<br />
==== KDE ====<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
==== Other ====<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
== PDF virtual printer ==<br />
<br />
{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
<br />
The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
== Troubleshooting ==<br />
<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
=== Problems resulting from upgrades ===<br />
<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
==== CUPS stops working ====<br />
<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
==== All jobs are "stopped" ====<br />
<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
==== All jobs are "The printer is not responding" ====<br />
<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
==== The PPD version is not compatible with gutenprint ====<br />
<br />
Run:<br />
# /usr/bin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
=== Other ===<br />
<br />
===== CUPS permission errors =====<br />
<br />
* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
* Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====<br />
<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
==== HPLIP printer claims job is complete but printer does nothing ====<br />
<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
==== hp-setup asks to specify the PPD file for the discovered printer ====<br />
<br />
Install CUPS before running hp-setup.<br />
<br />
==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====<br />
<br />
"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/<br />
<br />
==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====<br />
<br />
This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.<br />
<br />
==== hp-toolbox sends an error, "Unable to communicate with device" ====<br />
<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/''printer id''<br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.<br />
<br />
==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====<br />
<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
==== Printing fails with unauthorised error ====<br />
<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
==== Print button greyed-out in GNOME print dialogs ====<br />
<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add:<br />
# HostNameLookups Double<br />
<br />
Restart cups.service.<br />
<br />
==== Unknown supported format: application/postscript ====<br />
<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
==== Finding URIs for Windows print servers ====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
==== Print-Job client-error-document-format-not-supported ====<br />
<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
==== /usr/lib/cups/backend/hp failed ====<br />
<br />
Change:<br />
SystemGroup sys root<br />
to:<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
==== Unable to get list of printer drivers ====<br />
<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.<br />
<br />
==== lp: Error - Scheduler Not Responding ====<br />
<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
==== CUPS prints only an empty and an error-message page on HP LaserJet ====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops<br />
<br />
==== "Using invalid Host" error message ====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer) ====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
chmod 0666 /dev/bus/usb/''bus number''/''device number''<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|2=<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"<br />
}}<br />
The xxxx is the Printer_idVendor and yyyy is the Printer_idProduct<br />
Bus 002 Device 002: ID xxxx:yyyy Hewlett-Packard DeskJet D1360<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
==== Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer connected over network) ====<br />
<br />
Start, enable and restart the avahi-daemon.<br />
<br />
==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====<br />
<br />
The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].<br />
<br />
==== Printer is not recognized by CUPS ====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
* Remove {{ic|usblp}} from blacklist<br />
* Load {{ic|usblp}} module<br />
modprobe usblp<br />
* Stop cups<br />
* Add the following udev rule in a new rule file:<br />
{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
}}<br />
* Reload udev rules:<br />
# udevadm control --reload-rules<br />
* Unplug and re-plug the printer.<br />
* Wait a few seconds and then start cups again.<br />
<br />
==== Can't load /etc/samba/smb.conf ====<br />
<br />
If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:<br />
<br />
# mkdir /etc/samba<br />
# touch /etc/samba/smb.conf<br />
<br />
and restart cupsd.<br />
<br />
==== CUPS' systemd service does not start even though it's enabled ====<br />
<br />
The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an<br />
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local <br />
{{ic|/var/run/cups/cups.sock}} socket. <br />
<br />
In order to have cupsd start when initiating a print job over the network, create the following file:<br />
<br />
{{hc|/etc/systemd/system/cups.socket|<br />
.include /usr/lib/systemd/system/cups.socket<br />
<br />
[Socket]<br />
ListenStream&#61;0.0.0.0:631<br />
ListenDatagram&#61;0.0.0.0:631<br />
BindIPv6Only&#61;ipv6-only<br />
}}<br />
<br />
Then reload systemd:<br />
<br />
# systemctl --system daemon-reload<br />
<br />
Confirm that everything is working correctly:<br />
<br />
{{bc|<br />
# systemctl is-enabled cups.service &#124;&#124; systemctl enable cups.service<br />
# systemctl status cups.socket<br />
cups.socket - CUPS Printing Service Sockets<br />
Loaded: loaded (/etc/systemd/system/cups.socket; enabled)<br />
Active: inactive (dead)<br />
Listen: /var/run/cups/cups.sock (Stream)<br />
0.0.0.0:631 (Stream)<br />
0.0.0.0:631 (Datagram)<br />
}}<br />
<br />
CUPS should now start automatically when printing locally or over the network.<br />
<br />
== See also ==<br />
<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's printing guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux user forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP printers easy way]</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=274198NetworkManager2013-09-02T23:18:01Z<p>Jeff story: clarify and instruct to disable and stop dhcpcd.service</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[ru:NetworkManager]]<br />
[[tr:NetworkManager]]<br />
[[zh-CN:NetworkManager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager can be installed with the package {{Pkg|networkmanager}}, available in the [[official repositories]].<br />
<br />
=== VPN support ===<br />
<br />
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages from the [[official repositories]]:<br />
<br />
* {{Pkg|networkmanager-openvpn}}<br />
* {{Pkg|networkmanager-pptp}}<br />
* {{Pkg|networkmanager-vpnc}}<br />
<br />
== Graphical front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's {{Pkg|network-manager-applet}} is lightweight enough and works across all environments.<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users" install and configure [[GNOME Keyring]].<br />
<br />
=== KDE ===<br />
<br />
The KNetworkManager front-end is a Plasma widget available in the official repositories as package {{Pkg|kdeplasma-applets-networkmanagement}}.<br />
<br />
{{Note|If you are changing from another network managing tool like [[Wicd]], do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
If you have both the Plasma widget and {{ic|nm-applet}} installed and do not want to start {{ic|nm-applet}} when using KDE, add the following line to {{ic|/etc/xdg/autostart/nm-applet.desktop}}:<br />
NotShowIn=KDE<br />
<br />
See [http://userbase.kde.org/NetworkManagement Userbase page] for more info.<br />
<br />
=== XFCE ===<br />
{{Pkg|network-manager-applet}} will work fine in XFCE, but in order to see notifications, ''including error messages'', {{ic|nm-applet}} needs an implementation of the Freedesktop desktop notifications specification (see the [http://www.galago-project.org/specs/notification/0.9/index.html Galapago Project]) to display them. To enable notifications install {{Pkg|xfce4-notifyd}}, a package that provides an implementation for the specification.<br />
<br />
Without such a notification daemon, {{ic|nm-applet}} outputs the following errors to stdout/stderr:<br />
<br />
(nm-applet:24209): libnotify-WARNING **: Failed to connect to proxy<br />
** (nm-applet:24209): WARNING **: get_all_cb: couldn't retrieve<br />
system settings properties: (25) Launch helper exited with unknown<br />
return code 1.<br />
** (nm-applet:24209): WARNING **: fetch_connections_done: error<br />
fetching connections: (25) Launch helper exited with unknown return<br />
code 1.<br />
** (nm-applet:24209): WARNING **: Failed to register as an agent:<br />
(25) Launch helper exited with unknown return code 1<br />
<br />
{{ic|nm-applet}} will still work fine, though, but without notifications.<br />
<br />
If nm-applet is not prompting for a password when connecting to new wifi networks, and is just disconnecting immediately, you probably need to install {{Pkg|gnome-keyring}}.<br />
<br />
=== Openbox ===<br />
<br />
To function properly in Openbox, the GNOME applet requires the {{Pkg|xfce4-notifyd}} notification daemon for the same reason as in XFCE and the {{Pkg|gnome-icon-theme}} package to be able to display the applet in the systray.<br />
<br />
If you want to store authentication details (Wireless/DSL) install and configure [[gnome-keyring]].<br />
<br />
{{ic|nm-applet}} installs the autostart file at {{ic|/etc/xdg/autostart/nm-applet.desktop}}. If you have issues with it (e.g. {{ic|nm-applet}} is started twice or is not started at all), see [[Openbox#Autostart directory]] or [https://bbs.archlinux.org/viewtopic.php?pid=993738] for solution.<br />
<br />
=== Other desktops and window managers ===<br />
<br />
In all other scenarios it is recommended to use the GNOME applet. You will also need to be sure that the {{Pkg|gnome-icon-theme}} package is installed to be able to display the applet.<br />
<br />
To store connection secrets install and configure [[gnome-keyring]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet > /dev/null 2>/dev/null &<br />
stalonetray > /dev/null 2>/dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the stalonetray window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
=== Command line ===<br />
<br />
The {{Pkg|networkmanager}} package contains [http://manpages.ubuntu.com/manpages/maverick/man1/nmcli.1.html nmcli] since version 0.8.1.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{ic|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{ic|/etc/hosts}}:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 localhost<br />
::1 localhost<br />
}}<br />
<br />
In case you have nss-myhostname turned off, the line would look like:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 my-laptop localhost<br />
::1 my-laptop localhost<br />
}}<br />
<br />
{{Note|It may be a good idea to use {{ic|1=systemctl --type=service}} to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.}}<br />
<br />
Networkmanager manages dhcp via either the dhcpcd or dhclient package, You need to disable and stop dhcpcd:<br />
<br />
{{bc|# systemctl disable dhcpcd.service<br />
# systemctl disable dhcpcd@.service<br />
# systemctl stop dhcpcd.service<br />
# systemctl stop dhcpcd@.service}}<br />
<br />
=== Enable NetworkManager ===<br />
<br />
Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need {{ic|nmcli}} or an applet to configure and connect.<br />
<br />
You can enable NetworkManager at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager}}<br />
<br />
You can start the NetworkManager daemon immediately with the following command:<br />
<br />
{{bc|# systemctl start NetworkManager}}<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
If you have services which fail if they are started before the network is up, you have to use {{ic|NetworkManager-wait-online.service}} in addition to the NetworkManager service. This is however hardly ever necessary since most network daemons start up fine, even if the network has not been configured yet.<br />
<br />
You can enable NetworkManager Wait Online at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager-wait-online}}<br />
<br />
In some cases the service will still fail to start sucessfully on boot:<br />
<br />
NetworkManager-wait-online.service: main process exited, code=exited, status=1/FAILURE<br />
Failed to start Network Manager Wait Online<br />
Unit NetworkManger-wait-online.service entered failed state<br />
Starting Network.<br />
Reached target Network.<br />
<br />
This is due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being to short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General Troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
''Option 1.'' Run a [[PolicyKit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
<br />
''Option 2.'' Add yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
<br />
''Option 3.'' Add yourself to the {{ic|network}} group and create the following file:<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});</nowiki>}}<br />
All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under systemd if you do not have an active session with [[Systemd#Using_systemd-logind|systemd-logind]].<br />
<br />
=== Network services with NetworkManager dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are [[OpenNTPD]] and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network and stop them when you disconnect. To activate the feature you need to enable/start the NetworkManager-dispatcher service:<br />
<br />
{{bc|# systemctl start NetworkManager-dispatcher}}<br />
{{bc|# systemctl enable NetworkManager-dispatcher}}<br />
<br />
Once the feature is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it is good practice to make them owned by '''root:root''' and writable only by the owner.<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. They receive two arguments: the name of the interface (e.g. ''eth0'') and the status (''up'' or ''down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10_portmap}} or {{ic|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in {{ic|/var/log/messages.log}} }}<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Start OpenNTPD ====<br />
<br />
The following example starts the OpenNTPD daemon when an interface is brought up. Save the file as {{ic|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
interface=$1 status=$2<br />
case $status in<br />
up)<br />
systemctl start openntpd<br />
;;<br />
down)<br />
if ! nm-tool | awk '/State:/{print $2}' | grep -qs connected; then<br />
systemctl stop openntpd<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this link] for more information. The example below works with [[gnome-keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely gnome-keyring has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli con status}} or {{ic|nmcli con list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "<uuid>" ]; then<br />
case $status in<br />
up)<br />
export SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
su "$USER" -c "sshfs $LOCAL $REMOTE"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network. <br />
<br />
:1. Create the dispatcher script:<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="wifi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli con up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli con status id "$VPN_NAME" | grep -qs activated; then<br />
nmcli con down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
Remember to make it executable with {{ic|chmod +x}} and to make the VPN connection available to all users. <br />
<br />
Trying to connect using this setup will fail and NetworkManager will complain about 'no valid VPN secrets', because of [http://projects.gnome.org/NetworkManager/developers/migrating-to-09/secrets-flags.html the way VPN secrets are stored] which brings us to step 2:<br />
<br />
:2. Edit your VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/<name of your VPN connection>}} and change the {{ic|password-flags}} and {{ic|secret-flags}} form {{ic|1}} to {{ic|0}}.<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and re-enter the VPN passwords/secrets.}}<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using GNOME, you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] wich handles proxy settings using NetworkManager's informations. You can find the package for {{AUR|proxydriver}} in the [[AUR]].<br />
<br />
In order for proxydriver to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (System -> Preferences -> Startup Applications):<br />
<br />
xhost +si:localuser:your_username<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[Daemon|start]] the ''networkmanager'' daemon.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[Awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Troubleshooting ==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Using nm-applet, wifi networks don't prompt for password and just disconnect ===<br />
<br />
This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}.<br />
<br />
=== No traffic via PPTP tunnel ===<br />
<br />
PPTP connection logins successfully, you see ppp0 interface with correct VPN IP, but you cannot even ping remote IP. It is due to lack of MPPE (Microsoft Point-to-Point Encryption) support in stock Arch pppd. It is recommended to first try with the stock Arch {{Pkg|ppp}} as it may work as intended.<br />
<br />
To solve the problem it should be sufficient to install {{AUR|ppp-mppe}} from the [[AUR]].<br />
<br />
=== Network management disabled ===<br />
<br />
Sometimes when NetworkManager shuts down but the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'll have to remove it manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{ic|/etc/rc.local}} to have it removed upon bootup:<br />
<br />
{{bc|<nowiki>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</nowiki>}}<br />
<br />
=== Using resolv.conf.head and resolv.conf.tail ===<br />
<br />
See [[resolv.conf]]. Also make sure that NetworkManager uses {{Pkg|dhcpcd}} and not {{Pkg|dhclient}}. If you want to use {{Pkg|dhclient}}, you may try the {{AUR|networkmanager-dispatch-resolv}} package from the [[AUR]].<br />
<br />
=== Preserving changes to resolv.conf ===<br />
<br />
See [[Resolv.conf]].<br />
<br />
=== DHCP problems ===<br />
<br />
{{Poor writing|solutions for {{Pkg|dhcpcd}} and {{Pkg|dhclient}} mixed together}}<br />
<br />
If you have problems with getting an IP via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{ic|aa:bb:cc:dd:ee:ff}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show eth0}} command from the {{Pkg|iproute2}} package.<br />
<br />
For some (incompliant) routers, you will not be able to connect properly unless you comment the line<br />
require dhcp_server_identifier<br />
in {{ic|/etc/dhcpcd.conf}} (note that this file is distinct from {{ic|dhcpd.conf}}). This should not cause issues unless you have multiple DHCP servers on your network (not typical); see [http://technet.microsoft.com/en-us/library/cc977442.aspx this page] for more information.<br />
<br />
=== Hostname problems ===<br />
<br />
{{Accuracy|no description of the problem|Talk:NetworkManager#Hostname_problems_Entry}}<br />
<br />
Add the following line to /etc/NetworkManager/NetworkManager.conf:<br />
dhcp=dhcpcd<br />
then restart.<br />
systemctl restart NetworkManager<br />
source https://bbs.archlinux.org/viewtopic.php?id=152376<br />
<br />
=== Missing default route ===<br />
<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
=== 3G modem not detected ===<br />
<br />
{{Out of date|{{Pkg|modemmanager}} is now a dependency of {{Pkg|networkmanager}}}}<br />
<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
{{Pkg|modemmanager}} and restart NetworkManager daemon with {{ic|systemctl restart NetworkManager}}. It may also be necessary to replug or restart your modem. This utility provides support for hardware not in NetworkManager's default database.<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with {{ic|rfkill}}. Install {{Pkg|rfkill}} from the [[official repositories]] and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies {{ic|rfkill}} about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} (''not'' as root). In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set_up_PolicyKit_permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden network are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/[SSID]<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in Gnome ===<br />
<br />
When setting up openconnect or vpnc connections in NetworkManager while using Gnome, you'll sometimes never see the dialog box pop up and the following error appears in /var/log/errors.log:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the Gnome NM Applet expecting dialog scripts to be at /usr/lib/gnome-shell, when NetworkManager's packages put them in /usr/lib/networkmanager.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
# For OpenConnect<br />
ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/ <br />
<br />
# For VPNC (i.e. Cisco VPN)<br />
ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g.: 3G or wired) with a few clicks using nm. You will need a supported Wi-Fi card (Cards based on Atheros AR9xx or at least AR5xx are probably best choice)<br />
<br />
==== Ad-hoc ====<br />
<br />
* [[pacman|Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Custom dnsmasq.conf may interfere with nm (not sure about this, but i think so).<br />
* Click on nm-applet -> Create new wireless network.<br />
* Follow wizard (if using WEP be sure to use 5 or 13 character long password, different lengths will fail).<br />
* Settings will remain stored for the next time you need it.<br />
<br />
==== Real AP ====<br />
<br />
Support of infrastructure mode (which is needed by Android phones as they do not intentionally support ad-hoc) is not currently supported by NetworkManager, but is in active development...<br />
<br />
See: http://fedoraproject.org/wiki/Features/RealHotspot<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's {{ic|nm-tool}} and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs {{ic|fpupdate}} for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from {{ic|nm-tool}}; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Automatically unlock keyring after login ===<br />
<br />
==== GNOME ====<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
* In {{ic|/etc/pam.d/gdm}} (or your corresponding daemon in {{ic|/etc/pam.d}}), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
* In {{ic|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using KDE with KDM, you can use {{AUR|pam-keyring-tool}} from the [[AUR]].}}<br />
<br />
Put a script like the following in {{ic|~/.kde4/Autostart}}:<br />
#!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
Similar should work with Openbox, LXDE, etc.<br />
<br />
==== SLiM login manager ====<br />
See [[Slim#SLiM and Gnome Keyring]].<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them.You can quickly and easily ignore devices by MAC by using the following in {{ic|/etc/NetworkManager/NetworkManager.conf}} :<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4<br />
After you have put this in, [[Daemon|restart]] NetworkManager, and you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Connect faster ===<br />
<br />
==== Disabling IPv6 ====<br />
<br />
Slow connection or reconnection to the network may be due to superfluous IPv6 queries in NetworkManager. If there is no IPv6 support on the local network, connecting to a network may take longer than normal while NetworkManager tries to establish an IPv6 connection that eventually times out. The solution is to disable IPv6 within NetworkManager which will make network connection faster. This has to be done once for every network you connect to.<br />
<br />
* Right-click on the network status icon.<br />
* Click on "Edit Connections".<br />
* Go to the "Wired" or "Wireless" tab, as appropriate.<br />
* Select the name of the network.<br />
* Click on "Edit".<br />
* Go to the "IPv6 Settings" tab.<br />
* In the "Method" dropdown, choose "Ignore/Disabled".<br />
* Click on "Save".<br />
<br />
==== Speed up DHCP by disabling ARP probing in DHCPCD ====<br />
<br />
{{ic|dhcpcd}} contains an implementation of a recommendation of the DHCP standard ([http://www.ietf.org/rfc/rfc2131.txt RFC2131] section 2.2) to check via ARP if the assigned IP address is really not taken. This seems mostly useless in home networks, so you can save about 5 seconds on every connect by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
This is equivalent to passing {{ic|--noarp}} to {{ic|dhcpcd}}, and disables the described ARP probing, speeding up connections to networks with DHCP.<br />
<br />
==== Use OpenDNS servers ====<br />
<br />
Create {{ic|/etc/resolv.conf.opendns}} with the nameservers:<br />
<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
or use Google DNS servers, because people have been getting ads via the OpenDNS servers lately <br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
And have the dispatcher replace the discovered DHCP servers with the OpenDNS ones:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/dns-servers-opendns|<nowiki><br />
#!/bin/bash<br />
# Use OpenDNS servers over DHCP discovered servers<br />
<br />
cp -f /etc/resolv.conf.opendns /etc/resolv.conf</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/NetworkManager/dispatcher.d/dns-servers-opendns</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=274045NetworkManager2013-09-02T08:53:03Z<p>Jeff story: Undo revision 274034 by Scimmia (talk)</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[ru:NetworkManager]]<br />
[[tr:NetworkManager]]<br />
[[zh-CN:NetworkManager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager can be installed with the package {{Pkg|networkmanager}}, available in the [[official repositories]].<br />
<br />
To get network manager working, I had to install {{Pkg|dhclient}}, even though dhcpcd from core was installed.<br />
<br />
=== VPN support ===<br />
<br />
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages from the [[official repositories]]:<br />
<br />
* {{Pkg|networkmanager-openvpn}}<br />
* {{Pkg|networkmanager-pptp}}<br />
* {{Pkg|networkmanager-vpnc}}<br />
<br />
== Graphical front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's {{Pkg|network-manager-applet}} is lightweight enough and works across all environments.<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users" install and configure [[GNOME Keyring]].<br />
<br />
=== KDE ===<br />
<br />
The KNetworkManager front-end is a Plasma widget available in the official repositories as package {{Pkg|kdeplasma-applets-networkmanagement}}.<br />
<br />
{{Note|If you are changing from another network managing tool like [[Wicd]], do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
If you have both the Plasma widget and {{ic|nm-applet}} installed and do not want to start {{ic|nm-applet}} when using KDE, add the following line to {{ic|/etc/xdg/autostart/nm-applet.desktop}}:<br />
NotShowIn=KDE<br />
<br />
See [http://userbase.kde.org/NetworkManagement Userbase page] for more info.<br />
<br />
=== XFCE ===<br />
{{Pkg|network-manager-applet}} will work fine in XFCE, but in order to see notifications, ''including error messages'', {{ic|nm-applet}} needs an implementation of the Freedesktop desktop notifications specification (see the [http://www.galago-project.org/specs/notification/0.9/index.html Galapago Project]) to display them. To enable notifications install {{Pkg|xfce4-notifyd}}, a package that provides an implementation for the specification.<br />
<br />
Without such a notification daemon, {{ic|nm-applet}} outputs the following errors to stdout/stderr:<br />
<br />
(nm-applet:24209): libnotify-WARNING **: Failed to connect to proxy<br />
** (nm-applet:24209): WARNING **: get_all_cb: couldn't retrieve<br />
system settings properties: (25) Launch helper exited with unknown<br />
return code 1.<br />
** (nm-applet:24209): WARNING **: fetch_connections_done: error<br />
fetching connections: (25) Launch helper exited with unknown return<br />
code 1.<br />
** (nm-applet:24209): WARNING **: Failed to register as an agent:<br />
(25) Launch helper exited with unknown return code 1<br />
<br />
{{ic|nm-applet}} will still work fine, though, but without notifications.<br />
<br />
If nm-applet is not prompting for a password when connecting to new wifi networks, and is just disconnecting immediately, you probably need to install {{Pkg|gnome-keyring}}.<br />
<br />
=== Openbox ===<br />
<br />
To function properly in Openbox, the GNOME applet requires the {{Pkg|xfce4-notifyd}} notification daemon for the same reason as in XFCE and the {{Pkg|gnome-icon-theme}} package to be able to display the applet in the systray.<br />
<br />
If you want to store authentication details (Wireless/DSL) install and configure [[gnome-keyring]].<br />
<br />
{{ic|nm-applet}} installs the autostart file at {{ic|/etc/xdg/autostart/nm-applet.desktop}}. If you have issues with it (e.g. {{ic|nm-applet}} is started twice or is not started at all), see [[Openbox#Autostart directory]] or [https://bbs.archlinux.org/viewtopic.php?pid=993738] for solution.<br />
<br />
=== Other desktops and window managers ===<br />
<br />
In all other scenarios it is recommended to use the GNOME applet. You will also need to be sure that the {{Pkg|gnome-icon-theme}} package is installed to be able to display the applet.<br />
<br />
To store connection secrets install and configure [[gnome-keyring]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet > /dev/null 2>/dev/null &<br />
stalonetray > /dev/null 2>/dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the stalonetray window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
=== Command line ===<br />
<br />
The {{Pkg|networkmanager}} package contains [http://manpages.ubuntu.com/manpages/maverick/man1/nmcli.1.html nmcli] since version 0.8.1.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{ic|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{ic|/etc/hosts}}:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 localhost<br />
::1 localhost<br />
}}<br />
<br />
In case you have nss-myhostname turned off, the line would look like:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 my-laptop localhost<br />
::1 my-laptop localhost<br />
}}<br />
<br />
{{Note|It may be a good idea to use {{ic|1=systemctl --type=service}} to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.}}<br />
<br />
=== Enable NetworkManager ===<br />
<br />
Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need {{ic|nmcli}} or an applet to configure and connect.<br />
<br />
You can enable NetworkManager at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager}}<br />
<br />
You can start the NetworkManager daemon immediately with the following command:<br />
<br />
{{bc|# systemctl start NetworkManager}}<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
If you have services which fail if they are started before the network is up, you have to use {{ic|NetworkManager-wait-online.service}} in addition to the NetworkManager service. This is however hardly ever necessary since most network daemons start up fine, even if the network has not been configured yet.<br />
<br />
You can enable NetworkManager Wait Online at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager-wait-online}}<br />
<br />
In some cases the service will still fail to start sucessfully on boot:<br />
<br />
NetworkManager-wait-online.service: main process exited, code=exited, status=1/FAILURE<br />
Failed to start Network Manager Wait Online<br />
Unit NetworkManger-wait-online.service entered failed state<br />
Starting Network.<br />
Reached target Network.<br />
<br />
This is due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being to short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General Troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
''Option 1.'' Run a [[PolicyKit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
<br />
''Option 2.'' Add yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
<br />
''Option 3.'' Add yourself to the {{ic|network}} group and create the following file:<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});</nowiki>}}<br />
All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under systemd if you do not have an active session with [[Systemd#Using_systemd-logind|systemd-logind]].<br />
<br />
=== Network services with NetworkManager dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are [[OpenNTPD]] and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network and stop them when you disconnect. To activate the feature you need to enable/start the NetworkManager-dispatcher service:<br />
<br />
{{bc|# systemctl start NetworkManager-dispatcher}}<br />
{{bc|# systemctl enable NetworkManager-dispatcher}}<br />
<br />
Once the feature is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it is good practice to make them owned by '''root:root''' and writable only by the owner.<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. They receive two arguments: the name of the interface (e.g. ''eth0'') and the status (''up'' or ''down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10_portmap}} or {{ic|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in {{ic|/var/log/messages.log}} }}<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Start OpenNTPD ====<br />
<br />
The following example starts the OpenNTPD daemon when an interface is brought up. Save the file as {{ic|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
interface=$1 status=$2<br />
case $status in<br />
up)<br />
systemctl start openntpd<br />
;;<br />
down)<br />
if ! nm-tool | awk '/State:/{print $2}' | grep -qs connected; then<br />
systemctl stop openntpd<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this link] for more information. The example below works with [[gnome-keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely gnome-keyring has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli con status}} or {{ic|nmcli con list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "<uuid>" ]; then<br />
case $status in<br />
up)<br />
export SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
su "$USER" -c "sshfs $LOCAL $REMOTE"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network. <br />
<br />
:1. Create the dispatcher script:<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="wifi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli con up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli con status id "$VPN_NAME" | grep -qs activated; then<br />
nmcli con down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
Remember to make it executable with {{ic|chmod +x}} and to make the VPN connection available to all users. <br />
<br />
Trying to connect using this setup will fail and NetworkManager will complain about 'no valid VPN secrets', because of [http://projects.gnome.org/NetworkManager/developers/migrating-to-09/secrets-flags.html the way VPN secrets are stored] which brings us to step 2:<br />
<br />
:2. Edit your VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/<name of your VPN connection>}} and change the {{ic|password-flags}} and {{ic|secret-flags}} form {{ic|1}} to {{ic|0}}.<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and re-enter the VPN passwords/secrets.}}<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using GNOME, you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] wich handles proxy settings using NetworkManager's informations. You can find the package for {{AUR|proxydriver}} in the [[AUR]].<br />
<br />
In order for proxydriver to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (System -> Preferences -> Startup Applications):<br />
<br />
xhost +si:localuser:your_username<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[Daemon|start]] the ''networkmanager'' daemon.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[Awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Troubleshooting ==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Using nm-applet, wifi networks don't prompt for password and just disconnect ===<br />
<br />
This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}.<br />
<br />
=== No traffic via PPTP tunnel ===<br />
<br />
PPTP connection logins successfully, you see ppp0 interface with correct VPN IP, but you cannot even ping remote IP. It is due to lack of MPPE (Microsoft Point-to-Point Encryption) support in stock Arch pppd. It is recommended to first try with the stock Arch {{Pkg|ppp}} as it may work as intended.<br />
<br />
To solve the problem it should be sufficient to install {{AUR|ppp-mppe}} from the [[AUR]].<br />
<br />
=== Network management disabled ===<br />
<br />
Sometimes when NetworkManager shuts down but the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'll have to remove it manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{ic|/etc/rc.local}} to have it removed upon bootup:<br />
<br />
{{bc|<nowiki>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</nowiki>}}<br />
<br />
=== Using resolv.conf.head and resolv.conf.tail ===<br />
<br />
See [[resolv.conf]]. Also make sure that NetworkManager uses {{Pkg|dhcpcd}} and not {{Pkg|dhclient}}. If you want to use {{Pkg|dhclient}}, you may try the {{AUR|networkmanager-dispatch-resolv}} package from the [[AUR]].<br />
<br />
=== Preserving changes to resolv.conf ===<br />
<br />
See [[Resolv.conf]].<br />
<br />
=== DHCP problems ===<br />
<br />
{{Poor writing|solutions for {{Pkg|dhcpcd}} and {{Pkg|dhclient}} mixed together}}<br />
<br />
If you have problems with getting an IP via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{ic|aa:bb:cc:dd:ee:ff}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show eth0}} command from the {{Pkg|iproute2}} package.<br />
<br />
For some (incompliant) routers, you will not be able to connect properly unless you comment the line<br />
require dhcp_server_identifier<br />
in {{ic|/etc/dhcpcd.conf}} (note that this file is distinct from {{ic|dhcpd.conf}}). This should not cause issues unless you have multiple DHCP servers on your network (not typical); see [http://technet.microsoft.com/en-us/library/cc977442.aspx this page] for more information.<br />
<br />
=== Hostname problems ===<br />
<br />
{{Accuracy|no description of the problem|Talk:NetworkManager#Hostname_problems_Entry}}<br />
<br />
Add the following line to /etc/NetworkManager/NetworkManager.conf:<br />
dhcp=dhcpcd<br />
then restart.<br />
systemctl restart NetworkManager<br />
source https://bbs.archlinux.org/viewtopic.php?id=152376<br />
<br />
=== Missing default route ===<br />
<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
=== 3G modem not detected ===<br />
<br />
{{Out of date|{{Pkg|modemmanager}} is now a dependency of {{Pkg|networkmanager}}}}<br />
<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
{{Pkg|modemmanager}} and restart NetworkManager daemon with {{ic|systemctl restart NetworkManager}}. It may also be necessary to replug or restart your modem. This utility provides support for hardware not in NetworkManager's default database.<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with {{ic|rfkill}}. Install {{Pkg|rfkill}} from the [[official repositories]] and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies {{ic|rfkill}} about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} (''not'' as root). In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set_up_PolicyKit_permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden network are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/[SSID]<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in Gnome ===<br />
<br />
When setting up openconnect or vpnc connections in NetworkManager while using Gnome, you'll sometimes never see the dialog box pop up and the following error appears in /var/log/errors.log:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the Gnome NM Applet expecting dialog scripts to be at /usr/lib/gnome-shell, when NetworkManager's packages put them in /usr/lib/networkmanager.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
# For OpenConnect<br />
ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/ <br />
<br />
# For VPNC (i.e. Cisco VPN)<br />
ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g.: 3G or wired) with a few clicks using nm. You will need a supported Wi-Fi card (Cards based on Atheros AR9xx or at least AR5xx are probably best choice)<br />
<br />
==== Ad-hoc ====<br />
<br />
* [[pacman|Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Custom dnsmasq.conf may interfere with nm (not sure about this, but i think so).<br />
* Click on nm-applet -> Create new wireless network.<br />
* Follow wizard (if using WEP be sure to use 5 or 13 character long password, different lengths will fail).<br />
* Settings will remain stored for the next time you need it.<br />
<br />
==== Real AP ====<br />
<br />
Support of infrastructure mode (which is needed by Android phones as they do not intentionally support ad-hoc) is not currently supported by NetworkManager, but is in active development...<br />
<br />
See: http://fedoraproject.org/wiki/Features/RealHotspot<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's {{ic|nm-tool}} and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs {{ic|fpupdate}} for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from {{ic|nm-tool}}; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Automatically unlock keyring after login ===<br />
<br />
==== GNOME ====<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
* In {{ic|/etc/pam.d/gdm}} (or your corresponding daemon in {{ic|/etc/pam.d}}), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
* In {{ic|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using KDE with KDM, you can use {{AUR|pam-keyring-tool}} from the [[AUR]].}}<br />
<br />
Put a script like the following in {{ic|~/.kde4/Autostart}}:<br />
#!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
Similar should work with Openbox, LXDE, etc.<br />
<br />
==== SLiM login manager ====<br />
See [[Slim#SLiM and Gnome Keyring]].<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them.You can quickly and easily ignore devices by MAC by using the following in {{ic|/etc/NetworkManager/NetworkManager.conf}} :<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4<br />
After you have put this in, [[Daemon|restart]] NetworkManager, and you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Connect faster ===<br />
<br />
==== Disabling IPv6 ====<br />
<br />
Slow connection or reconnection to the network may be due to superfluous IPv6 queries in NetworkManager. If there is no IPv6 support on the local network, connecting to a network may take longer than normal while NetworkManager tries to establish an IPv6 connection that eventually times out. The solution is to disable IPv6 within NetworkManager which will make network connection faster. This has to be done once for every network you connect to.<br />
<br />
* Right-click on the network status icon.<br />
* Click on "Edit Connections".<br />
* Go to the "Wired" or "Wireless" tab, as appropriate.<br />
* Select the name of the network.<br />
* Click on "Edit".<br />
* Go to the "IPv6 Settings" tab.<br />
* In the "Method" dropdown, choose "Ignore/Disabled".<br />
* Click on "Save".<br />
<br />
==== Speed up DHCP by disabling ARP probing in DHCPCD ====<br />
<br />
{{ic|dhcpcd}} contains an implementation of a recommendation of the DHCP standard ([http://www.ietf.org/rfc/rfc2131.txt RFC2131] section 2.2) to check via ARP if the assigned IP address is really not taken. This seems mostly useless in home networks, so you can save about 5 seconds on every connect by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
This is equivalent to passing {{ic|--noarp}} to {{ic|dhcpcd}}, and disables the described ARP probing, speeding up connections to networks with DHCP.<br />
<br />
==== Use OpenDNS servers ====<br />
<br />
Create {{ic|/etc/resolv.conf.opendns}} with the nameservers:<br />
<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
or use Google DNS servers, because people have been getting ads via the OpenDNS servers lately <br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
And have the dispatcher replace the discovered DHCP servers with the OpenDNS ones:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/dns-servers-opendns|<nowiki><br />
#!/bin/bash<br />
# Use OpenDNS servers over DHCP discovered servers<br />
<br />
cp -f /etc/resolv.conf.opendns /etc/resolv.conf</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/NetworkManager/dispatcher.d/dns-servers-opendns</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=274033NetworkManager2013-09-02T06:52:47Z<p>Jeff story: Undo revision 274032 by Scimmia (talk)</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[ru:NetworkManager]]<br />
[[tr:NetworkManager]]<br />
[[zh-CN:NetworkManager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager can be installed with the package {{Pkg|networkmanager}}, available in the [[official repositories]].<br />
<br />
To get network manager working, I had to install {{Pkg|dhclient}}, even though dhcpcd from core was installed.<br />
<br />
=== VPN support ===<br />
<br />
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages from the [[official repositories]]:<br />
<br />
* {{Pkg|networkmanager-openvpn}}<br />
* {{Pkg|networkmanager-pptp}}<br />
* {{Pkg|networkmanager-vpnc}}<br />
<br />
== Graphical front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's {{Pkg|network-manager-applet}} is lightweight enough and works across all environments.<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users" install and configure [[GNOME Keyring]].<br />
<br />
=== KDE ===<br />
<br />
The KNetworkManager front-end is a Plasma widget available in the official repositories as package {{Pkg|kdeplasma-applets-networkmanagement}}.<br />
<br />
{{Note|If you are changing from another network managing tool like [[Wicd]], do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
If you have both the Plasma widget and {{ic|nm-applet}} installed and do not want to start {{ic|nm-applet}} when using KDE, add the following line to {{ic|/etc/xdg/autostart/nm-applet.desktop}}:<br />
NotShowIn=KDE<br />
<br />
See [http://userbase.kde.org/NetworkManagement Userbase page] for more info.<br />
<br />
=== XFCE ===<br />
{{Pkg|network-manager-applet}} will work fine in XFCE, but in order to see notifications, ''including error messages'', {{ic|nm-applet}} needs an implementation of the Freedesktop desktop notifications specification (see the [http://www.galago-project.org/specs/notification/0.9/index.html Galapago Project]) to display them. To enable notifications install {{Pkg|xfce4-notifyd}}, a package that provides an implementation for the specification.<br />
<br />
Without such a notification daemon, {{ic|nm-applet}} outputs the following errors to stdout/stderr:<br />
<br />
(nm-applet:24209): libnotify-WARNING **: Failed to connect to proxy<br />
** (nm-applet:24209): WARNING **: get_all_cb: couldn't retrieve<br />
system settings properties: (25) Launch helper exited with unknown<br />
return code 1.<br />
** (nm-applet:24209): WARNING **: fetch_connections_done: error<br />
fetching connections: (25) Launch helper exited with unknown return<br />
code 1.<br />
** (nm-applet:24209): WARNING **: Failed to register as an agent:<br />
(25) Launch helper exited with unknown return code 1<br />
<br />
{{ic|nm-applet}} will still work fine, though, but without notifications.<br />
<br />
If nm-applet is not prompting for a password when connecting to new wifi networks, and is just disconnecting immediately, you probably need to install {{Pkg|gnome-keyring}}.<br />
<br />
=== Openbox ===<br />
<br />
To function properly in Openbox, the GNOME applet requires the {{Pkg|xfce4-notifyd}} notification daemon for the same reason as in XFCE and the {{Pkg|gnome-icon-theme}} package to be able to display the applet in the systray.<br />
<br />
If you want to store authentication details (Wireless/DSL) install and configure [[gnome-keyring]].<br />
<br />
{{ic|nm-applet}} installs the autostart file at {{ic|/etc/xdg/autostart/nm-applet.desktop}}. If you have issues with it (e.g. {{ic|nm-applet}} is started twice or is not started at all), see [[Openbox#Autostart directory]] or [https://bbs.archlinux.org/viewtopic.php?pid=993738] for solution.<br />
<br />
=== Other desktops and window managers ===<br />
<br />
In all other scenarios it is recommended to use the GNOME applet. You will also need to be sure that the {{Pkg|gnome-icon-theme}} package is installed to be able to display the applet.<br />
<br />
To store connection secrets install and configure [[gnome-keyring]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet > /dev/null 2>/dev/null &<br />
stalonetray > /dev/null 2>/dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the stalonetray window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
=== Command line ===<br />
<br />
The {{Pkg|networkmanager}} package contains [http://manpages.ubuntu.com/manpages/maverick/man1/nmcli.1.html nmcli] since version 0.8.1.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{ic|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{ic|/etc/hosts}}:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 localhost<br />
::1 localhost<br />
}}<br />
<br />
In case you have nss-myhostname turned off, the line would look like:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 my-laptop localhost<br />
::1 my-laptop localhost<br />
}}<br />
<br />
{{Note|It may be a good idea to use {{ic|1=systemctl --type=service}} to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.}}<br />
<br />
=== Enable NetworkManager ===<br />
<br />
Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need {{ic|nmcli}} or an applet to configure and connect.<br />
<br />
You can enable NetworkManager at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager}}<br />
<br />
You can start the NetworkManager daemon immediately with the following command:<br />
<br />
{{bc|# systemctl start NetworkManager}}<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
If you have services which fail if they are started before the network is up, you have to use {{ic|NetworkManager-wait-online.service}} in addition to the NetworkManager service. This is however hardly ever necessary since most network daemons start up fine, even if the network has not been configured yet.<br />
<br />
You can enable NetworkManager Wait Online at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager-wait-online}}<br />
<br />
In some cases the service will still fail to start sucessfully on boot:<br />
<br />
NetworkManager-wait-online.service: main process exited, code=exited, status=1/FAILURE<br />
Failed to start Network Manager Wait Online<br />
Unit NetworkManger-wait-online.service entered failed state<br />
Starting Network.<br />
Reached target Network.<br />
<br />
This is due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being to short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General Troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
''Option 1.'' Run a [[PolicyKit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
<br />
''Option 2.'' Add yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
<br />
''Option 3.'' Add yourself to the {{ic|network}} group and create the following file:<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});</nowiki>}}<br />
All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under systemd if you do not have an active session with [[Systemd#Using_systemd-logind|systemd-logind]].<br />
<br />
=== Network services with NetworkManager dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are [[OpenNTPD]] and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network and stop them when you disconnect. To activate the feature you need to enable/start the NetworkManager-dispatcher service:<br />
<br />
{{bc|# systemctl start NetworkManager-dispatcher}}<br />
{{bc|# systemctl enable NetworkManager-dispatcher}}<br />
<br />
Once the feature is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it is good practice to make them owned by '''root:root''' and writable only by the owner.<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. They receive two arguments: the name of the interface (e.g. ''eth0'') and the status (''up'' or ''down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10_portmap}} or {{ic|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in {{ic|/var/log/messages.log}} }}<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Start OpenNTPD ====<br />
<br />
The following example starts the OpenNTPD daemon when an interface is brought up. Save the file as {{ic|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
interface=$1 status=$2<br />
case $status in<br />
up)<br />
systemctl start openntpd<br />
;;<br />
down)<br />
if ! nm-tool | awk '/State:/{print $2}' | grep -qs connected; then<br />
systemctl stop openntpd<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this link] for more information. The example below works with [[gnome-keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely gnome-keyring has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli con status}} or {{ic|nmcli con list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "<uuid>" ]; then<br />
case $status in<br />
up)<br />
export SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
su "$USER" -c "sshfs $LOCAL $REMOTE"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network. <br />
<br />
:1. Create the dispatcher script:<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="wifi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli con up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli con status id "$VPN_NAME" | grep -qs activated; then<br />
nmcli con down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
Remember to make it executable with {{ic|chmod +x}} and to make the VPN connection available to all users. <br />
<br />
Trying to connect using this setup will fail and NetworkManager will complain about 'no valid VPN secrets', because of [http://projects.gnome.org/NetworkManager/developers/migrating-to-09/secrets-flags.html the way VPN secrets are stored] which brings us to step 2:<br />
<br />
:2. Edit your VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/<name of your VPN connection>}} and change the {{ic|password-flags}} and {{ic|secret-flags}} form {{ic|1}} to {{ic|0}}.<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and re-enter the VPN passwords/secrets.}}<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using GNOME, you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] wich handles proxy settings using NetworkManager's informations. You can find the package for {{AUR|proxydriver}} in the [[AUR]].<br />
<br />
In order for proxydriver to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (System -> Preferences -> Startup Applications):<br />
<br />
xhost +si:localuser:your_username<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[Daemon|start]] the ''networkmanager'' daemon.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[Awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Troubleshooting ==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Using nm-applet, wifi networks don't prompt for password and just disconnect ===<br />
<br />
This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}.<br />
<br />
=== No traffic via PPTP tunnel ===<br />
<br />
PPTP connection logins successfully, you see ppp0 interface with correct VPN IP, but you cannot even ping remote IP. It is due to lack of MPPE (Microsoft Point-to-Point Encryption) support in stock Arch pppd. It is recommended to first try with the stock Arch {{Pkg|ppp}} as it may work as intended.<br />
<br />
To solve the problem it should be sufficient to install {{AUR|ppp-mppe}} from the [[AUR]].<br />
<br />
=== Network management disabled ===<br />
<br />
Sometimes when NetworkManager shuts down but the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'll have to remove it manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{ic|/etc/rc.local}} to have it removed upon bootup:<br />
<br />
{{bc|<nowiki>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</nowiki>}}<br />
<br />
=== Using resolv.conf.head and resolv.conf.tail ===<br />
<br />
See [[resolv.conf]]. Also make sure that NetworkManager uses {{Pkg|dhcpcd}} and not {{Pkg|dhclient}}. If you want to use {{Pkg|dhclient}}, you may try the {{AUR|networkmanager-dispatch-resolv}} package from the [[AUR]].<br />
<br />
=== Preserving changes to resolv.conf ===<br />
<br />
See [[Resolv.conf]].<br />
<br />
=== DHCP problems ===<br />
<br />
{{Poor writing|solutions for {{Pkg|dhcpcd}} and {{Pkg|dhclient}} mixed together}}<br />
<br />
If you have problems with getting an IP via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{ic|aa:bb:cc:dd:ee:ff}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show eth0}} command from the {{Pkg|iproute2}} package.<br />
<br />
For some (incompliant) routers, you will not be able to connect properly unless you comment the line<br />
require dhcp_server_identifier<br />
in {{ic|/etc/dhcpcd.conf}} (note that this file is distinct from {{ic|dhcpd.conf}}). This should not cause issues unless you have multiple DHCP servers on your network (not typical); see [http://technet.microsoft.com/en-us/library/cc977442.aspx this page] for more information.<br />
<br />
=== Hostname problems ===<br />
<br />
{{Accuracy|no description of the problem|Talk:NetworkManager#Hostname_problems_Entry}}<br />
<br />
Add the following line to /etc/NetworkManager/NetworkManager.conf:<br />
dhcp=dhcpcd<br />
then restart.<br />
systemctl restart NetworkManager<br />
source https://bbs.archlinux.org/viewtopic.php?id=152376<br />
<br />
=== Missing default route ===<br />
<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
=== 3G modem not detected ===<br />
<br />
{{Out of date|{{Pkg|modemmanager}} is now a dependency of {{Pkg|networkmanager}}}}<br />
<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
{{Pkg|modemmanager}} and restart NetworkManager daemon with {{ic|systemctl restart NetworkManager}}. It may also be necessary to replug or restart your modem. This utility provides support for hardware not in NetworkManager's default database.<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with {{ic|rfkill}}. Install {{Pkg|rfkill}} from the [[official repositories]] and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies {{ic|rfkill}} about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} (''not'' as root). In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set_up_PolicyKit_permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden network are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/[SSID]<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in Gnome ===<br />
<br />
When setting up openconnect or vpnc connections in NetworkManager while using Gnome, you'll sometimes never see the dialog box pop up and the following error appears in /var/log/errors.log:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the Gnome NM Applet expecting dialog scripts to be at /usr/lib/gnome-shell, when NetworkManager's packages put them in /usr/lib/networkmanager.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
# For OpenConnect<br />
ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/ <br />
<br />
# For VPNC (i.e. Cisco VPN)<br />
ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g.: 3G or wired) with a few clicks using nm. You will need a supported Wi-Fi card (Cards based on Atheros AR9xx or at least AR5xx are probably best choice)<br />
<br />
==== Ad-hoc ====<br />
<br />
* [[pacman|Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Custom dnsmasq.conf may interfere with nm (not sure about this, but i think so).<br />
* Click on nm-applet -> Create new wireless network.<br />
* Follow wizard (if using WEP be sure to use 5 or 13 character long password, different lengths will fail).<br />
* Settings will remain stored for the next time you need it.<br />
<br />
==== Real AP ====<br />
<br />
Support of infrastructure mode (which is needed by Android phones as they do not intentionally support ad-hoc) is not currently supported by NetworkManager, but is in active development...<br />
<br />
See: http://fedoraproject.org/wiki/Features/RealHotspot<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's {{ic|nm-tool}} and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs {{ic|fpupdate}} for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from {{ic|nm-tool}}; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Automatically unlock keyring after login ===<br />
<br />
==== GNOME ====<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
* In {{ic|/etc/pam.d/gdm}} (or your corresponding daemon in {{ic|/etc/pam.d}}), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
* In {{ic|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using KDE with KDM, you can use {{AUR|pam-keyring-tool}} from the [[AUR]].}}<br />
<br />
Put a script like the following in {{ic|~/.kde4/Autostart}}:<br />
#!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
Similar should work with Openbox, LXDE, etc.<br />
<br />
==== SLiM login manager ====<br />
See [[Slim#SLiM and Gnome Keyring]].<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them.You can quickly and easily ignore devices by MAC by using the following in {{ic|/etc/NetworkManager/NetworkManager.conf}} :<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4<br />
After you have put this in, [[Daemon|restart]] NetworkManager, and you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Connect faster ===<br />
<br />
==== Disabling IPv6 ====<br />
<br />
Slow connection or reconnection to the network may be due to superfluous IPv6 queries in NetworkManager. If there is no IPv6 support on the local network, connecting to a network may take longer than normal while NetworkManager tries to establish an IPv6 connection that eventually times out. The solution is to disable IPv6 within NetworkManager which will make network connection faster. This has to be done once for every network you connect to.<br />
<br />
* Right-click on the network status icon.<br />
* Click on "Edit Connections".<br />
* Go to the "Wired" or "Wireless" tab, as appropriate.<br />
* Select the name of the network.<br />
* Click on "Edit".<br />
* Go to the "IPv6 Settings" tab.<br />
* In the "Method" dropdown, choose "Ignore/Disabled".<br />
* Click on "Save".<br />
<br />
==== Speed up DHCP by disabling ARP probing in DHCPCD ====<br />
<br />
{{ic|dhcpcd}} contains an implementation of a recommendation of the DHCP standard ([http://www.ietf.org/rfc/rfc2131.txt RFC2131] section 2.2) to check via ARP if the assigned IP address is really not taken. This seems mostly useless in home networks, so you can save about 5 seconds on every connect by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
This is equivalent to passing {{ic|--noarp}} to {{ic|dhcpcd}}, and disables the described ARP probing, speeding up connections to networks with DHCP.<br />
<br />
==== Use OpenDNS servers ====<br />
<br />
Create {{ic|/etc/resolv.conf.opendns}} with the nameservers:<br />
<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
or use Google DNS servers, because people have been getting ads via the OpenDNS servers lately <br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
And have the dispatcher replace the discovered DHCP servers with the OpenDNS ones:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/dns-servers-opendns|<nowiki><br />
#!/bin/bash<br />
# Use OpenDNS servers over DHCP discovered servers<br />
<br />
cp -f /etc/resolv.conf.opendns /etc/resolv.conf</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/NetworkManager/dispatcher.d/dns-servers-opendns</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=274031NetworkManager2013-09-02T06:25:36Z<p>Jeff story: </p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[ru:NetworkManager]]<br />
[[tr:NetworkManager]]<br />
[[zh-CN:NetworkManager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager can be installed with the package {{Pkg|networkmanager}}, available in the [[official repositories]].<br />
<br />
To get network manager working, I had to install {{Pkg|dhclient}}, even though dhcpcd from core was installed.<br />
<br />
=== VPN support ===<br />
<br />
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages from the [[official repositories]]:<br />
<br />
* {{Pkg|networkmanager-openvpn}}<br />
* {{Pkg|networkmanager-pptp}}<br />
* {{Pkg|networkmanager-vpnc}}<br />
<br />
== Graphical front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's {{Pkg|network-manager-applet}} is lightweight enough and works across all environments.<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users" install and configure [[GNOME Keyring]].<br />
<br />
=== KDE ===<br />
<br />
The KNetworkManager front-end is a Plasma widget available in the official repositories as package {{Pkg|kdeplasma-applets-networkmanagement}}.<br />
<br />
{{Note|If you are changing from another network managing tool like [[Wicd]], do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
If you have both the Plasma widget and {{ic|nm-applet}} installed and do not want to start {{ic|nm-applet}} when using KDE, add the following line to {{ic|/etc/xdg/autostart/nm-applet.desktop}}:<br />
NotShowIn=KDE<br />
<br />
See [http://userbase.kde.org/NetworkManagement Userbase page] for more info.<br />
<br />
=== XFCE ===<br />
{{Pkg|network-manager-applet}} will work fine in XFCE, but in order to see notifications, ''including error messages'', {{ic|nm-applet}} needs an implementation of the Freedesktop desktop notifications specification (see the [http://www.galago-project.org/specs/notification/0.9/index.html Galapago Project]) to display them. To enable notifications install {{Pkg|xfce4-notifyd}}, a package that provides an implementation for the specification.<br />
<br />
Without such a notification daemon, {{ic|nm-applet}} outputs the following errors to stdout/stderr:<br />
<br />
(nm-applet:24209): libnotify-WARNING **: Failed to connect to proxy<br />
** (nm-applet:24209): WARNING **: get_all_cb: couldn't retrieve<br />
system settings properties: (25) Launch helper exited with unknown<br />
return code 1.<br />
** (nm-applet:24209): WARNING **: fetch_connections_done: error<br />
fetching connections: (25) Launch helper exited with unknown return<br />
code 1.<br />
** (nm-applet:24209): WARNING **: Failed to register as an agent:<br />
(25) Launch helper exited with unknown return code 1<br />
<br />
{{ic|nm-applet}} will still work fine, though, but without notifications.<br />
<br />
If nm-applet is not prompting for a password when connecting to new wifi networks, and is just disconnecting immediately, you probably need to install {{Pkg|gnome-keyring}}.<br />
<br />
=== Openbox ===<br />
<br />
To function properly in Openbox, the GNOME applet requires the {{Pkg|xfce4-notifyd}} notification daemon for the same reason as in XFCE and the {{Pkg|gnome-icon-theme}} package to be able to display the applet in the systray.<br />
<br />
If you want to store authentication details (Wireless/DSL) install and configure [[gnome-keyring]].<br />
<br />
{{ic|nm-applet}} installs the autostart file at {{ic|/etc/xdg/autostart/nm-applet.desktop}}. If you have issues with it (e.g. {{ic|nm-applet}} is started twice or is not started at all), see [[Openbox#Autostart directory]] or [https://bbs.archlinux.org/viewtopic.php?pid=993738] for solution.<br />
<br />
=== Other desktops and window managers ===<br />
<br />
In all other scenarios it is recommended to use the GNOME applet. You will also need to be sure that the {{Pkg|gnome-icon-theme}} package is installed to be able to display the applet.<br />
<br />
To store connection secrets install and configure [[gnome-keyring]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet > /dev/null 2>/dev/null &<br />
stalonetray > /dev/null 2>/dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the stalonetray window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
=== Command line ===<br />
<br />
The {{Pkg|networkmanager}} package contains [http://manpages.ubuntu.com/manpages/maverick/man1/nmcli.1.html nmcli] since version 0.8.1.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{ic|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{ic|/etc/hosts}}:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 localhost<br />
::1 localhost<br />
}}<br />
<br />
In case you have nss-myhostname turned off, the line would look like:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 my-laptop localhost<br />
::1 my-laptop localhost<br />
}}<br />
<br />
{{Note|It may be a good idea to use {{ic|1=systemctl --type=service}} to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.}}<br />
<br />
=== Enable NetworkManager ===<br />
<br />
Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need {{ic|nmcli}} or an applet to configure and connect.<br />
<br />
You can enable NetworkManager at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager}}<br />
<br />
You can start the NetworkManager daemon immediately with the following command:<br />
<br />
{{bc|# systemctl start NetworkManager}}<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
If you have services which fail if they are started before the network is up, you have to use {{ic|NetworkManager-wait-online.service}} in addition to the NetworkManager service. This is however hardly ever necessary since most network daemons start up fine, even if the network has not been configured yet.<br />
<br />
You can enable NetworkManager Wait Online at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager-wait-online}}<br />
<br />
In some cases the service will still fail to start sucessfully on boot:<br />
<br />
NetworkManager-wait-online.service: main process exited, code=exited, status=1/FAILURE<br />
Failed to start Network Manager Wait Online<br />
Unit NetworkManger-wait-online.service entered failed state<br />
Starting Network.<br />
Reached target Network.<br />
<br />
This is due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being to short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General Troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
''Option 1.'' Run a [[PolicyKit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
<br />
''Option 2.'' Add yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
<br />
''Option 3.'' Add yourself to the {{ic|network}} group and create the following file:<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});</nowiki>}}<br />
All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under systemd if you do not have an active session with [[Systemd#Using_systemd-logind|systemd-logind]].<br />
<br />
=== Network services with NetworkManager dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are [[OpenNTPD]] and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network and stop them when you disconnect. To activate the feature you need to enable/start the NetworkManager-dispatcher service:<br />
<br />
{{bc|# systemctl start NetworkManager-dispatcher}}<br />
{{bc|# systemctl enable NetworkManager-dispatcher}}<br />
<br />
Once the feature is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it is good practice to make them owned by '''root:root''' and writable only by the owner.<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. They receive two arguments: the name of the interface (e.g. ''eth0'') and the status (''up'' or ''down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10_portmap}} or {{ic|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in {{ic|/var/log/messages.log}} }}<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Start OpenNTPD ====<br />
<br />
The following example starts the OpenNTPD daemon when an interface is brought up. Save the file as {{ic|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
interface=$1 status=$2<br />
case $status in<br />
up)<br />
systemctl start openntpd<br />
;;<br />
down)<br />
if ! nm-tool | awk '/State:/{print $2}' | grep -qs connected; then<br />
systemctl stop openntpd<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this link] for more information. The example below works with [[gnome-keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely gnome-keyring has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli con status}} or {{ic|nmcli con list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "<uuid>" ]; then<br />
case $status in<br />
up)<br />
export SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
su "$USER" -c "sshfs $LOCAL $REMOTE"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network. <br />
<br />
:1. Create the dispatcher script:<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="wifi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli con up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli con status id "$VPN_NAME" | grep -qs activated; then<br />
nmcli con down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
Remember to make it executable with {{ic|chmod +x}} and to make the VPN connection available to all users. <br />
<br />
Trying to connect using this setup will fail and NetworkManager will complain about 'no valid VPN secrets', because of [http://projects.gnome.org/NetworkManager/developers/migrating-to-09/secrets-flags.html the way VPN secrets are stored] which brings us to step 2:<br />
<br />
:2. Edit your VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/<name of your VPN connection>}} and change the {{ic|password-flags}} and {{ic|secret-flags}} form {{ic|1}} to {{ic|0}}.<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and re-enter the VPN passwords/secrets.}}<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using GNOME, you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] wich handles proxy settings using NetworkManager's informations. You can find the package for {{AUR|proxydriver}} in the [[AUR]].<br />
<br />
In order for proxydriver to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (System -> Preferences -> Startup Applications):<br />
<br />
xhost +si:localuser:your_username<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[Daemon|start]] the ''networkmanager'' daemon.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[Awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Troubleshooting ==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Using nm-applet, wifi networks don't prompt for password and just disconnect ===<br />
<br />
This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}.<br />
<br />
=== No traffic via PPTP tunnel ===<br />
<br />
PPTP connection logins successfully, you see ppp0 interface with correct VPN IP, but you cannot even ping remote IP. It is due to lack of MPPE (Microsoft Point-to-Point Encryption) support in stock Arch pppd. It is recommended to first try with the stock Arch {{Pkg|ppp}} as it may work as intended.<br />
<br />
To solve the problem it should be sufficient to install {{AUR|ppp-mppe}} from the [[AUR]].<br />
<br />
=== Network management disabled ===<br />
<br />
Sometimes when NetworkManager shuts down but the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'll have to remove it manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{ic|/etc/rc.local}} to have it removed upon bootup:<br />
<br />
{{bc|<nowiki>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</nowiki>}}<br />
<br />
=== Using resolv.conf.head and resolv.conf.tail ===<br />
<br />
See [[resolv.conf]]. Also make sure that NetworkManager uses {{Pkg|dhcpcd}} and not {{Pkg|dhclient}}. If you want to use {{Pkg|dhclient}}, you may try the {{AUR|networkmanager-dispatch-resolv}} package from the [[AUR]].<br />
<br />
=== Preserving changes to resolv.conf ===<br />
<br />
See [[Resolv.conf]].<br />
<br />
=== DHCP problems ===<br />
<br />
{{Poor writing|solutions for {{Pkg|dhcpcd}} and {{Pkg|dhclient}} mixed together}}<br />
<br />
If you have problems with getting an IP via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{ic|aa:bb:cc:dd:ee:ff}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show eth0}} command from the {{Pkg|iproute2}} package.<br />
<br />
For some (incompliant) routers, you will not be able to connect properly unless you comment the line<br />
require dhcp_server_identifier<br />
in {{ic|/etc/dhcpcd.conf}} (note that this file is distinct from {{ic|dhcpd.conf}}). This should not cause issues unless you have multiple DHCP servers on your network (not typical); see [http://technet.microsoft.com/en-us/library/cc977442.aspx this page] for more information.<br />
<br />
=== Hostname problems ===<br />
<br />
{{Accuracy|no description of the problem|Talk:NetworkManager#Hostname_problems_Entry}}<br />
<br />
Add the following line to /etc/NetworkManager/NetworkManager.conf:<br />
dhcp=dhcpcd<br />
then restart.<br />
systemctl restart NetworkManager<br />
source https://bbs.archlinux.org/viewtopic.php?id=152376<br />
<br />
=== Missing default route ===<br />
<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
=== 3G modem not detected ===<br />
<br />
{{Out of date|{{Pkg|modemmanager}} is now a dependency of {{Pkg|networkmanager}}}}<br />
<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
{{Pkg|modemmanager}} and restart NetworkManager daemon with {{ic|systemctl restart NetworkManager}}. It may also be necessary to replug or restart your modem. This utility provides support for hardware not in NetworkManager's default database.<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with {{ic|rfkill}}. Install {{Pkg|rfkill}} from the [[official repositories]] and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies {{ic|rfkill}} about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} (''not'' as root). In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set_up_PolicyKit_permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden network are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/[SSID]<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in Gnome ===<br />
<br />
When setting up openconnect or vpnc connections in NetworkManager while using Gnome, you'll sometimes never see the dialog box pop up and the following error appears in /var/log/errors.log:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the Gnome NM Applet expecting dialog scripts to be at /usr/lib/gnome-shell, when NetworkManager's packages put them in /usr/lib/networkmanager.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
# For OpenConnect<br />
ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/ <br />
<br />
# For VPNC (i.e. Cisco VPN)<br />
ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g.: 3G or wired) with a few clicks using nm. You will need a supported Wi-Fi card (Cards based on Atheros AR9xx or at least AR5xx are probably best choice)<br />
<br />
==== Ad-hoc ====<br />
<br />
* [[pacman|Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Custom dnsmasq.conf may interfere with nm (not sure about this, but i think so).<br />
* Click on nm-applet -> Create new wireless network.<br />
* Follow wizard (if using WEP be sure to use 5 or 13 character long password, different lengths will fail).<br />
* Settings will remain stored for the next time you need it.<br />
<br />
==== Real AP ====<br />
<br />
Support of infrastructure mode (which is needed by Android phones as they do not intentionally support ad-hoc) is not currently supported by NetworkManager, but is in active development...<br />
<br />
See: http://fedoraproject.org/wiki/Features/RealHotspot<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's {{ic|nm-tool}} and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs {{ic|fpupdate}} for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from {{ic|nm-tool}}; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Automatically unlock keyring after login ===<br />
<br />
==== GNOME ====<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
* In {{ic|/etc/pam.d/gdm}} (or your corresponding daemon in {{ic|/etc/pam.d}}), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
* In {{ic|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using KDE with KDM, you can use {{AUR|pam-keyring-tool}} from the [[AUR]].}}<br />
<br />
Put a script like the following in {{ic|~/.kde4/Autostart}}:<br />
#!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
Similar should work with Openbox, LXDE, etc.<br />
<br />
==== SLiM login manager ====<br />
See [[Slim#SLiM and Gnome Keyring]].<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them.You can quickly and easily ignore devices by MAC by using the following in {{ic|/etc/NetworkManager/NetworkManager.conf}} :<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4<br />
After you have put this in, [[Daemon|restart]] NetworkManager, and you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Connect faster ===<br />
<br />
==== Disabling IPv6 ====<br />
<br />
Slow connection or reconnection to the network may be due to superfluous IPv6 queries in NetworkManager. If there is no IPv6 support on the local network, connecting to a network may take longer than normal while NetworkManager tries to establish an IPv6 connection that eventually times out. The solution is to disable IPv6 within NetworkManager which will make network connection faster. This has to be done once for every network you connect to.<br />
<br />
* Right-click on the network status icon.<br />
* Click on "Edit Connections".<br />
* Go to the "Wired" or "Wireless" tab, as appropriate.<br />
* Select the name of the network.<br />
* Click on "Edit".<br />
* Go to the "IPv6 Settings" tab.<br />
* In the "Method" dropdown, choose "Ignore/Disabled".<br />
* Click on "Save".<br />
<br />
==== Speed up DHCP by disabling ARP probing in DHCPCD ====<br />
<br />
{{ic|dhcpcd}} contains an implementation of a recommendation of the DHCP standard ([http://www.ietf.org/rfc/rfc2131.txt RFC2131] section 2.2) to check via ARP if the assigned IP address is really not taken. This seems mostly useless in home networks, so you can save about 5 seconds on every connect by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
This is equivalent to passing {{ic|--noarp}} to {{ic|dhcpcd}}, and disables the described ARP probing, speeding up connections to networks with DHCP.<br />
<br />
==== Use OpenDNS servers ====<br />
<br />
Create {{ic|/etc/resolv.conf.opendns}} with the nameservers:<br />
<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
or use Google DNS servers, because people have been getting ads via the OpenDNS servers lately <br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
And have the dispatcher replace the discovered DHCP servers with the OpenDNS ones:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/dns-servers-opendns|<nowiki><br />
#!/bin/bash<br />
# Use OpenDNS servers over DHCP discovered servers<br />
<br />
cp -f /etc/resolv.conf.opendns /etc/resolv.conf</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/NetworkManager/dispatcher.d/dns-servers-opendns</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=274030NetworkManager2013-09-02T06:18:39Z<p>Jeff story: </p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:NetworkManager]]<br />
[[de:Networkmanager]]<br />
[[es:NetworkManager]]<br />
[[fr:NetworkManager]]<br />
[[it:NetworkManager]]<br />
[[ja:NetworkManager]]<br />
[[pt:NetworkManager]]<br />
[[ru:NetworkManager]]<br />
[[tr:NetworkManager]]<br />
[[zh-CN:NetworkManager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager can be installed with the package {{Pkg|networkmanager}}, available in the [[official repositories]].<br />
<br />
To get network manager working, you will also need the package {{Pkg|dhclient}} if you don't plan on using a static ip.<br />
<br />
=== VPN support ===<br />
<br />
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages from the [[official repositories]]:<br />
<br />
* {{Pkg|networkmanager-openvpn}}<br />
* {{Pkg|networkmanager-pptp}}<br />
* {{Pkg|networkmanager-vpnc}}<br />
<br />
== Graphical front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's {{Pkg|network-manager-applet}} is lightweight enough and works across all environments.<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users" install and configure [[GNOME Keyring]].<br />
<br />
=== KDE ===<br />
<br />
The KNetworkManager front-end is a Plasma widget available in the official repositories as package {{Pkg|kdeplasma-applets-networkmanagement}}.<br />
<br />
{{Note|If you are changing from another network managing tool like [[Wicd]], do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
If you have both the Plasma widget and {{ic|nm-applet}} installed and do not want to start {{ic|nm-applet}} when using KDE, add the following line to {{ic|/etc/xdg/autostart/nm-applet.desktop}}:<br />
NotShowIn=KDE<br />
<br />
See [http://userbase.kde.org/NetworkManagement Userbase page] for more info.<br />
<br />
=== XFCE ===<br />
{{Pkg|network-manager-applet}} will work fine in XFCE, but in order to see notifications, ''including error messages'', {{ic|nm-applet}} needs an implementation of the Freedesktop desktop notifications specification (see the [http://www.galago-project.org/specs/notification/0.9/index.html Galapago Project]) to display them. To enable notifications install {{Pkg|xfce4-notifyd}}, a package that provides an implementation for the specification.<br />
<br />
Without such a notification daemon, {{ic|nm-applet}} outputs the following errors to stdout/stderr:<br />
<br />
(nm-applet:24209): libnotify-WARNING **: Failed to connect to proxy<br />
** (nm-applet:24209): WARNING **: get_all_cb: couldn't retrieve<br />
system settings properties: (25) Launch helper exited with unknown<br />
return code 1.<br />
** (nm-applet:24209): WARNING **: fetch_connections_done: error<br />
fetching connections: (25) Launch helper exited with unknown return<br />
code 1.<br />
** (nm-applet:24209): WARNING **: Failed to register as an agent:<br />
(25) Launch helper exited with unknown return code 1<br />
<br />
{{ic|nm-applet}} will still work fine, though, but without notifications.<br />
<br />
If nm-applet is not prompting for a password when connecting to new wifi networks, and is just disconnecting immediately, you probably need to install {{Pkg|gnome-keyring}}.<br />
<br />
=== Openbox ===<br />
<br />
To function properly in Openbox, the GNOME applet requires the {{Pkg|xfce4-notifyd}} notification daemon for the same reason as in XFCE and the {{Pkg|gnome-icon-theme}} package to be able to display the applet in the systray.<br />
<br />
If you want to store authentication details (Wireless/DSL) install and configure [[gnome-keyring]].<br />
<br />
{{ic|nm-applet}} installs the autostart file at {{ic|/etc/xdg/autostart/nm-applet.desktop}}. If you have issues with it (e.g. {{ic|nm-applet}} is started twice or is not started at all), see [[Openbox#Autostart directory]] or [https://bbs.archlinux.org/viewtopic.php?pid=993738] for solution.<br />
<br />
=== Other desktops and window managers ===<br />
<br />
In all other scenarios it is recommended to use the GNOME applet. You will also need to be sure that the {{Pkg|gnome-icon-theme}} package is installed to be able to display the applet.<br />
<br />
To store connection secrets install and configure [[gnome-keyring]].<br />
<br />
In order to run {{ic|nm-applet}} without a systray, you can use {{Pkg|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:<br />
{{hc|nmgui|<nowiki><br />
#!/bin/sh<br />
nm-applet > /dev/null 2>/dev/null &<br />
stalonetray > /dev/null 2>/dev/null<br />
killall nm-applet<br />
</nowiki>}}<br />
<br />
When you close the stalonetray window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.<br />
<br />
=== Command line ===<br />
<br />
The {{Pkg|networkmanager}} package contains [http://manpages.ubuntu.com/manpages/maverick/man1/nmcli.1.html nmcli] since version 0.8.1.<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{ic|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{ic|/etc/hosts}}:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 localhost<br />
::1 localhost<br />
}}<br />
<br />
In case you have nss-myhostname turned off, the line would look like:<br />
<br />
{{hc|/etc/hosts|<br />
127.0.0.1 my-laptop localhost<br />
::1 my-laptop localhost<br />
}}<br />
<br />
{{Note|It may be a good idea to use {{ic|1=systemctl --type=service}} to ensure that no other service is running that may want to configure the network. Multiple networking services will conflict.}}<br />
<br />
=== Enable NetworkManager ===<br />
<br />
Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need {{ic|nmcli}} or an applet to configure and connect.<br />
<br />
You can enable NetworkManager at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager}}<br />
<br />
You can start the NetworkManager daemon immediately with the following command:<br />
<br />
{{bc|# systemctl start NetworkManager}}<br />
<br />
=== Enable NetworkManager Wait Online ===<br />
If you have services which fail if they are started before the network is up, you have to use {{ic|NetworkManager-wait-online.service}} in addition to the NetworkManager service. This is however hardly ever necessary since most network daemons start up fine, even if the network has not been configured yet.<br />
<br />
You can enable NetworkManager Wait Online at startup with the following command:<br />
<br />
{{bc|# systemctl enable NetworkManager-wait-online}}<br />
<br />
In some cases the service will still fail to start sucessfully on boot:<br />
<br />
NetworkManager-wait-online.service: main process exited, code=exited, status=1/FAILURE<br />
Failed to start Network Manager Wait Online<br />
Unit NetworkManger-wait-online.service entered failed state<br />
Starting Network.<br />
Reached target Network.<br />
<br />
This is due to the timeout setting in {{ic|/usr/lib/systemd/system/NetworkManager-wait-online.service}} being to short. Change the default timeout from 30 to a higher value.<br />
<br />
=== Set up PolicyKit permissions ===<br />
<br />
See [[General Troubleshooting#Session permissions]] for setting up a working session.<br />
<br />
With a working session, you have several options for granting the necessary privileges to NetworkManager:<br />
<br />
''Option 1.'' Run a [[PolicyKit]] authentication agent when you log in, such as {{ic|/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1}} (part of {{Pkg|polkit-gnome}}). You will be prompted for your password whenever you add or remove a network connection.<br />
<br />
''Option 2.'' Add yourself to the {{ic|wheel}} group. You will not have to enter your password, but your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.<br />
<br />
''Option 3.'' Add yourself to the {{ic|network}} group and create the following file:<br />
{{hc|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules|<nowiki><br />
polkit.addRule(function(action, subject) {<br />
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {<br />
return polkit.Result.YES;<br />
}<br />
});</nowiki>}}<br />
All users in the {{ic|network}} group will be able to add and remove networks without a password. This will not work under systemd if you do not have an active session with [[Systemd#Using_systemd-logind|systemd-logind]].<br />
<br />
=== Network services with NetworkManager dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are [[OpenNTPD]] and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network and stop them when you disconnect. To activate the feature you need to enable/start the NetworkManager-dispatcher service:<br />
<br />
{{bc|# systemctl start NetworkManager-dispatcher}}<br />
{{bc|# systemctl enable NetworkManager-dispatcher}}<br />
<br />
Once the feature is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it is good practice to make them owned by '''root:root''' and writable only by the owner.<br />
<br />
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. They receive two arguments: the name of the interface (e.g. ''eth0'') and the status (''up'' or ''down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10_portmap}} or {{ic|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in {{ic|/var/log/messages.log}} }}<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Start OpenNTPD ====<br />
<br />
The following example starts the OpenNTPD daemon when an interface is brought up. Save the file as {{ic|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
interface=$1 status=$2<br />
case $status in<br />
up)<br />
systemctl start openntpd<br />
;;<br />
down)<br />
if ! nm-tool | awk '/State:/{print $2}' | grep -qs connected; then<br />
systemctl stop openntpd<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
==== Mount remote folder with sshfs ====<br />
<br />
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this link] for more information. The example below works with [[gnome-keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely gnome-keyring has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli con status}} or {{ic|nmcli con list}}. <br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
USER='username'<br />
REMOTE='user@host:/remote/path'<br />
LOCAL='/local/path'<br />
<br />
interface=$1 status=$2<br />
if [ "$CONNECTION_UUID" = "<uuid>" ]; then<br />
case $status in<br />
up)<br />
export SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user "$USER" -name 'ssh')<br />
su "$USER" -c "sshfs $LOCAL $REMOTE"<br />
;;<br />
down)<br />
fusermount -u "$LOCAL"<br />
;;<br />
esac<br />
fi<br />
</nowiki>}}<br />
<br />
==== Use dispatcher to connect to a VPN after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network. <br />
<br />
:1. Create the dispatcher script:<br />
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|<nowiki><br />
#!/bin/sh<br />
VPN_NAME="name of VPN connection defined in NetworkManager"<br />
ESSID="wifi network ESSID (not connection name)"<br />
<br />
interface=$1 status=$2<br />
case $status in<br />
up|vpn-down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
nmcli con up id "$VPN_NAME"<br />
fi<br />
;;<br />
down)<br />
if iwgetid | grep -qs ":\"$ESSID\""; then<br />
if nmcli con status id "$VPN_NAME" | grep -qs activated; then<br />
nmcli con down id "$VPN_NAME"<br />
fi<br />
fi<br />
;;<br />
esac<br />
</nowiki>}}<br />
Remember to make it executable with {{ic|chmod +x}} and to make the VPN connection available to all users. <br />
<br />
Trying to connect using this setup will fail and NetworkManager will complain about 'no valid VPN secrets', because of [http://projects.gnome.org/NetworkManager/developers/migrating-to-09/secrets-flags.html the way VPN secrets are stored] which brings us to step 2:<br />
<br />
:2. Edit your VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/<name of your VPN connection>}} and change the {{ic|password-flags}} and {{ic|secret-flags}} form {{ic|1}} to {{ic|0}}.<br />
<br />
{{Note|It may now be necessary to re-open the NetworkManager connection editor and re-enter the VPN passwords/secrets.}}<br />
<br />
=== Proxy settings ===<br />
<br />
NetworkManager does not directly handle proxy settings, but if you are using GNOME, you could use [http://marin.jb.free.fr/proxydriver/ proxydriver] wich handles proxy settings using NetworkManager's informations. You can find the package for {{AUR|proxydriver}} in the [[AUR]].<br />
<br />
In order for proxydriver to be able to change the proxy settings, you would need to execute this command, as part of the GNOME startup process (System -> Preferences -> Startup Applications):<br />
<br />
xhost +si:localuser:your_username<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[Daemon|start]] the ''networkmanager'' daemon.<br />
<br />
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu. If it does not, you are going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant window managers like [[Awesome]]:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
== Troubleshooting ==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Using nm-applet, wifi networks don't prompt for password and just disconnect ===<br />
<br />
This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}.<br />
<br />
=== No traffic via PPTP tunnel ===<br />
<br />
PPTP connection logins successfully, you see ppp0 interface with correct VPN IP, but you cannot even ping remote IP. It is due to lack of MPPE (Microsoft Point-to-Point Encryption) support in stock Arch pppd. It is recommended to first try with the stock Arch {{Pkg|ppp}} as it may work as intended.<br />
<br />
To solve the problem it should be sufficient to install {{AUR|ppp-mppe}} from the [[AUR]].<br />
<br />
=== Network management disabled ===<br />
<br />
Sometimes when NetworkManager shuts down but the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'll have to remove it manually:<br />
<br />
# rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{ic|/etc/rc.local}} to have it removed upon bootup:<br />
<br />
{{bc|<nowiki>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</nowiki>}}<br />
<br />
=== Using resolv.conf.head and resolv.conf.tail ===<br />
<br />
See [[resolv.conf]]. Also make sure that NetworkManager uses {{Pkg|dhcpcd}} and not {{Pkg|dhclient}}. If you want to use {{Pkg|dhclient}}, you may try the {{AUR|networkmanager-dispatch-resolv}} package from the [[AUR]].<br />
<br />
=== Preserving changes to resolv.conf ===<br />
<br />
See [[Resolv.conf]].<br />
<br />
=== DHCP problems ===<br />
<br />
{{Poor writing|solutions for {{Pkg|dhcpcd}} and {{Pkg|dhclient}} mixed together}}<br />
<br />
If you have problems with getting an IP via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{ic|aa:bb:cc:dd:ee:ff}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show eth0}} command from the {{Pkg|iproute2}} package.<br />
<br />
For some (incompliant) routers, you will not be able to connect properly unless you comment the line<br />
require dhcp_server_identifier<br />
in {{ic|/etc/dhcpcd.conf}} (note that this file is distinct from {{ic|dhcpd.conf}}). This should not cause issues unless you have multiple DHCP servers on your network (not typical); see [http://technet.microsoft.com/en-us/library/cc977442.aspx this page] for more information.<br />
<br />
=== Hostname problems ===<br />
<br />
{{Accuracy|no description of the problem|Talk:NetworkManager#Hostname_problems_Entry}}<br />
<br />
Add the following line to /etc/NetworkManager/NetworkManager.conf:<br />
dhcp=dhcpcd<br />
then restart.<br />
systemctl restart NetworkManager<br />
source https://bbs.archlinux.org/viewtopic.php?id=152376<br />
<br />
=== Missing default route ===<br />
<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
=== 3G modem not detected ===<br />
<br />
{{Out of date|{{Pkg|modemmanager}} is now a dependency of {{Pkg|networkmanager}}}}<br />
<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
{{Pkg|modemmanager}} and restart NetworkManager daemon with {{ic|systemctl restart NetworkManager}}. It may also be necessary to replug or restart your modem. This utility provides support for hardware not in NetworkManager's default database.<br />
<br />
=== Switching off WLAN on laptops ===<br />
<br />
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with {{ic|rfkill}}. Install {{Pkg|rfkill}} from the [[official repositories]] and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies {{ic|rfkill}} about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
=== Static IP settings revert to DHCP ===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.<br />
<br />
To work around this issue you have to edit the default connection (e.g. "Auto eth0") in {{ic|nm-applet}}, change the connection name (e.g. "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click '''Apply'''. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run {{ic|nm-connection-editor}} (''not'' as root). In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click '''Apply''' and close the connection editor.<br />
<br />
=== Cannot edit connections as normal user ===<br />
<br />
See [[#Set_up_PolicyKit_permissions]].<br />
<br />
=== Forget hidden wireless network ===<br />
<br />
Since hidden network are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:<br />
<br />
# rm /etc/NetworkManager/system-connections/[SSID]<br />
<br />
This works for any other connection.<br />
<br />
=== VPN not working in Gnome ===<br />
<br />
When setting up openconnect or vpnc connections in NetworkManager while using Gnome, you'll sometimes never see the dialog box pop up and the following error appears in /var/log/errors.log:<br />
<br />
localhost NetworkManager[399]: <error> [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.<br />
<br />
This is caused by the Gnome NM Applet expecting dialog scripts to be at /usr/lib/gnome-shell, when NetworkManager's packages put them in /usr/lib/networkmanager.<br />
As a "temporary" fix (this bug has been around for a while now), make the following symlink(s):<br />
<br />
# For OpenConnect<br />
ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/ <br />
<br />
# For VPNC (i.e. Cisco VPN)<br />
ln -s /usr/lib/networkmanager/nm-vpnc-auth-dialog /usr/lib/gnome-shell/<br />
<br />
This may need to be done for any other NM VPN plugins as well, but these are the two most common.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Sharing internet connection over Wi-Fi ===<br />
<br />
You can share your internet connection (e.g.: 3G or wired) with a few clicks using nm. You will need a supported Wi-Fi card (Cards based on Atheros AR9xx or at least AR5xx are probably best choice)<br />
<br />
==== Ad-hoc ====<br />
<br />
* [[pacman|Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection.<br />
* Custom dnsmasq.conf may interfere with nm (not sure about this, but i think so).<br />
* Click on nm-applet -> Create new wireless network.<br />
* Follow wizard (if using WEP be sure to use 5 or 13 character long password, different lengths will fail).<br />
* Settings will remain stored for the next time you need it.<br />
<br />
==== Real AP ====<br />
<br />
Support of infrastructure mode (which is needed by Android phones as they do not intentionally support ad-hoc) is not currently supported by NetworkManager, but is in active development...<br />
<br />
See: http://fedoraproject.org/wiki/Features/RealHotspot<br />
<br />
=== Checking if networking is up inside a cron job or script ===<br />
<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's {{ic|nm-tool}} and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a {{ic|cron.hourly}} script that runs {{ic|fpupdate}} for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from {{ic|nm-tool}}; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
=== Automatically unlock keyring after login ===<br />
<br />
==== GNOME ====<br />
<br />
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
* In {{ic|/etc/pam.d/gdm}} (or your corresponding daemon in {{ic|/etc/pam.d}}), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
* In {{ic|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using KDE with KDM, you can use {{AUR|pam-keyring-tool}} from the [[AUR]].}}<br />
<br />
Put a script like the following in {{ic|~/.kde4/Autostart}}:<br />
#!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
Similar should work with Openbox, LXDE, etc.<br />
<br />
==== SLiM login manager ====<br />
See [[Slim#SLiM and Gnome Keyring]].<br />
<br />
=== Ignore specific devices ===<br />
<br />
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them.You can quickly and easily ignore devices by MAC by using the following in {{ic|/etc/NetworkManager/NetworkManager.conf}} :<br />
[keyfile]<br />
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4<br />
After you have put this in, [[Daemon|restart]] NetworkManager, and you should be able to configure interfaces without NetworkManager altering what you have set.<br />
<br />
=== Connect faster ===<br />
<br />
==== Disabling IPv6 ====<br />
<br />
Slow connection or reconnection to the network may be due to superfluous IPv6 queries in NetworkManager. If there is no IPv6 support on the local network, connecting to a network may take longer than normal while NetworkManager tries to establish an IPv6 connection that eventually times out. The solution is to disable IPv6 within NetworkManager which will make network connection faster. This has to be done once for every network you connect to.<br />
<br />
* Right-click on the network status icon.<br />
* Click on "Edit Connections".<br />
* Go to the "Wired" or "Wireless" tab, as appropriate.<br />
* Select the name of the network.<br />
* Click on "Edit".<br />
* Go to the "IPv6 Settings" tab.<br />
* In the "Method" dropdown, choose "Ignore/Disabled".<br />
* Click on "Save".<br />
<br />
==== Speed up DHCP by disabling ARP probing in DHCPCD ====<br />
<br />
{{ic|dhcpcd}} contains an implementation of a recommendation of the DHCP standard ([http://www.ietf.org/rfc/rfc2131.txt RFC2131] section 2.2) to check via ARP if the assigned IP address is really not taken. This seems mostly useless in home networks, so you can save about 5 seconds on every connect by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
This is equivalent to passing {{ic|--noarp}} to {{ic|dhcpcd}}, and disables the described ARP probing, speeding up connections to networks with DHCP.<br />
<br />
==== Use OpenDNS servers ====<br />
<br />
Create {{ic|/etc/resolv.conf.opendns}} with the nameservers:<br />
<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
or use Google DNS servers, because people have been getting ads via the OpenDNS servers lately <br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
And have the dispatcher replace the discovered DHCP servers with the OpenDNS ones:<br />
<br />
{{hc|/etc/NetworkManager/dispatcher.d/dns-servers-opendns|<nowiki><br />
#!/bin/bash<br />
# Use OpenDNS servers over DHCP discovered servers<br />
<br />
cp -f /etc/resolv.conf.opendns /etc/resolv.conf</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/NetworkManager/dispatcher.d/dns-servers-opendns</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Noip&diff=244491Noip2013-01-19T22:48:49Z<p>Jeff story: </p>
<hr />
<div>I believe we need a noip wiki page. Please share your knowledge, thanks, The following example is obsolete for "pure" systemd.<br />
<br />
install example:<br />
<br />
# Pacman-S noip<br />
resolving dependencies ... Made.<br />
Conflict checking ... Made.<br />
<br />
To install: noip-2.1.4-1<br />
<br />
Total packet size: 0.10 MB<br />
<br />
Continue with the installation? [Y / n] Y<br />
:: Downloading packages from community ...<br />
noip 17.1 K 33.1 K / s 00:00:01 [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
Verifying package integrity ... Made.<br />
cleaning ... Done.<br />
(1/1) checking file conflicts [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
(1/1) installing noip [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
# IMPORTANT! #<br />
# Running noip2 BEFORE YOU MUST SET IT! #<br />
# To configure noip2 run the command "noip2-C-Y" #<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
<br />
# Noip2-C-Y<br />
<br />
Auto configuration for Linux client of no-ip.com.<br />
<br />
Please enter the login / email string for no-ip.com TUDIRECCIONDEMAIL<br />
Please enter the password for user 'youremail@mail.com' PASSWORD<br />
<br />
Only one host [yourchoice.no-ip.org] is registered to this account.<br />
It will be used.<br />
Do you wish to run something at successful update? [N] (y / N) and<br />
Please enter the script / program name<br />
<br />
New configuration file '/ etc/no-ip2.conf' created.<br />
<br />
To start:<br />
# / Etc / rc.d / noip start<br />
<br />
And to start at power always add it to the daemons section of / etc / rc.conf<br />
<br />
DAEMONS = (syslog-ng network netfs crond alsa! Cups hal adsl noip! Tor! Privoxy! Dbus! Httpd! Mysqld)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Noip&diff=244490Noip2013-01-19T22:48:09Z<p>Jeff story: </p>
<hr />
<div>I believe we need a noip wiki page. Please share your knowledge, thanks, The following example is obsolete for systemd.<br />
<br />
install example:<br />
<br />
# Pacman-S noip<br />
resolving dependencies ... Made.<br />
Conflict checking ... Made.<br />
<br />
To install: noip-2.1.4-1<br />
<br />
Total packet size: 0.10 MB<br />
<br />
Continue with the installation? [Y / n] Y<br />
:: Downloading packages from community ...<br />
noip 17.1 K 33.1 K / s 00:00:01 [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
Verifying package integrity ... Made.<br />
cleaning ... Done.<br />
(1/1) checking file conflicts [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
(1/1) installing noip [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
# IMPORTANT! #<br />
# Running noip2 BEFORE YOU MUST SET IT! #<br />
# To configure noip2 run the command "noip2-C-Y" #<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
<br />
# Noip2-C-Y<br />
<br />
Auto configuration for Linux client of no-ip.com.<br />
<br />
Please enter the login / email string for no-ip.com TUDIRECCIONDEMAIL<br />
Please enter the password for user 'youremail@mail.com' PASSWORD<br />
<br />
Only one host [yourchoice.no-ip.org] is registered to this account.<br />
It will be used.<br />
Do you wish to run something at successful update? [N] (y / N) and<br />
Please enter the script / program name<br />
<br />
New configuration file '/ etc/no-ip2.conf' created.<br />
<br />
To start:<br />
# / Etc / rc.d / noip start<br />
<br />
And to start at power always add it to the daemons section of / etc / rc.conf<br />
<br />
DAEMONS = (syslog-ng network netfs crond alsa! Cups hal adsl noip! Tor! Privoxy! Dbus! Httpd! Mysqld)</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Noip&diff=244489Noip2013-01-19T22:43:17Z<p>Jeff story: Created page with "I believe we need a noip wiki page. Please share your knowledge. Thanks. To install on ArchLinux: # Pacman-S noip resolving dependencies ... Made. Conflict checking ... Made..."</p>
<hr />
<div>I believe we need a noip wiki page. Please share your knowledge. Thanks.<br />
<br />
To install on ArchLinux:<br />
<br />
# Pacman-S noip<br />
resolving dependencies ... Made.<br />
Conflict checking ... Made.<br />
<br />
To install: noip-2.1.4-1<br />
<br />
Total packet size: 0.10 MB<br />
<br />
Continue with the installation? [Y / n] Y<br />
:: Downloading packages from community ...<br />
noip 17.1 K 33.1 K / s 00:00:01 [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
Verifying package integrity ... Made.<br />
cleaning ... Done.<br />
(1/1) checking file conflicts [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
(1/1) installing noip [# # # # # # # # # # # # # # # # # # # # #] 100%<br />
<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
# IMPORTANT! #<br />
# Running noip2 BEFORE YOU MUST SET IT! #<br />
# To configure noip2 run the command "noip2-C-Y" #<br />
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<br />
<br />
# Noip2-C-Y<br />
<br />
Auto configuration for Linux client of no-ip.com.<br />
<br />
Please enter the login / email string for no-ip.com TUDIRECCIONDEMAIL<br />
Please enter the password for user 'braianel22@gmail.com' PASSWORD<br />
<br />
Only one host [braianet.no-ip.org] is registered to this account.<br />
It will be used.<br />
Do you wish to run something at successful update? [N] (y / N) and<br />
Please enter the script / program name<br />
<br />
New configuration file '/ etc/no-ip2.conf' created.<br />
<br />
To start:<br />
# / Etc / rc.d / noip start<br />
<br />
And to start at power always add it to the daemons section of / etc / rc.conf<br />
<br />
DAEMONS = (syslog-ng network netfs crond alsa! Cups hal adsl noip! Tor! Privoxy! Dbus! Httpd! Mysqld)<br />
<br />
Thanks to no-ip can have a web or ftp server and accessed from anywhere in the world, knowing only our domain name :). Greetings!</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Deluge&diff=235622Deluge2012-11-16T09:34:15Z<p>Jeff story: </p>
<hr />
<div>[[de:Deluge Installation]]<br />
[[es:Deluge]]<br />
[[ko:Deluge]]<br />
[[Category:Internet Applications]]<br />
[http://deluge-torrent.org/ Deluge] is a full-featured BitTorrent client for Linux, OS X, Unix and Windows. It uses libtorrent in its backend and features multiple user-interfaces including: GTK+, web and console. It has been designed using the client server model with a daemon process that handles all the bittorrent activity. The Deluge daemon is able to run on headless machines with the user-interfaces being able to connect remotely from any platform. Deluge is not designed for any one desktop environment and will work just fine in GNOME, KDE, XFCE and others. Deluge is Free Software and is licensed under the GNU General Public License.<br />
<br />
==Install==<br />
[[pacman| Install]] {{Pkg|deluge}} from the [[official repositories]].<br />
<br />
==Configuration==<br />
If you want to run Deluge as user just run:<br />
# deluge -u [gtk|web|console]<br />
<br />
===daemon===<br />
Please note, deluge works perfectly fine without its daemon running. The install process should create the defaults "deluge" user and group, with user deluge being a member of group deluge. You can change deluge's default user or group in deluge.conf <br />
<br />
<br />
In case of systemd journal logging errors, it be necessary to copy /usr/lib/tmpfiles.d/deluge.conf to /etc/tmpfiles.d. <br />
<br />
<br />
The rest of this guide will assume you use the default '''deluge''' user. This is that user's default home directory and therefore its configuration location is in {{ic|/srv/deluge}}. This should be fine under most circumstances. Note that this is NOT the default download location, it only holds its configuration and ssl certificates. You will be able to change all other options later on once you get a client working.<br />
<br />
Next, start the [[daemon]] to generate its default configuration in its home directory:<br />
<br />
==Graphical Clients==<br />
<br />
===GTK UI===<br />
The GTK UI needs to have {{Pkg|pygtk}} and {{Pkg|librsvg}} installed on the clients.<br />
If the deluge daemon is running stop it.<br />
<br />
In order to connect remotely via the GTK UI, there should be something like this in {{ic|/srv/deluge/.config/deluge/core.conf}}:<br />
"allow_remote": true,<br />
<br />
Now add yourself to the authentification file:<br />
# echo "yourusername:yourpassword:10" >> /srv/deluge/.config/deluge/auth<br />
<br />
The authentification level is not used at this time. Read [http://dev.deluge-torrent.org/wiki/UserGuide/Authentication more] about that.<br />
<br />
Start the Deluge daemon again.<br />
<br />
Now start the GTK UI. If you prefer, you can edit the preferences in {{ic|~/.config/deluge/gtkui.conf}}, but there's also a nice configuration tool in the UI.<br />
<br />
Look for '''classic mode''' and disable it. Then go to Edit -> Connection Manager and add your daemon.<br />
<br />
===Web UI===<br />
The web UI daemon runs on the server and the clients only need a web browser. You need to install {{Pkg|python2-mako}} on the server.<br />
<br />
First, start the web UI [[daemon]], named ''deluge-web'', and login at {{ic|http://''ip-address'':8112}}. Where ''ip-address'' is the name of your Deluge server or its private or public IP address. When asked for a password, enter "deluge" as it is the default password.<br />
<br />
The preferences in the web UI should be rather self explanatory and the first obvious thing to do is to change your password.<br />
<br />
====Automatically Connect To Daemon====<br />
If you want to avoid clicking "connect" everytime you start the Deluge web UI, edit the {{ic|web.conf}} file in your configuration directory (usually {{ic|/srv/deluge/.config/deluge}}). <br />
It should have a line like this towards the bottom:<br />
'''<br />
"default_daemon": "" <br />
<br />
Change it to:<br />
'''<br />
"default_daemon": "127.0.0.1:58846" <br />
<br />
This assumes that your Deluge port is the default 58846.<br />
<br />
====SSL====<br />
In case you want SSL for the web UI, you need to generate a new cert/key set. To do this, first stop the web UI daemon and then append to {{ic|/srv/deluge/.config/deluge/ssl/}}:<br />
<br />
# openssl req -new -x509 -nodes -out deluge.cert.pem -keyout deluge.key.pem<br />
<br />
Next you need to edit {{ic|/srv/deluge/.config/deluge/web.conf}} and change the '''pkey''' and '''cert''' configuration directives to use your new self-signed certificates and also enable SSL:<br />
...<br />
"pkey": "ssl/deluge.key.pem",<br />
...<br />
"cert": "ssl/deluge.cert.pem",<br />
...<br />
"https": true,<br />
<br />
Afterwards just start the web UI daemon again.<br />
<br />
====Apache configuration====<br />
<br />
As of this writing, it is possible to use ProxyPass and ProxyPassReverse with Apache to run your Deluge web UI with a web server. To do so, add the following lines to your {{ic|httpd.conf}}.<br />
<br />
Uncomment the Virtual Hosts line:<br />
<br />
Include conf/extra/httpd-vhosts.conf<br />
<br />
That is all the editing that needs to be done for the {{ic|httpd.conf}}. Next, navigate to the {{ic|extra/}} folder and edit the {{ic|httpd-vhosts.conf}} file. Append to the file, the following:<br />
<br />
{{bc|<VirtualHost *:80><br />
ServerAlias subdomain.example.com<br />
ProxyRequests off<br />
ProxyPass / http://127.0.0.1:8112/<br />
ProxyPassReverse / http://127.0.0.1:8112/<br />
</VirtualHost><br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
=== Downloads don't start ===<br />
As of libtorrent-rasterbar version 0.16, Deluge will not download torrents that are added by a magnet link.<br />
* https://bugs.archlinux.org/task/29414<br />
* https://bbs.archlinux.org/viewtopic.php?id=151249<br />
<br />
=== Web UI doesn't store settings ===<br />
For some yet unknown reason, the web interface with Deluge 1.3.3 refuses to properly store the incoming (listen) ports configuration. This can manually be edited in core.conf. The Deluge bugtracker mentions this is fixed, it is not in 1.3.3.<br />
<br />
{{hc|/srv/deluge/.config/deluge/core.conf|...<br />
"enc_prefer_rc4": true, <br />
"listen_ports": [<br />
49160, <br />
49249<br />
], <br />
"dht": false, <br />
...}}<br />
<br />
=== Daemon won't start on fresh install ===<br />
There seems to be an issue creating a folder with the correct permissions when the package installs, try:<br />
# chmod u+x /srv/deluge</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=MATE&diff=217171MATE2012-08-09T03:45:48Z<p>Jeff story: </p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[it:MATE]]<br />
[[ru:MATE]]<br />
[[zh-CN:MATE]]<br />
{{Article summary start}}<br />
{{Article summary text|What is MATE and how to get it.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|MATE|http://mate-desktop.org}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|GNOME}}<br />
{{Article summary end}}<br />
<br />
The '''MATE Desktop Environment''' is a fork of GNOME 2 that aims to provide an attractive and intuitive desktop to Linux users using traditional metaphors. For more information, see [https://bbs.archlinux.org/viewtopic.php?id=121162 this forum thread.]<br />
<br />
== Obtaining ==<br />
<br />
MATE is currently developed on [https://github.com/Perberos/Mate-Desktop-Environment GitHub].<br />
Stable packages with release-based version numbering are hosted on http://packages.mate-desktop.org/repo/archlinux/.<br />
Development packages with date-based version numbering are also available through the AUR ({{AUR|mate-desktop-environment}}).<br />
<br />
== Installation ==<br />
<br />
To install the stable version of MATE via [[pacman]] add the following lines to your {{ic|/etc/pacman.conf}}:<br />
<br />
{{bc|<nowiki><br />
[mate]<br />
Server = http://repo.mate-desktop.org/archlinux/$arch<br />
</nowiki>}}<br />
<br />
Run<br />
<br />
# pacman -Syy<br />
<br />
and then<br />
<br />
# pacman -S mate<br />
<br />
'''IMPORTANT: As of 8/8/12, the mate group does not install the package mate-session-manager. Mate DE will NOT run without this package.'''<br />
<br />
# pacman -S mate-session-manager<br />
<br />
It might also be of interest to people to install certain packages from the '''mate-extras''' group (most being counterparts to packages in the {{Grp|gnome-extra}} group):<br />
<br />
# pacman -S mate-extras<br />
<br />
You are very likely to get file conflicts when installing. Simply rename the offending files or install with the {{ic|--force}} flag. You will also require [[dbus]].<br />
<br />
{{note|Currently, many MATE packages do not provide, conflict or replace any GNOME packages.}}<br />
<br />
== Starting ==<br />
<br />
Always make sure dbus is in your DAEMONS array in [[rc.conf]] before starting MATE.<br />
<br />
=== Manually ===<br />
<br />
In order to start MATE manually, you must add<br />
<br />
exec ck-launch-session mate-session<br />
<br />
to your {{ic|[[xinitrc|~/.xinitrc]]}} file and then run<br />
<br />
$ startx<br />
<br />
{{note|If you have authorization problems (e.g. when mounting disks), try adding {{ic|dbus-launch}} after {{ic|ck-launch-session}}.}}<br />
<br />
=== Automatically at boot time ===<br />
<br />
See [[Display Manager]] and [[Start X at Boot]] for details.<br />
<br />
==== GDM (Old) ====<br />
<br />
If you are using {{AUR|gdm-old}} from the AUR, simply select the MATE session from the Sessions list. For your first time launching MATE, make sure to click "Just this session" when prompted.<br />
<br />
==== LXDM ====<br />
<br />
Just select MATE from the Sessions list. Works well.<br />
<br />
==== MATE Display Manager ====<br />
<br />
The MATE Display Manager (MDM) is the MATE desktop's counterpart to the GNOME Display Manager (GDM). It's package 'mate-display-manager' has been found in the '''mate-extra''' group or in the AUR package {{AUR|mate-display-manager}}. It has worked relatively the same as GDM does/did; unfortunately, the subproject is currently in flux, and MDM is not now (2012/07/01) available.<br />
<br />
==== [[KDM]] ====<br />
<br />
In order to be able to launch MATE from [[KDM]], the [[KDE]] Display Manager, you have to edit the KDM configuration.<br />
As root, edit the <code>/usr/share/config/kdm/kdmrc</code> configuration file. Find the '''SessionsDir''' parameter and add <code>/usr/share/xsessions</code> to the list.<br />
It should then look like this:<br />
<br />
SessionsDirs=/usr/share/config/kdm/sessions,/usr/share/apps/kdm/sessions,/usr/share/xsessions<br />
<br />
Restart KDM and select the "MATE session" from the list.<br />
<br />
==== [[SLIM]] ====<br />
<br />
Just fоllow the [[SLIM]] tutorial to know how to install and how to copy and use the .xinitrc file. And just add this line to the .xinitrc file :<br />
exec mate-session<br />
<br />
== Applications ==<br />
<br />
=== Core applications ===<br />
<br />
It is important to note that many GNOME core applications are rebranded for MATE, as per the licensing terms. Here is a simple Rosetta Stone of GNOME -> MATE applications. <br />
<br />
* Nautilus is renamed '''caja'''<br />
* Metacity is renamed '''marco'''<br />
* Gconf is renamed '''mate-conf'''<br />
<br />
Other applications and core components prefixed with GNOME (such as GNOME Panel, GNOME Menus etc) have simply had the prefix renamed "MATE" and become MATE Panel and MATE Menus.<br />
<br />
=== Extra applications ===<br />
<br />
Not all of the GNOME extra applications (built for GTK2) have been forked yet. The following extra applications '''are''' available in MATE:<br />
<br />
* Totem (mate-video-player)<br />
* Eye of GNOME (mate-image-viewer)<br />
* Gedit (mate-text-editor)<br />
* File Roller (mate-file-archiver)<br />
* GNOME Panel applets (mate-applets)<br />
* GNOME Terminal (mate-terminal)<br />
<br />
If you are using NetworkManager to connect to the internet, you can install {{AUR|network-manager-applet-gtk2}} from the AUR for a GTK2 nm-applet. You will need to modify the PKGBUILD to depend on mate-bluetooth rather than gnome-bluetooth to prevent a recursive dependency on gnome-desktop.<br />
<br />
== Known issues ==<br />
<br />
=== Endless spawning of file manager instances ===<br />
<br />
You may find that after you log in, the Caja file manager keeps spawning new instances and never stops. A temporary fix is performed with the following command:<br />
<br />
# ln -s /usr/lib/libgnutls.so /usr/lib/libgnutls.so.26<br />
<br />
Log out and log back in again once you perform this command.<br />
<br />
This may also fix an issue where the clock panel applet does not appear.<br />
<br />
=== Qt Applications are not styled ===<br />
<br />
You may find that Qt4 applications are not inheriting the GTK2 theme like they should. This can be fixed easily by installing {{pkg|libgnomeui}} with the {{ic|--force}} flag. If the problem persists, run qtconfig and make sure that the selected GUI Style is GTK+. This is likely to be fixed as MATE development continues.<br />
<br />
=== Evolution Email Not Working ===<br />
<br />
Please see [[Evolution#Using_Evolution_Outside_Of_Gnome]].<br />
<br />
=== Sticky Notes lost between Reboots ===<br />
<br />
As of Version 1.1.0, the Sticky Notes Panel Applet fails to save the notes created. This can be easily solved with the following two commands:<br />
<br />
$ mkdir /home/username/.config/mate/<br />
$ touch /home/username/.config/mate/stickynotes_applet<br />
<br />
For more information, see [http://forums.mate-desktop.org/viewtopic.php?f=7&t=15 this post] in the MATE Forums.</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Broadcom_wireless&diff=214536Broadcom wireless2012-07-24T19:20:59Z<p>Jeff story: </p>
<hr />
<div>[[zh-CN:Broadcom wireless]]<br />
[[Category:Wireless Networking]]<br />
<br />
== Introduction ==<br />
<br />
Broadcom has been notorious in its support for its Wi-Fi cards on GNU/Linux. Until recently, most Broadcom chips were either entirely unsupported or required the user to tinker with firmware. A limited set of wireless chips were supported by various reverse-engineered drivers ({{ic|brcm4xxx}}, {{ic|b43}}, etc.). The reverse-engineered [http://wireless.kernel.org/en/users/Drivers/b43 {{ic|b43}}] drivers have been in the kernel since 2.6.24.<br />
<br />
In August 2008, Broadcom released the [http://www.broadcom.com/support/802.11/linux_sta.php 802.11 Linux STA driver] officially supporting Broadcom wireless hardware on GNU/Linux. These are restrictively licensed drivers, but Broadcom promised to work towards a more open approach in the future. Further, they do not work with hidden ESSIDs.<br />
<br />
In September 2010, Broadcom [http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418 finally released] fully open source drivers for its hardware. This driver, [http://wireless.kernel.org/en/users/Drivers/brcm80211 {{ic|brcm80211}}], has been included into the kernel since 2.6.37. With the release of 2.6.39, these drivers have been renamed to {{ic|brcmsmac}} and {{ic|brcmfmac}}.<br />
<br />
At the time of writing, there are three choices for users with Broadcom Wi-Fi chipsets:<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Driver !! Description<br />
|-<br />
|brcmsmac/brcmfmac || Open source kernel driver<br />
|-<br />
|b43 || Reversed engineered kernel driver<br />
|-<br />
|broadcom-wl || Proprietary Broadcom STA driver<br />
|}<br />
<br />
== Determine which driver you need/can use ==<br />
<br />
First, determine your card's [http://en.wikipedia.org/wiki/PCI_configuration_space PCI-ID]. Type the following (case-sensitive) command into a console:<br />
$ lspci -vnn | grep 14e4<br />
<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmsmac}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224 <br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|}<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmfmac}} SDIO driver]]:<br />
{| border="1"<br />
! Name<br />
|-<br />
| BCM4329<br />
|}<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/brcm80211 here].<br />
<br />
If your card is not in the above lists, you need to use the older {{ic|b43}} or {{ic|b43legacy}} driver, which supports following devices.<br />
{| border="1"<br />
! PCI-ID !! Name !! Notes<br />
|-<br />
| {{ic|[14e4:4301]}} || BCM4301 || legacy-only<br />
|-<br />
| {{ic|[14e4:4306]}} || BCM4306 || <s>?legacy</s><br />
|-<br />
| {{ic|[14e4:4307]}} || BCM4306 ||<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4318]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4319]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4320]}} || BCM4306 || ?legacy<br />
|-<br />
| {{ic|[14e4:4321]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4324]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4325]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321 ||<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227 ||<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228 ||<br />
|}<br />
?legacy means that there are devices with same PCI-IDs, but with different hardware available.<br />
Some of these work with the {{ic|b43}} driver, but some might need {{ic|b43legacy}} driver.<br />
legacy-only means that you need to use the {{ic|b43legacy}} driver.<br />
<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/b43 here].<br />
<br />
If your card is in the following list, you can use the [[#broadcom-wl|{{ic|broadcom-wl}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224<br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228<br />
|}<br />
A more up-to-date list may be found [http://www.broadcom.com/docs/linux_sta/README.txt here].<br />
<br />
== Getting the driver ==<br />
<br />
=== brcmsmac/brcmfmac ===<br />
The {{ic|brcm80211}} drivers have been included in the kernel since 2.6.37. Since the release of 2.6.39, they have been renamed to {{ic|brcmsmac}} (for PCI cards) and {{ic|brcmfmac}} (for SDIO).<br />
<br />
These drivers should be automatically loaded during startup and no further action should be required of the user. If the driver doesn't auto load, try the following commands.<br />
# modprobe brcmsmac<br />
or<br />
# modprobe brcmfmac<br />
<br />
{{Note|The {{ic|bcma}} module can prevent some cards from showing up and may need to be [[#Wi-Fi_card_does_not_work.2Fshow_up_since_kernel_upgrade_.28brcmsmac.29|blacklisted]].}}<br />
<br />
{{Note|Since linux 3.3.1 the {{ic|brcmsmac}} driver depends on the {{ic|bcma}} module and blacklisting is no longer required.}}<br />
<br />
{{Note|[http://wireless.kernel.org/en/users/Drivers/brcm80211 wireless.kernel.org] states that brcm80211 does not support older PCI/PCI-E chips with ssb backplane.}}<br />
<br />
=== b43/b43legacy ===<br />
The drivers are included in the kernel since 2.6.24.<br />
<br />
==== Loading the b43/b43legacy kernel module ====<br />
Verify which module you need by looking up your device [http://wireless.kernel.org/en/users/Drivers/b43#Known_PCI_devices here]. You can also check by computer model [http://linuxwireless.org/en/users/Drivers/b43/devices here]. Blacklist the other module (either {{ic|b43}} or {{ic|b43legacy}}) to prevent possible problems/confusion. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
Install the appropriate {{AUR|b43-firmware}} or {{AUR|b43-firmware-legacy}} package from the [[AUR]].<br />
<br />
You can now configure your device.<br />
<br />
=== broadcom-wl ===<br />
{{Warning|This driver is more likely to cause problems than to resolve them. Most of the problems reported by users on Broadcom chips are caused by this driver. Using this is HIGHLY NOT recommended. Before you even think of trying out this one, make sure to try the other drivers first.}}<br />
For users of the {{ic|broadcom-wl}} driver, there is a PKGBUILD available in the AUR ({{AUR|broadcom-wl}}). You can also download this driver directly from [http://www.broadcom.com/support/802.11/linux_sta.php Broadcom]. However, the PKGBUILD method is strongly encouraged, as that way will have [[pacman]] track all of the files.<br />
<br />
==== Loading the wl kernel module ====<br />
The {{ic|wl}} module may need to be manually loaded if there are other usable modules present. Before loading the {{ic|wl}} module, remove the {{ic|b43}} or other module that may have been automatically loaded instead:<br />
# rmmod b43<br />
<br />
Also unload {{ic|ssb}}, if loaded:<br />
# rmmod ssb<br />
<br />
{{Note|Failure to unload {{ic|ssb}} may result in the wireless interface not being created.}}<br />
<br />
Load the {{ic|wl}} module<br />
# modprobe wl<br />
<br />
The {{ic|wl}} module should automatically load {{ic|lib80211}} or {{ic|lib80211_crypt_tkip}}. Check with {{ic|lsmod}} to see if this is the case. If not, you may need to add one of those two modules as well.<br />
# modprobe lib80211<br />
<br />
or<br />
# modprobe lib80211_crypt_tkip<br />
<br />
If you installed the driver directly from Broadcom, you may also need to update the dependencies:<br />
# depmod -a<br />
<br />
To make the module load at boot, add {{ic|wl}} (and {{ic|lib80211}}/{{ic|lib80211_crypt_tkip}}, if needed) to your MODULES array in {{ic|/etc/rc.conf}}.<br />
MODULES=(... wl...)<br />
<br />
You can also blacklist other modules (to prevent them from interfering) in {{ic|/etc/modprobe.d/modprobe.conf}}. To blacklist a module just append a new line with the syntax {{ic|blacklist <module name>}}:<br />
blacklist b43<br />
blacklist ssb<br />
<br />
{{Warning|Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] does not work with blacklisting {{ic|b43}} and {{ic|ssb}}.}}<br />
<br />
== Troubleshooting ==<br />
=== Wi-Fi card does not work or show up after kernel upgrade (brcmsmac) ===<br />
<br />
This is caused by the kernel using the {{ic|bcma}} module instead of the {{ic|brcmsmac}} module. The solution is to blacklist the {{ic|bcma}} module. For instructions, see [[Kernel_modules#Blacklisting]].<br />
{{Note|This affects only Linux kernels 3.0, 3.1, and 3.2. Since kernel 3.3, the {{ic|brcmsmac}} module actually uses {{ic|bcma}}, so {{ic|bcma}} needs to be unblacklisted or the Wi-Fi interface will not appear.}}<br />
<br />
=== Wi-Fi card does not work when resuming from suspend (brcm80211) ===<br />
{{Note|This issue only affects Linux kernels 2.6.38 and earlier.}}<br />
The {{ic|brcm80211}} module needs to be unloaded before suspend and reloaded upon resume, otherwise Wi-Fi will not come back up. This is printed by {{ic|dmesg}}:<br />
wlc_coreinit: ucode did not self-suspend!<br />
wlc_suspend_mac_and_wait: waited 83000 uS and MI_MACSSPNDD is still not on.<br />
psmdebug 0x000f8773, phydebug 0x00000000, psm_brc 0x0000<br />
<br />
The [[pm-utils]] page explains how to do this. If the file does not already exist, create a file called {{ic|modules}} or {{ic|config}} in {{ic|/etc/pm/config.d/}} and add/modify the following line:<br />
SUSPEND_MODULES="brcm80211"<br />
<br />
Now, the card should resume working correctly.<br />
<br />
An alternative procedure:<br />
<br />
1. Create the new file {{ic|/etc/pm/sleep.d/brcm.sh}}<br />
<br />
2. Insert this code and save:<br />
#!/bin/bash<br />
# Simple Bash script to fix resume from suspend issues...<br />
# Place this script in /etc/pm/sleep.d/<br />
# then chmod +x /etc/pm/sleep.d/brcm.sh<br />
case $1 in<br />
hibernate|suspend)<br />
/sbin/modprobe -r brcm80211<br />
;;<br />
thaw|resume)<br />
/sbin/modprobe brcm80211<br />
;;<br />
esac<br />
<br />
3. Make it executable:<br />
chmod +x /etc/pm/sleep.d/brcm.sh<br />
<br />
=== Wi-Fi card does not work/show up (broadcom-wl) ===<br />
Check if you are loading the correct modules. You may need to blacklist the {{ic|brcm80211}}, {{ic|b43}}, and {{ic|ssb}} kernel modules to prevent them from loading automatically. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
{{Note|You may not have to blacklist the {{ic|brcm80211}} driver; although as of 2011-06-20, it will still default to loading the {{ic|brcm80211}} module before the {{ic|wl}} driver, which prevents {{ic|wl}} from being used.}}<br />
<br />
Check if you updated your module dependencies:<br />
# depmod -a<br />
<br />
* Verify that your wireless interface(s) appear using {{ic|ip addr}}.<br />
* You may need to restart your machine to see the device appear in {{ic|iwconfig}} or {{ic|ip addr}}.<br />
* If you have recently upgraded your kernel, you need to rebuild the {{ic|broadcom-wl}} package with the new kernel installed to update the module.<br />
<br />
=== Interfaces swapped (broadcom-wl) ===<br />
Users of the {{ic|broadcom-wl}} driver may find their Ethernet and Wi-Fi interfaces have been swapped. The [http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot udev] page explains how to resolve this. Create a file named {{ic|/etc/udev/rules.d/10-network.rules}} and bind the MAC address of each of your cards to a certain interface name:<br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="eth0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="eth1"<br />
<br />
Ensure that the interface name appears correctly in {{ic|/etc/rc.conf}} and other configuration files that refer to it.<br />
<br />
=== Miscellaneous user notes ===<br />
* In my Dell Inspiron Laptop, I have a Broadcom BCM4401 Ethernet card and a Broadcom BCM4328 wireless card. If I just remove {{ic|b43}}, I can load the {{ic|wl}} driver, but no wireless card shows up. However, if I first remove the {{ic|b44}} (and {{ic|ssb}}) driver for my Ethernet card, and ''then'' load the {{ic|wl}} driver, I get a wireless device using the name ''eth0''. Afterwards, I can load {{ic|b44}} again, to have an Ethernet ''eth1'' device.<br />
<br />
* I could not get the BCM4313 chip on a Lenovo B560 to work before following these steps:<br />
*# "Load defaults" in the BIOS. After that, the wireless was working under MS Windows. There are not many options in there, so I do not know what the reset may have changed, but it did the trick.<br />
*# Blacklist the {{ic|acer_wmi}} module. For testing, you can add the following to the kernel line in GRUB: {{ic|acer_wmi.disable<nowiki>=</nowiki>1}}<br />
<br />
* I have found that to get the {{ic|wl}} drivers working for the Broadcom 4313 chip, you need to blacklist {{ic|brcm80211}} along with {{ic|b43}} and {{ic|ssb}}.<br />
<br />
* If you notice slow wireless speeds when your laptop/netbook is not connected to AC power, you may need to disable Wi-Fi power management by adding the following line (assuming ''wlan0'' is your wireless device) {{ic|iwconfig wlan0 power off}} to {{ic|/etc/rc.local}} and create an empty file {{ic|/etc/pm/power.d/wireless}}. In case you also experience interface swapping (discussed above), you might want to add another line for the second interface name as well. The command will have no effect on the wired interface.<br />
<br />
* In my case on a HP pavilion netbook DM1 with a BCM4313 chip, with the original kernel brcmsmac driver, the LED didn't work, the power was awful, and it kept loosing the signal all the time, unless very close to the wifi hotspot. The last broadcom driver {{ic|wl}} solved everything. So in some cases, it's actually better than the kernel driver. However, I had to install it in the initram image, along with lib80211 and lib80211_crypt_tkip to avoid a recurring kernel panic. (Use mkinitcpio)<br />
<br />
* On a similar HP DM1 netbook I found the brcmsmac driver did not work either. The kernel panic can also be solved by blacklisting the brcmsmac, b43 and wl drivers. In rc.local you can modprobe wl without problems. On a sidenote: I get hard lockups, without any way to debug because there is nothing in kernel.log. Not sure if related to the wl driver though.<br />
<br />
* Likewise, my HP Pavilion g7-1374ca also had problems with stock kernel drivers. I downloaded Broadcom tarball, but it wouldn't compile in 3.4.3. I removed the #include <asm/system.h> line and commented out a line referencing .ndo_set_multicast_list (there's only one). Then I was able to compile and load the module for a 100% strength signal, no lockups so far.</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Broadcom_wireless&diff=214535Broadcom wireless2012-07-24T19:18:51Z<p>Jeff story: </p>
<hr />
<div>[[zh-CN:Broadcom wireless]]<br />
[[Category:Wireless Networking]]<br />
<br />
== Introduction ==<br />
<br />
Broadcom has been notorious in its support for its Wi-Fi cards on GNU/Linux. Until recently, most Broadcom chips were either entirely unsupported or required the user to tinker with firmware. A limited set of wireless chips were supported by various reverse-engineered drivers ({{ic|brcm4xxx}}, {{ic|b43}}, etc.). The reverse-engineered [http://wireless.kernel.org/en/users/Drivers/b43 {{ic|b43}}] drivers have been in the kernel since 2.6.24.<br />
<br />
In August 2008, Broadcom released the [http://www.broadcom.com/support/802.11/linux_sta.php 802.11 Linux STA driver] officially supporting Broadcom wireless hardware on GNU/Linux. These are restrictively licensed drivers, but Broadcom promised to work towards a more open approach in the future. Further, they do not work with hidden ESSIDs.<br />
<br />
In September 2010, Broadcom [http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418 finally released] fully open source drivers for its hardware. This driver, [http://wireless.kernel.org/en/users/Drivers/brcm80211 {{ic|brcm80211}}], has been included into the kernel since 2.6.37. With the release of 2.6.39, these drivers have been renamed to {{ic|brcmsmac}} and {{ic|brcmfmac}}.<br />
<br />
At the time of writing, there are three choices for users with Broadcom Wi-Fi chipsets:<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Driver !! Description<br />
|-<br />
|brcmsmac/brcmfmac || Open source kernel driver<br />
|-<br />
|b43 || Reversed engineered kernel driver<br />
|-<br />
|broadcom-wl || Proprietary Broadcom STA driver<br />
|}<br />
<br />
== Determine which driver you need/can use ==<br />
<br />
First, determine your card's [http://en.wikipedia.org/wiki/PCI_configuration_space PCI-ID]. Type the following (case-sensitive) command into a console:<br />
$ lspci -vnn | grep 14e4<br />
<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmsmac}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224 <br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|}<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmfmac}} SDIO driver]]:<br />
{| border="1"<br />
! Name<br />
|-<br />
| BCM4329<br />
|}<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/brcm80211 here].<br />
<br />
If your card is not in the above lists, you need to use the older {{ic|b43}} or {{ic|b43legacy}} driver, which supports following devices.<br />
{| border="1"<br />
! PCI-ID !! Name !! Notes<br />
|-<br />
| {{ic|[14e4:4301]}} || BCM4301 || legacy-only<br />
|-<br />
| {{ic|[14e4:4306]}} || BCM4306 || <s>?legacy</s><br />
|-<br />
| {{ic|[14e4:4307]}} || BCM4306 ||<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4318]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4319]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4320]}} || BCM4306 || ?legacy<br />
|-<br />
| {{ic|[14e4:4321]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4324]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4325]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321 ||<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227 ||<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228 ||<br />
|}<br />
?legacy means that there are devices with same PCI-IDs, but with different hardware available.<br />
Some of these work with the {{ic|b43}} driver, but some might need {{ic|b43legacy}} driver.<br />
legacy-only means that you need to use the {{ic|b43legacy}} driver.<br />
<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/b43 here].<br />
<br />
If your card is in the following list, you can use the [[#broadcom-wl|{{ic|broadcom-wl}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224<br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228<br />
|}<br />
A more up-to-date list may be found [http://www.broadcom.com/docs/linux_sta/README.txt here].<br />
<br />
== Getting the driver ==<br />
<br />
=== brcmsmac/brcmfmac ===<br />
The {{ic|brcm80211}} drivers have been included in the kernel since 2.6.37. Since the release of 2.6.39, they have been renamed to {{ic|brcmsmac}} (for PCI cards) and {{ic|brcmfmac}} (for SDIO).<br />
<br />
These drivers should be automatically loaded during startup and no further action should be required of the user. If the driver doesn't auto load, try the following command: <br />
# modprobe brcmsmac<br />
<br />
{{Note|The {{ic|bcma}} module can prevent some cards from showing up and may need to be [[#Wi-Fi_card_does_not_work.2Fshow_up_since_kernel_upgrade_.28brcmsmac.29|blacklisted]].}}<br />
<br />
{{Note|Since linux 3.3.1 the {{ic|brcmsmac}} driver depends on the {{ic|bcma}} module and blacklisting is no longer required.}}<br />
<br />
{{Note|[http://wireless.kernel.org/en/users/Drivers/brcm80211 wireless.kernel.org] states that brcm80211 does not support older PCI/PCI-E chips with ssb backplane.}}<br />
<br />
=== b43/b43legacy ===<br />
The drivers are included in the kernel since 2.6.24.<br />
<br />
==== Loading the b43/b43legacy kernel module ====<br />
Verify which module you need by looking up your device [http://wireless.kernel.org/en/users/Drivers/b43#Known_PCI_devices here]. You can also check by computer model [http://linuxwireless.org/en/users/Drivers/b43/devices here]. Blacklist the other module (either {{ic|b43}} or {{ic|b43legacy}}) to prevent possible problems/confusion. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
Install the appropriate {{AUR|b43-firmware}} or {{AUR|b43-firmware-legacy}} package from the [[AUR]].<br />
<br />
You can now configure your device.<br />
<br />
=== broadcom-wl ===<br />
{{Warning|This driver is more likely to cause problems than to resolve them. Most of the problems reported by users on Broadcom chips are caused by this driver. Using this is HIGHLY NOT recommended. Before you even think of trying out this one, make sure to try the other drivers first.}}<br />
For users of the {{ic|broadcom-wl}} driver, there is a PKGBUILD available in the AUR ({{AUR|broadcom-wl}}). You can also download this driver directly from [http://www.broadcom.com/support/802.11/linux_sta.php Broadcom]. However, the PKGBUILD method is strongly encouraged, as that way will have [[pacman]] track all of the files.<br />
<br />
==== Loading the wl kernel module ====<br />
The {{ic|wl}} module may need to be manually loaded if there are other usable modules present. Before loading the {{ic|wl}} module, remove the {{ic|b43}} or other module that may have been automatically loaded instead:<br />
# rmmod b43<br />
<br />
Also unload {{ic|ssb}}, if loaded:<br />
# rmmod ssb<br />
<br />
{{Note|Failure to unload {{ic|ssb}} may result in the wireless interface not being created.}}<br />
<br />
Load the {{ic|wl}} module<br />
# modprobe wl<br />
<br />
The {{ic|wl}} module should automatically load {{ic|lib80211}} or {{ic|lib80211_crypt_tkip}}. Check with {{ic|lsmod}} to see if this is the case. If not, you may need to add one of those two modules as well.<br />
# modprobe lib80211<br />
<br />
or<br />
# modprobe lib80211_crypt_tkip<br />
<br />
If you installed the driver directly from Broadcom, you may also need to update the dependencies:<br />
# depmod -a<br />
<br />
To make the module load at boot, add {{ic|wl}} (and {{ic|lib80211}}/{{ic|lib80211_crypt_tkip}}, if needed) to your MODULES array in {{ic|/etc/rc.conf}}.<br />
MODULES=(... wl...)<br />
<br />
You can also blacklist other modules (to prevent them from interfering) in {{ic|/etc/modprobe.d/modprobe.conf}}. To blacklist a module just append a new line with the syntax {{ic|blacklist <module name>}}:<br />
blacklist b43<br />
blacklist ssb<br />
<br />
{{Warning|Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] does not work with blacklisting {{ic|b43}} and {{ic|ssb}}.}}<br />
<br />
== Troubleshooting ==<br />
=== Wi-Fi card does not work or show up after kernel upgrade (brcmsmac) ===<br />
<br />
This is caused by the kernel using the {{ic|bcma}} module instead of the {{ic|brcmsmac}} module. The solution is to blacklist the {{ic|bcma}} module. For instructions, see [[Kernel_modules#Blacklisting]].<br />
{{Note|This affects only Linux kernels 3.0, 3.1, and 3.2. Since kernel 3.3, the {{ic|brcmsmac}} module actually uses {{ic|bcma}}, so {{ic|bcma}} needs to be unblacklisted or the Wi-Fi interface will not appear.}}<br />
<br />
=== Wi-Fi card does not work when resuming from suspend (brcm80211) ===<br />
{{Note|This issue only affects Linux kernels 2.6.38 and earlier.}}<br />
The {{ic|brcm80211}} module needs to be unloaded before suspend and reloaded upon resume, otherwise Wi-Fi will not come back up. This is printed by {{ic|dmesg}}:<br />
wlc_coreinit: ucode did not self-suspend!<br />
wlc_suspend_mac_and_wait: waited 83000 uS and MI_MACSSPNDD is still not on.<br />
psmdebug 0x000f8773, phydebug 0x00000000, psm_brc 0x0000<br />
<br />
The [[pm-utils]] page explains how to do this. If the file does not already exist, create a file called {{ic|modules}} or {{ic|config}} in {{ic|/etc/pm/config.d/}} and add/modify the following line:<br />
SUSPEND_MODULES="brcm80211"<br />
<br />
Now, the card should resume working correctly.<br />
<br />
An alternative procedure:<br />
<br />
1. Create the new file {{ic|/etc/pm/sleep.d/brcm.sh}}<br />
<br />
2. Insert this code and save:<br />
#!/bin/bash<br />
# Simple Bash script to fix resume from suspend issues...<br />
# Place this script in /etc/pm/sleep.d/<br />
# then chmod +x /etc/pm/sleep.d/brcm.sh<br />
case $1 in<br />
hibernate|suspend)<br />
/sbin/modprobe -r brcm80211<br />
;;<br />
thaw|resume)<br />
/sbin/modprobe brcm80211<br />
;;<br />
esac<br />
<br />
3. Make it executable:<br />
chmod +x /etc/pm/sleep.d/brcm.sh<br />
<br />
=== Wi-Fi card does not work/show up (broadcom-wl) ===<br />
Check if you are loading the correct modules. You may need to blacklist the {{ic|brcm80211}}, {{ic|b43}}, and {{ic|ssb}} kernel modules to prevent them from loading automatically. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
{{Note|You may not have to blacklist the {{ic|brcm80211}} driver; although as of 2011-06-20, it will still default to loading the {{ic|brcm80211}} module before the {{ic|wl}} driver, which prevents {{ic|wl}} from being used.}}<br />
<br />
Check if you updated your module dependencies:<br />
# depmod -a<br />
<br />
* Verify that your wireless interface(s) appear using {{ic|ip addr}}.<br />
* You may need to restart your machine to see the device appear in {{ic|iwconfig}} or {{ic|ip addr}}.<br />
* If you have recently upgraded your kernel, you need to rebuild the {{ic|broadcom-wl}} package with the new kernel installed to update the module.<br />
<br />
=== Interfaces swapped (broadcom-wl) ===<br />
Users of the {{ic|broadcom-wl}} driver may find their Ethernet and Wi-Fi interfaces have been swapped. The [http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot udev] page explains how to resolve this. Create a file named {{ic|/etc/udev/rules.d/10-network.rules}} and bind the MAC address of each of your cards to a certain interface name:<br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="eth0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="eth1"<br />
<br />
Ensure that the interface name appears correctly in {{ic|/etc/rc.conf}} and other configuration files that refer to it.<br />
<br />
=== Miscellaneous user notes ===<br />
* In my Dell Inspiron Laptop, I have a Broadcom BCM4401 Ethernet card and a Broadcom BCM4328 wireless card. If I just remove {{ic|b43}}, I can load the {{ic|wl}} driver, but no wireless card shows up. However, if I first remove the {{ic|b44}} (and {{ic|ssb}}) driver for my Ethernet card, and ''then'' load the {{ic|wl}} driver, I get a wireless device using the name ''eth0''. Afterwards, I can load {{ic|b44}} again, to have an Ethernet ''eth1'' device.<br />
<br />
* I could not get the BCM4313 chip on a Lenovo B560 to work before following these steps:<br />
*# "Load defaults" in the BIOS. After that, the wireless was working under MS Windows. There are not many options in there, so I do not know what the reset may have changed, but it did the trick.<br />
*# Blacklist the {{ic|acer_wmi}} module. For testing, you can add the following to the kernel line in GRUB: {{ic|acer_wmi.disable<nowiki>=</nowiki>1}}<br />
<br />
* I have found that to get the {{ic|wl}} drivers working for the Broadcom 4313 chip, you need to blacklist {{ic|brcm80211}} along with {{ic|b43}} and {{ic|ssb}}.<br />
<br />
* If you notice slow wireless speeds when your laptop/netbook is not connected to AC power, you may need to disable Wi-Fi power management by adding the following line (assuming ''wlan0'' is your wireless device) {{ic|iwconfig wlan0 power off}} to {{ic|/etc/rc.local}} and create an empty file {{ic|/etc/pm/power.d/wireless}}. In case you also experience interface swapping (discussed above), you might want to add another line for the second interface name as well. The command will have no effect on the wired interface.<br />
<br />
* In my case on a HP pavilion netbook DM1 with a BCM4313 chip, with the original kernel brcmsmac driver, the LED didn't work, the power was awful, and it kept loosing the signal all the time, unless very close to the wifi hotspot. The last broadcom driver {{ic|wl}} solved everything. So in some cases, it's actually better than the kernel driver. However, I had to install it in the initram image, along with lib80211 and lib80211_crypt_tkip to avoid a recurring kernel panic. (Use mkinitcpio)<br />
<br />
* On a similar HP DM1 netbook I found the brcmsmac driver did not work either. The kernel panic can also be solved by blacklisting the brcmsmac, b43 and wl drivers. In rc.local you can modprobe wl without problems. On a sidenote: I get hard lockups, without any way to debug because there is nothing in kernel.log. Not sure if related to the wl driver though.<br />
<br />
* Likewise, my HP Pavilion g7-1374ca also had problems with stock kernel drivers. I downloaded Broadcom tarball, but it wouldn't compile in 3.4.3. I removed the #include <asm/system.h> line and commented out a line referencing .ndo_set_multicast_list (there's only one). Then I was able to compile and load the module for a 100% strength signal, no lockups so far.</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Broadcom_wireless&diff=214534Broadcom wireless2012-07-24T19:18:23Z<p>Jeff story: </p>
<hr />
<div>[[zh-CN:Broadcom wireless]]<br />
[[Category:Wireless Networking]]<br />
<br />
== Introduction ==<br />
<br />
Broadcom has been notorious in its support for its Wi-Fi cards on GNU/Linux. Until recently, most Broadcom chips were either entirely unsupported or required the user to tinker with firmware. A limited set of wireless chips were supported by various reverse-engineered drivers ({{ic|brcm4xxx}}, {{ic|b43}}, etc.). The reverse-engineered [http://wireless.kernel.org/en/users/Drivers/b43 {{ic|b43}}] drivers have been in the kernel since 2.6.24.<br />
<br />
In August 2008, Broadcom released the [http://www.broadcom.com/support/802.11/linux_sta.php 802.11 Linux STA driver] officially supporting Broadcom wireless hardware on GNU/Linux. These are restrictively licensed drivers, but Broadcom promised to work towards a more open approach in the future. Further, they do not work with hidden ESSIDs.<br />
<br />
In September 2010, Broadcom [http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418 finally released] fully open source drivers for its hardware. This driver, [http://wireless.kernel.org/en/users/Drivers/brcm80211 {{ic|brcm80211}}], has been included into the kernel since 2.6.37. With the release of 2.6.39, these drivers have been renamed to {{ic|brcmsmac}} and {{ic|brcmfmac}}.<br />
<br />
At the time of writing, there are three choices for users with Broadcom Wi-Fi chipsets:<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Driver !! Description<br />
|-<br />
|brcmsmac/brcmfmac || Open source kernel driver<br />
|-<br />
|b43 || Reversed engineered kernel driver<br />
|-<br />
|broadcom-wl || Proprietary Broadcom STA driver<br />
|}<br />
<br />
== Determine which driver you need/can use ==<br />
<br />
First, determine your card's [http://en.wikipedia.org/wiki/PCI_configuration_space PCI-ID]. Type the following (case-sensitive) command into a console:<br />
$ lspci -vnn | grep 14e4<br />
<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmsmac}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224 <br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|}<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmfmac}} SDIO driver]]:<br />
{| border="1"<br />
! Name<br />
|-<br />
| BCM4329<br />
|}<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/brcm80211 here].<br />
<br />
If your card is not in the above lists, you need to use the older {{ic|b43}} or {{ic|b43legacy}} driver, which supports following devices.<br />
{| border="1"<br />
! PCI-ID !! Name !! Notes<br />
|-<br />
| {{ic|[14e4:4301]}} || BCM4301 || legacy-only<br />
|-<br />
| {{ic|[14e4:4306]}} || BCM4306 || <s>?legacy</s><br />
|-<br />
| {{ic|[14e4:4307]}} || BCM4306 ||<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4318]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4319]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4320]}} || BCM4306 || ?legacy<br />
|-<br />
| {{ic|[14e4:4321]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4324]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4325]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321 ||<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227 ||<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228 ||<br />
|}<br />
?legacy means that there are devices with same PCI-IDs, but with different hardware available.<br />
Some of these work with the {{ic|b43}} driver, but some might need {{ic|b43legacy}} driver.<br />
legacy-only means that you need to use the {{ic|b43legacy}} driver.<br />
<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/b43 here].<br />
<br />
If your card is in the following list, you can use the [[#broadcom-wl|{{ic|broadcom-wl}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224<br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228<br />
|}<br />
A more up-to-date list may be found [http://www.broadcom.com/docs/linux_sta/README.txt here].<br />
<br />
== Getting the driver ==<br />
<br />
=== brcmsmac/brcmfmac ===<br />
The {{ic|brcm80211}} drivers have been included in the kernel since 2.6.37. Since the release of 2.6.39, they have been renamed to {{ic|brcmsmac}} (for PCI cards) and {{ic|brcmfmac}} (for SDIO).<br />
<br />
These drivers should be automatically loaded during startup and no further action should be required of the user. If the driver doesn't auto load, try the following command: <br />
# modprobe brcmsmac<br />
<br />
{{Note|The {{ic|bcma}} module can prevent some cards from showing up and may need to be [[#Wi-Fi_card_does_not_work.2Fshow_up_since_kernel_upgrade_.28brcmsmac.29|blacklisted]].}}<br />
<br />
{{Note|Since linux 3.3.1 the {{ic|brcmsmac}} driver depends on the {{ic|bcma}} module and blacklisting is no longer required.}}<br />
<br />
{{Note|[http://wireless.kernel.org/en/users/Drivers/brcm80211 wireless.kernel.org] states that brcm80211 does not support older PCI/PCI-E chips with ssb backplane.}}<br />
<br />
=== b43/b43legacy ===<br />
The drivers are included in the kernel since 2.6.24.<br />
<br />
==== Loading the b43/b43legacy kernel module ====<br />
Verify which module you need by looking up your device [http://wireless.kernel.org/en/users/Drivers/b43#Known_PCI_devices here]. You can also check by computer model [http://linuxwireless.org/en/users/Drivers/b43/devices here]. Blacklist the other module (either {{ic|b43}} or {{ic|b43legacy}}) to prevent possible problems/confusion. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
Install the appropriate {{AUR|b43-firmware}} or {{AUR|b43-firmware-legacy}} package from the [[AUR]].<br />
<br />
You can now configure your device.<br />
<br />
=== broadcom-wl ===<br />
{{Warning|This driver is more likely to cause problems than to resolve them. Most of the problems reported by users on Broadcom chips are caused by this driver. Using this is HIGHLY NOT recommended. Before you even think of trying out this one, make sure to try the other drivers first.}}<br />
For users of the {{ic|broadcom-wl}} driver, there is a PKGBUILD available in the AUR ({{AUR|broadcom-wl}}). You can also download this driver directly from [http://www.broadcom.com/support/802.11/linux_sta.php Broadcom]. However, the PKGBUILD method is strongly encouraged, as that way will have [[pacman]] track all of the files.<br />
<br />
==== Loading the wl kernel module ====<br />
The {{ic|wl}} module may need to be manually loaded if there are other usable modules present. Before loading the {{ic|wl}} module, remove the {{ic|b43}} or other module that may have been automatically loaded instead:<br />
# rmmod b43<br />
<br />
Also unload {{ic|ssb}}, if loaded:<br />
# rmmod ssb<br />
<br />
{{Note|Failure to unload {{ic|ssb}} may result in the wireless interface not being created.}}<br />
<br />
Load the {{ic|wl}} module<br />
# modprobe wl<br />
<br />
The {{ic|wl}} module should automatically load {{ic|lib80211}} or {{ic|lib80211_crypt_tkip}}. Check with {{ic|lsmod}} to see if this is the case. If not, you may need to add one of those two modules as well.<br />
# modprobe lib80211<br />
<br />
or<br />
# modprobe lib80211_crypt_tkip<br />
<br />
If you installed the driver directly from Broadcom, you may also need to update the dependencies:<br />
# depmod -a<br />
<br />
To make the module load at boot, add {{ic|wl}} (and {{ic|lib80211}}/{{ic|lib80211_crypt_tkip}}, if needed) to your MODULES array in {{ic|/etc/rc.conf}}.<br />
MODULES=(... wl...)<br />
<br />
You can also blacklist other modules (to prevent them from interfering) in {{ic|/etc/modprobe.d/modprobe.conf}}. To blacklist a module just append a new line with the syntax {{ic|blacklist <module name>}}:<br />
blacklist b43<br />
blacklist ssb<br />
<br />
{{Warning|Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] does not work with blacklisting {{ic|b43}} and {{ic|ssb}}.}}<br />
<br />
== Troubleshooting ==<br />
=== Wi-Fi card does not work or show up after kernel upgrade (brcmsmac) ===<br />
<br />
This is caused by the kernel using the {{ic|bcma}} module instead of the {{ic|brcmsmac}} module. The solution is to blacklist the {{ic|bcma}} module. For instructions, see [[Kernel_modules#Blacklisting]].<br />
{{Note|This affects only Linux kernels 3.0, 3.1, and 3.2. Since kernel 3.3, the {{ic|brcmsmac}} module actually uses {{ic|bcma}}, so {{ic|bcma}} needs to be unblacklisted or the Wi-Fi interface will not appear.}}<br />
<br />
=== Wi-Fi card does not work when resuming from suspend (brcm80211) ===<br />
{{Note|This issue only affects Linux kernels 2.6.38 and earlier.}}<br />
The {{ic|brcm80211}} module needs to be unloaded before suspend and reloaded upon resume, otherwise Wi-Fi will not come back up. This is printed by {{ic|dmesg}}:<br />
wlc_coreinit: ucode did not self-suspend!<br />
wlc_suspend_mac_and_wait: waited 83000 uS and MI_MACSSPNDD is still not on.<br />
psmdebug 0x000f8773, phydebug 0x00000000, psm_brc 0x0000<br />
<br />
The [[pm-utils]] page explains how to do this. If the file does not already exist, create a file called {{ic|modules}} or {{ic|config}} in {{ic|/etc/pm/config.d/}} and add/modify the following line:<br />
SUSPEND_MODULES="brcm80211"<br />
<br />
Now, the card should resume working correctly.<br />
<br />
An alternative procedure:<br />
<br />
1. Create the new file {{ic|/etc/pm/sleep.d/brcm.sh}}<br />
<br />
2. Insert this code and save:<br />
#!/bin/bash<br />
# Simple Bash script to fix resume from suspend issues...<br />
# Place this script in /etc/pm/sleep.d/<br />
# then chmod +x /etc/pm/sleep.d/brcm.sh<br />
case $1 in<br />
hibernate|suspend)<br />
/sbin/modprobe -r brcm80211<br />
;;<br />
thaw|resume)<br />
/sbin/modprobe brcm80211<br />
;;<br />
esac<br />
<br />
3. Make it executable:<br />
chmod +x /etc/pm/sleep.d/brcm.sh<br />
<br />
=== Wi-Fi card does not work/show up (broadcom-wl) ===<br />
Check if you are loading the correct modules. You may need to blacklist the {{ic|brcm80211}}, {{ic|b43}}, and {{ic|ssb}} kernel modules to prevent them from loading automatically. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
{{Note|You may not have to blacklist the {{ic|brcm80211}} driver; although as of 2011-06-20, it will still default to loading the {{ic|brcm80211}} module before the {{ic|wl}} driver, which prevents {{ic|wl}} from being used.}}<br />
<br />
Check if you updated your module dependencies:<br />
# depmod -a<br />
<br />
* Verify that your wireless interface(s) appear using {{ic|ip addr}}.<br />
* You may need to restart your machine to see the device appear in {{ic|iwconfig}} or {{ic|ip addr}}.<br />
* If you have recently upgraded your kernel, you need to rebuild the {{ic|broadcom-wl}} package with the new kernel installed to update the module.<br />
<br />
=== Interfaces swapped (broadcom-wl) ===<br />
Users of the {{ic|broadcom-wl}} driver may find their Ethernet and Wi-Fi interfaces have been swapped. The [http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot udev] page explains how to resolve this. Create a file named {{ic|/etc/udev/rules.d/10-network.rules}} and bind the MAC address of each of your cards to a certain interface name:<br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="eth0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="eth1"<br />
<br />
Ensure that the interface name appears correctly in {{ic|/etc/rc.conf}} and other configuration files that refer to it.<br />
<br />
=== Miscellaneous user notes ===<br />
* In my Dell Inspiron Laptop, I have a Broadcom BCM4401 Ethernet card and a Broadcom BCM4328 wireless card. If I just remove {{ic|b43}}, I can load the {{ic|wl}} driver, but no wireless card shows up. However, if I first remove the {{ic|b44}} (and {{ic|ssb}}) driver for my Ethernet card, and ''then'' load the {{ic|wl}} driver, I get a wireless device using the name ''eth0''. Afterwards, I can load {{ic|b44}} again, to have an Ethernet ''eth1'' device.<br />
<br />
* I could not get the BCM4313 chip on a Lenovo B560 to work before following these steps:<br />
*# "Load defaults" in the BIOS. After that, the wireless was working under MS Windows. There are not many options in there, so I do not know what the reset may have changed, but it did the trick.<br />
*# Blacklist the {{ic|acer_wmi}} module. For testing, you can add the following to the kernel line in GRUB: {{ic|acer_wmi.disable<nowiki>=</nowiki>1}}<br />
<br />
* I have found that to get the {{ic|wl}} drivers working for the Broadcom 4313 chip, you need to blacklist {{ic|brcm80211}} along with {{ic|b43}} and {{ic|ssb}}.<br />
<br />
* If you notice slow wireless speeds when your laptop/netbook is not connected to AC power, you may need to disable Wi-Fi power management by adding the following line (assuming ''wlan0'' is your wireless device) {{ic|iwconfig wlan0 power off}} to {{ic|/etc/rc.local}} and create an empty file {{ic|/etc/pm/power.d/wireless}}. In case you also experience interface swapping (discussed above), you might want to add another line for the second interface name as well. The command will have no effect on the wired interface.<br />
<br />
* In my case on a HP pavilion netbook DM1 with a BCM4313 chip, with the original kernel brcmsmac driver, the LED didn't work, the power was awful, and it kept loosing the signal all the time, unless very close to the wifi hotspot. The last broadcom driver {{ic|wl}} solved everything. So in some cases, it's actually better than the kernel driver. However, I had to install it in the initram image, along with lib80211 and lib80211_crypt_tkip to avoid a recurring kernel panic. (Use mkinitcpio)<br />
<br />
* On a similar HP DM1 netbook I found the brcmsmac driver did not work either. The kernel panic can also be solved by blacklisting the brcmsmac, b43 and wl drivers. In rc.local you can modprobe wl without problems. On a sidenote: I get hard lockups, without any way to debug because there is nothing in kernel.log. Not sure if related to the wl driver though.<br />
<br />
* Likewise, my HP Pavilion g7-1374ca also had problems with stock kernel drivers. I downloaded Broadcom tarball, but it wouldn't compile in 3.4.3. I removed the #include <asm/system.h> line and commented out a line referencing .ndo_set_multicast_list (there's only one). Then I was able to compile and load the module for a 100% strength signal, no lockups so far.</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Broadcom_wireless&diff=214533Broadcom wireless2012-07-24T19:15:56Z<p>Jeff story: </p>
<hr />
<div>[[zh-CN:Broadcom wireless]]<br />
[[Category:Wireless Networking]]<br />
<br />
== Introduction ==<br />
<br />
Broadcom has been notorious in its support for its Wi-Fi cards on GNU/Linux. Until recently, most Broadcom chips were either entirely unsupported or required the user to tinker with firmware. A limited set of wireless chips were supported by various reverse-engineered drivers ({{ic|brcm4xxx}}, {{ic|b43}}, etc.). The reverse-engineered [http://wireless.kernel.org/en/users/Drivers/b43 {{ic|b43}}] drivers have been in the kernel since 2.6.24.<br />
<br />
In August 2008, Broadcom released the [http://www.broadcom.com/support/802.11/linux_sta.php 802.11 Linux STA driver] officially supporting Broadcom wireless hardware on GNU/Linux. These are restrictively licensed drivers, but Broadcom promised to work towards a more open approach in the future. Further, they do not work with hidden ESSIDs.<br />
<br />
In September 2010, Broadcom [http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418 finally released] fully open source drivers for its hardware. This driver, [http://wireless.kernel.org/en/users/Drivers/brcm80211 {{ic|brcm80211}}], has been included into the kernel since 2.6.37. With the release of 2.6.39, these drivers have been renamed to {{ic|brcmsmac}} and {{ic|brcmfmac}}.<br />
<br />
At the time of writing, there are three choices for users with Broadcom Wi-Fi chipsets:<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Driver !! Description<br />
|-<br />
|brcmsmac/brcmfmac || Open source kernel driver<br />
|-<br />
|b43 || Reversed engineered kernel driver<br />
|-<br />
|broadcom-wl || Proprietary Broadcom STA driver<br />
|}<br />
<br />
== Determine which driver you need/can use ==<br />
<br />
First, determine your card's [http://en.wikipedia.org/wiki/PCI_configuration_space PCI-ID]. Type the following (case-sensitive) command into a console:<br />
$ lspci -vnn | grep 14e4<br />
<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmsmac}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224 <br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|}<br />
If your card is in the following list, you can use the [[#brcmsmac.2Fbrcmfmac|{{ic|brcmfmac}} SDIO driver]]:<br />
{| border="1"<br />
! Name<br />
|-<br />
| BCM4329<br />
|}<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/brcm80211 here].<br />
<br />
If your card is not in the above lists, you need to use the older {{ic|b43}} or {{ic|b43legacy}} driver, which supports following devices.<br />
{| border="1"<br />
! PCI-ID !! Name !! Notes<br />
|-<br />
| {{ic|[14e4:4301]}} || BCM4301 || legacy-only<br />
|-<br />
| {{ic|[14e4:4306]}} || BCM4306 || <s>?legacy</s><br />
|-<br />
| {{ic|[14e4:4307]}} || BCM4306 ||<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311 ||<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4318]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4319]}} || BCM4318 ||<br />
|-<br />
| {{ic|[14e4:4320]}} || BCM4306 || ?legacy<br />
|-<br />
| {{ic|[14e4:4321]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4324]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4325]}} || BCM4306 || legacy-only<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321 ||<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322 || Not in kernel26-lts<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322 ||<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227 ||<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228 ||<br />
|}<br />
?legacy means that there are devices with same PCI-IDs, but with different hardware available.<br />
Some of these work with the {{ic|b43}} driver, but some might need {{ic|b43legacy}} driver.<br />
legacy-only means that you need to use the {{ic|b43legacy}} driver.<br />
<br />
A more up-to-date list may be found [http://linuxwireless.org/en/users/Drivers/b43 here].<br />
<br />
If your card is in the following list, you can use the [[#broadcom-wl|{{ic|broadcom-wl}} driver]]:<br />
{| border="1"<br />
! PCI-ID !! Name<br />
|-<br />
| {{ic|[14e4:4311]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4312]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4313]}} || BCM4311<br />
|-<br />
| {{ic|[14e4:4315]}} || BCM4312<br />
|-<br />
| {{ic|[14e4:4727]}} || BCM4313<br />
|-<br />
| {{ic|[14e4:4328]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:4329]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432a]}} || BCM4321<br />
|-<br />
| {{ic|[14e4:432b]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432c]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:432d]}} || BCM4322<br />
|-<br />
| {{ic|[14e4:4353]}} || BCM43224<br />
|-<br />
| {{ic|[14e4:4357]}} || BCM43225<br />
|-<br />
| {{ic|[14e4:4358]}} || BCM43227<br />
|-<br />
| {{ic|[14e4:4359]}} || BCM43228<br />
|}<br />
A more up-to-date list may be found [http://www.broadcom.com/docs/linux_sta/README.txt here].<br />
<br />
== Getting the driver ==<br />
<br />
=== brcmsmac/brcmfmac ===<br />
The {{ic|brcm80211}} drivers have been included in the kernel since 2.6.37. Since the release of 2.6.39, they have been renamed to {{ic|brcmsmac}} (for PCI cards) and {{ic|brcmfmac}} (for SDIO).<br />
<br />
These drivers should be automatically loaded during startup and no further action should be required of the user. If the driver doesn't auto load, try the following command: ''sudo modprobe brcmsmac''<br />
<br />
{{Note|The {{ic|bcma}} module can prevent some cards from showing up and may need to be [[#Wi-Fi_card_does_not_work.2Fshow_up_since_kernel_upgrade_.28brcmsmac.29|blacklisted]].}}<br />
<br />
{{Note|Since linux 3.3.1 the {{ic|brcmsmac}} driver depends on the {{ic|bcma}} module and blacklisting is no longer required.}}<br />
<br />
{{Note|[http://wireless.kernel.org/en/users/Drivers/brcm80211 wireless.kernel.org] states that brcm80211 does not support older PCI/PCI-E chips with ssb backplane.}}<br />
<br />
=== b43/b43legacy ===<br />
The drivers are included in the kernel since 2.6.24.<br />
<br />
==== Loading the b43/b43legacy kernel module ====<br />
Verify which module you need by looking up your device [http://wireless.kernel.org/en/users/Drivers/b43#Known_PCI_devices here]. You can also check by computer model [http://linuxwireless.org/en/users/Drivers/b43/devices here]. Blacklist the other module (either {{ic|b43}} or {{ic|b43legacy}}) to prevent possible problems/confusion. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
Install the appropriate {{AUR|b43-firmware}} or {{AUR|b43-firmware-legacy}} package from the [[AUR]].<br />
<br />
You can now configure your device.<br />
<br />
=== broadcom-wl ===<br />
{{Warning|This driver is more likely to cause problems than to resolve them. Most of the problems reported by users on Broadcom chips are caused by this driver. Using this is HIGHLY NOT recommended. Before you even think of trying out this one, make sure to try the other drivers first.}}<br />
For users of the {{ic|broadcom-wl}} driver, there is a PKGBUILD available in the AUR ({{AUR|broadcom-wl}}). You can also download this driver directly from [http://www.broadcom.com/support/802.11/linux_sta.php Broadcom]. However, the PKGBUILD method is strongly encouraged, as that way will have [[pacman]] track all of the files.<br />
<br />
==== Loading the wl kernel module ====<br />
The {{ic|wl}} module may need to be manually loaded if there are other usable modules present. Before loading the {{ic|wl}} module, remove the {{ic|b43}} or other module that may have been automatically loaded instead:<br />
# rmmod b43<br />
<br />
Also unload {{ic|ssb}}, if loaded:<br />
# rmmod ssb<br />
<br />
{{Note|Failure to unload {{ic|ssb}} may result in the wireless interface not being created.}}<br />
<br />
Load the {{ic|wl}} module<br />
# modprobe wl<br />
<br />
The {{ic|wl}} module should automatically load {{ic|lib80211}} or {{ic|lib80211_crypt_tkip}}. Check with {{ic|lsmod}} to see if this is the case. If not, you may need to add one of those two modules as well.<br />
# modprobe lib80211<br />
<br />
or<br />
# modprobe lib80211_crypt_tkip<br />
<br />
If you installed the driver directly from Broadcom, you may also need to update the dependencies:<br />
# depmod -a<br />
<br />
To make the module load at boot, add {{ic|wl}} (and {{ic|lib80211}}/{{ic|lib80211_crypt_tkip}}, if needed) to your MODULES array in {{ic|/etc/rc.conf}}.<br />
MODULES=(... wl...)<br />
<br />
You can also blacklist other modules (to prevent them from interfering) in {{ic|/etc/modprobe.d/modprobe.conf}}. To blacklist a module just append a new line with the syntax {{ic|blacklist <module name>}}:<br />
blacklist b43<br />
blacklist ssb<br />
<br />
{{Warning|Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] does not work with blacklisting {{ic|b43}} and {{ic|ssb}}.}}<br />
<br />
== Troubleshooting ==<br />
=== Wi-Fi card does not work or show up after kernel upgrade (brcmsmac) ===<br />
<br />
This is caused by the kernel using the {{ic|bcma}} module instead of the {{ic|brcmsmac}} module. The solution is to blacklist the {{ic|bcma}} module. For instructions, see [[Kernel_modules#Blacklisting]].<br />
{{Note|This affects only Linux kernels 3.0, 3.1, and 3.2. Since kernel 3.3, the {{ic|brcmsmac}} module actually uses {{ic|bcma}}, so {{ic|bcma}} needs to be unblacklisted or the Wi-Fi interface will not appear.}}<br />
<br />
=== Wi-Fi card does not work when resuming from suspend (brcm80211) ===<br />
{{Note|This issue only affects Linux kernels 2.6.38 and earlier.}}<br />
The {{ic|brcm80211}} module needs to be unloaded before suspend and reloaded upon resume, otherwise Wi-Fi will not come back up. This is printed by {{ic|dmesg}}:<br />
wlc_coreinit: ucode did not self-suspend!<br />
wlc_suspend_mac_and_wait: waited 83000 uS and MI_MACSSPNDD is still not on.<br />
psmdebug 0x000f8773, phydebug 0x00000000, psm_brc 0x0000<br />
<br />
The [[pm-utils]] page explains how to do this. If the file does not already exist, create a file called {{ic|modules}} or {{ic|config}} in {{ic|/etc/pm/config.d/}} and add/modify the following line:<br />
SUSPEND_MODULES="brcm80211"<br />
<br />
Now, the card should resume working correctly.<br />
<br />
An alternative procedure:<br />
<br />
1. Create the new file {{ic|/etc/pm/sleep.d/brcm.sh}}<br />
<br />
2. Insert this code and save:<br />
#!/bin/bash<br />
# Simple Bash script to fix resume from suspend issues...<br />
# Place this script in /etc/pm/sleep.d/<br />
# then chmod +x /etc/pm/sleep.d/brcm.sh<br />
case $1 in<br />
hibernate|suspend)<br />
/sbin/modprobe -r brcm80211<br />
;;<br />
thaw|resume)<br />
/sbin/modprobe brcm80211<br />
;;<br />
esac<br />
<br />
3. Make it executable:<br />
chmod +x /etc/pm/sleep.d/brcm.sh<br />
<br />
=== Wi-Fi card does not work/show up (broadcom-wl) ===<br />
Check if you are loading the correct modules. You may need to blacklist the {{ic|brcm80211}}, {{ic|b43}}, and {{ic|ssb}} kernel modules to prevent them from loading automatically. For instructions, see [[Kernel_modules#Blacklisting]].<br />
<br />
{{Note|You may not have to blacklist the {{ic|brcm80211}} driver; although as of 2011-06-20, it will still default to loading the {{ic|brcm80211}} module before the {{ic|wl}} driver, which prevents {{ic|wl}} from being used.}}<br />
<br />
Check if you updated your module dependencies:<br />
# depmod -a<br />
<br />
* Verify that your wireless interface(s) appear using {{ic|ip addr}}.<br />
* You may need to restart your machine to see the device appear in {{ic|iwconfig}} or {{ic|ip addr}}.<br />
* If you have recently upgraded your kernel, you need to rebuild the {{ic|broadcom-wl}} package with the new kernel installed to update the module.<br />
<br />
=== Interfaces swapped (broadcom-wl) ===<br />
Users of the {{ic|broadcom-wl}} driver may find their Ethernet and Wi-Fi interfaces have been swapped. The [http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot udev] page explains how to resolve this. Create a file named {{ic|/etc/udev/rules.d/10-network.rules}} and bind the MAC address of each of your cards to a certain interface name:<br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="eth0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="eth1"<br />
<br />
Ensure that the interface name appears correctly in {{ic|/etc/rc.conf}} and other configuration files that refer to it.<br />
<br />
=== Miscellaneous user notes ===<br />
* In my Dell Inspiron Laptop, I have a Broadcom BCM4401 Ethernet card and a Broadcom BCM4328 wireless card. If I just remove {{ic|b43}}, I can load the {{ic|wl}} driver, but no wireless card shows up. However, if I first remove the {{ic|b44}} (and {{ic|ssb}}) driver for my Ethernet card, and ''then'' load the {{ic|wl}} driver, I get a wireless device using the name ''eth0''. Afterwards, I can load {{ic|b44}} again, to have an Ethernet ''eth1'' device.<br />
<br />
* I could not get the BCM4313 chip on a Lenovo B560 to work before following these steps:<br />
*# "Load defaults" in the BIOS. After that, the wireless was working under MS Windows. There are not many options in there, so I do not know what the reset may have changed, but it did the trick.<br />
*# Blacklist the {{ic|acer_wmi}} module. For testing, you can add the following to the kernel line in GRUB: {{ic|acer_wmi.disable<nowiki>=</nowiki>1}}<br />
<br />
* I have found that to get the {{ic|wl}} drivers working for the Broadcom 4313 chip, you need to blacklist {{ic|brcm80211}} along with {{ic|b43}} and {{ic|ssb}}.<br />
<br />
* If you notice slow wireless speeds when your laptop/netbook is not connected to AC power, you may need to disable Wi-Fi power management by adding the following line (assuming ''wlan0'' is your wireless device) {{ic|iwconfig wlan0 power off}} to {{ic|/etc/rc.local}} and create an empty file {{ic|/etc/pm/power.d/wireless}}. In case you also experience interface swapping (discussed above), you might want to add another line for the second interface name as well. The command will have no effect on the wired interface.<br />
<br />
* In my case on a HP pavilion netbook DM1 with a BCM4313 chip, with the original kernel brcmsmac driver, the LED didn't work, the power was awful, and it kept loosing the signal all the time, unless very close to the wifi hotspot. The last broadcom driver {{ic|wl}} solved everything. So in some cases, it's actually better than the kernel driver. However, I had to install it in the initram image, along with lib80211 and lib80211_crypt_tkip to avoid a recurring kernel panic. (Use mkinitcpio)<br />
<br />
* On a similar HP DM1 netbook I found the brcmsmac driver did not work either. The kernel panic can also be solved by blacklisting the brcmsmac, b43 and wl drivers. In rc.local you can modprobe wl without problems. On a sidenote: I get hard lockups, without any way to debug because there is nothing in kernel.log. Not sure if related to the wl driver though.<br />
<br />
* Likewise, my HP Pavilion g7-1374ca also had problems with stock kernel drivers. I downloaded Broadcom tarball, but it wouldn't compile in 3.4.3. I removed the #include <asm/system.h> line and commented out a line referencing .ndo_set_multicast_list (there's only one). Then I was able to compile and load the module for a 100% strength signal, no lockups so far.</div>Jeff storyhttps://wiki.archlinux.org/index.php?title=Environment_variables&diff=146589Environment variables2011-06-18T07:06:22Z<p>Jeff story: </p>
<hr />
<div>[[Category:Command shells (English)]]<br />
The source for most of this info is from: Gentoo Linux Documentation [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part2_chap5]<br />
<br />
Please contribute by adding, changing, editing, correcting or whatever else it needs to more accurately reflect an Arch Linux system.<br />
<br />
<br />
<br />
=== Environment Variables ===<br />
<br />
An environment variable is a named object that contains information used by one or more applications. Many users (and especially those new to Linux) find this a bit weird or unmanageable. However, this is a mistake: by using environment variables one can easily change a configuration setting for one or more applications. <br />
<br />
<br />
'''Examples:''' The following table lists a number of variables used by a Linux system and describes their use.<br />
<br />
----<br />
'''PATH''' This variable contains a colon-separated list of directories in which your system looks for executable files. If you enter a name of an executable (such as ls, rc-update or emerge) but this executable is not located in a listed directory, your system will not execute it (unless you enter the full path as command, such as /bin/ls).<br />
<br />
'''ROOTPATH''' This variable has the same function as PATH, but this one only lists the directories that should be checked when the root-user enters a command.<br />
<br />
'''LDPATH''' This variable contains a colon-separated list of directories in which the dynamical linker searches through to find a library.<br />
<br />
'''MANPATH''' This variable contains a colon-separated list of directories in which the man command searches for the man pages.<br />
<br />
'''INFODIR''' This variable contains a colon-separated list of directories in which the info command searches for the info pages.<br />
<br />
'''PAGER''' This variable contains the path to the program used to list the contents of files through (such as less or more).<br />
<br />
'''EDITOR''' This variable contains the path to the program used to change the contents of files with (such as nano or vi).<br />
<br />
'''KDEDIRS''' This variable contains a colon-separated list of directories which contain KDE-specific material.<br />
----<br />
<br />
<br />
<br />
'''Examples''' The values for the above variables are defined in following table.<br />
<br />
----<br />
'''PATH'''="/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/games/bin"<br />
<br />
'''ROOTPATH'''="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"<br />
<br />
'''LDPATH'''="/lib:/usr/lib:/usr/local/lib:/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3"<br />
<br />
'''MANPATH'''="/usr/share/man:/usr/local/share/man"<br />
<br />
'''INFODIR'''="/usr/share/info:/usr/local/share/info"<br />
<br />
'''PAGER'''="/usr/bin/less"<br />
<br />
'''EDITOR'''="/usr/bin/vim"<br />
<br />
'''KDEDIRS'''="/usr"<br />
----<br />
<br />
<br />
To list the environment variables that are currently set on your machine, use the following command:<br />
<br />
$ env | LC_ALL=C sort<br />
<br />
=== Defining Variables Globally ===<br />
<br />
Most Linux distributions tell you to change or add environment variable definitions in /etc/profile or other locations. Be sure to maintain and manage the environment variables and pay attention to the numerous files that can contain environment variables. The following files may be present and used for global environment variables on your Arch system: /etc/profile, /etc/bash.bashrc, /etc/environment<br />
<br />
=== Defining Variables Locally ===<br />
<br />
'''User Specific'''<br />
<br />
You do not always want to define an environment variable globally. For instance, you might want to add /home/my_user/bin and the current working directory (the directory you are in) to the PATH variable but don't want all other users on your system to have that in their PATH too. The following files may be present and used for local environment variables on your Arch system: ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.bash_login, ~/.bash_logout<br />
<br />
<br />
<br />
'''Example:''' Extending PATH for local usage in ~/.bashrc (''A colon followed by no directory is treated as the current working directory'')<br />
<br />
PATH="${PATH}:/home/my_user/bin:"<br />
<br />
When you relogin, your PATH variable will be updated.<br />
<br />
=== Session Specific Variables ===<br />
<br />
Sometimes even stricter definitions are requested. You might want to be able to use binaries from a temporary directory you created without using the path to the binaries themselves or editing ~/.bashrc for the short time you need it.<br />
<br />
In this case, you can just define the PATH variable in your current session by using the export command. As long as you don't log out, the PATH variable will be using the temporary settings.<br />
<br />
'''Example:''' Defining a session-specific environment variable<br />
<br />
# export PATH="${PATH}:/home/my_user/tmp/usr/bin"<br />
<br />
=== A Users Example ===<br />
<br />
To set the global environment variables for '''BROWSER''' and '''EDITOR''', I tried several files and was finally successful putting the following in the '''/etc/environment''' file.<br />
<br />
'''BROWSER=firefox'''<br />
<br />
'''EDITOR=nano'''<br />
<br />
Be sure to re-login and check in a terminal to see if they are now set.<br />
<br />
<br />
additional info: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html</div>Jeff story