{"id":19,"date":"2004-09-12T03:34:15","date_gmt":"2004-09-12T10:34:15","guid":{"rendered":"http:\/\/www.stevenbrown.ca\/blog\/?p=19"},"modified":"2004-09-12T21:20:59","modified_gmt":"2004-09-13T04:20:59","slug":"printing-in-linux","status":"publish","type":"post","link":"https:\/\/www.stevenbrown.ca\/blog\/archives\/19","title":{"rendered":"printing in linux"},"content":{"rendered":"<p>Not that anyone cares, but I finally got printing working in linux!  w00p!  I had some serious trouble with this, trust me.  I&#8217;ll post some of the details in hopes it will help others.<\/p>\n<div class=\"paragraph\">My setup is a laptop running <a href=\"http:\/\/www.gentoo.org\">Gentoo<\/a> linux. I am connected to a router which provides the life-flow known as the <em>Internet<\/em> to my laptop and a desktop pc.  There is a printer connected to the desktop pc, and that&#8217;s what I want to print to.  The desktop runs Windows XP.  What I needed setup and running is this:  CUPS (Common Unix Printing Structure), SAMBA suite, netbios on windows computer, and the printer being shared from within windows.  <\/div>\n<div class=\"paragraph\">At first, I was able to print using <em>smbclient<\/em> to log in to the printer share and then use the SAMBA <em>print<\/em> command.  However, this was very hackish, to say the least.  It took me a long time to track it down, but I was finally able to print with the command <em>smbspool<\/em>.  This is important bedcause this is what CUPS uses for the samba backend, and when you get the syntax for smbspool correct, you&#8217;ll be better off when it comes to debugging, later&#8230; if you have to. \ud83d\ude09<\/div>\n<blockquote><p>\n<em>smbspool {printerURI} {job} {user} {title} {copies} {options} [filename]<\/em><\/p>\n<p>mine looked like this:<\/p>\n<p><em>smbspool smb:\/\/desktop-workgroup\/desktop-netbios-name\/shared-printer-name jobname guest jobtitle 1 &#8220;&#8221; test.txt<\/em>\n<\/p><\/blockquote>\n<div class=\"paragraph\">To get a list of available shares (including printers), use <em>smbclient -L desktop-netbios-name -N<\/em>.  &#8220;desktop-netbios-name&#8221; with the name of your windows computer.  So, if my windows computer was named &#8220;bob&#8221; and bob&#8217;s printer was shared as &#8220;pbob&#8221;, then the path to the printer would be &#8220;smb:\/\/bob\/pbob&#8221;.  I have my workgroup on my <em>\/etc\/smb.conf<\/em> file set to the same as my desktop for simplicity.  You can grab a <a href=\"http:\/\/us4.samba.org\/samba\/docs\/man\/Samba-HOWTO-Collection\/CUPS-printing.html#cups-exam-simple\">simple smb.conf file here<\/a>.<\/div>\n<p>CUPS<\/p>\n<div class=\"paragraph\">You may also have to make some changes to files in the <em>\/etc\/cups\/<\/em> directory.  But if you&#8217;ve got CUPS installed and running, you can manage it through a web application which will be running on your computer!  <a href=\"http:\/\/localhost:631\/\">http:\/\/localhost:631\/<\/a>  This is the most significant part of the setup that I seemed to miss.  Use this interface to add a SAMBA printer, and it should take care of all the nasties.  You&#8217;re not done, yet.  IMPORTANT: Once you&#8217;ve added the printer(s), you must <em>enable<\/em> them and tell them to <em>accept jobs<\/em>!<\/div>\n<p>After you&#8217;ve done all your changes, you will want to restart SAMBA and CUPS.<\/p>\n<blockquote><p><em>\/etc\/init.d\/samba restart &#038;&#038; \/etc\/init.d\/cupsd restart<\/em><\/p><\/blockquote>\n<p>Load up an application and you should see your new printer selectable!  yay!  (I hope I didn&#8217;t miss anything too important&#8230;.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not that anyone cares, but I finally got printing working in linux! w00p! I had some serious trouble with this, trust me. I&#8217;ll post some of the details in hopes it will help others. My setup is a laptop running Gentoo linux. I am connected to a router which provides the life-flow known as the&hellip; <a class=\"more-link\" href=\"https:\/\/www.stevenbrown.ca\/blog\/archives\/19\">Continue reading <span class=\"screen-reader-text\">printing in linux<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[4],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-geek","tag-linux","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4jEMb-j","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":0,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}