个人工具

“UbuntuHelp:NetworkPrintingFromWinXP”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/NetworkPrintingFromWinXP}}
 
{{From|https://help.ubuntu.com/community/NetworkPrintingFromWinXP}}
 
{{Languages|UbuntuHelp:NetworkPrintingFromWinXP}}
 
{{Languages|UbuntuHelp:NetworkPrintingFromWinXP}}
By following these steps, you will be able to share a printer from your Ubuntu computer so that Windows XP and Windows 2000 computers can print to it.   
+
By following these steps, you will be able to share a printer from your Ubuntu computer so that Windows XP, Windows Vista, and Windows 2000 computers can print to it.   
 
+
Before continuing, be sure that Samba is installed and configured properly. This will ensure that all computers on your network can communicate and share printer(s). See the "[[UbuntuHelp:SettingUpSamba|SettingUpSamba]]" documentation for more information.
=== Gusty ===
+
=== Intrepid,  Karmic, and Jaunty ===
 
+
1) Make sure your printer is installed.
 +
2) Open the Printing window (System -> Administration -> Printing).
 +
3) Click Server Settings in the list of printers (Server -> Settings).
 +
4) Check the box that reads, "Publish shared printers connected to this system" and then click the OK button.
 +
5) In the list of printers, right-click the printer you want to share and then select Properties.
 +
6) Click on Policies and make sure all three check boxes (Enabled, Accepting jobs, and Shared) are checked.
 +
7) Click the OK button in the lower-right corner of the window.
 +
8) If you have a firewall enabled on the Ubuntu box you will need to allow connections from the Windows machine on port 631.
 +
For the  [https://help.ubuntu.com/8.04/serverguide/C/firewall.html ufw] firewall the following two rules enables a windows machine on 192.168.5.4 to print
 +
<pre><nowiki>
 +
sudo ufw allow proto tcp to any port 631 from 192.168.5.4
 +
sudo ufw allow proto udp to any port 631 from 192.168.5.4
 +
</nowiki></pre>
 +
Use the "On the Windows machine" section below in the Gutsy tutorial to setup your Windows machine.
 +
=== Gutsy ===
 
'''NOTE:''' This was tested with the beta version of Gutsy.
 
'''NOTE:''' This was tested with the beta version of Gutsy.
 
 
1) Make sure your printer is installed.
 
1) Make sure your printer is installed.
 
 
2) Open the Printing window (System -> Administration -> Printing).
 
2) Open the Printing window (System -> Administration -> Printing).
 
 
3) Click Server Settings in the list of printers.
 
3) Click Server Settings in the list of printers.
 
 
4) To the right, under Basic Server Settings, check the box that reads, "Share published printers connected to this system".
 
4) To the right, under Basic Server Settings, check the box that reads, "Share published printers connected to this system".
 
 
5) In the list of printers, click the printer you want to share.
 
5) In the list of printers, click the printer you want to share.
 
 
6) Click in the Policies tab and make sure all three check boxes (Enabled, Accepting jobs, and Shared) are checked.
 
6) Click in the Policies tab and make sure all three check boxes (Enabled, Accepting jobs, and Shared) are checked.
 
 
7) Click the Apply button in the lower-right corner of the window.
 
7) Click the Apply button in the lower-right corner of the window.
 
+
=== On the Windows machine ===
On the Windows machine:
+
 
+
 
1) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:  
 
1) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:  
 
<pre><nowiki>
 
<pre><nowiki>
 
http://<hostname>:631/printers/<printername></nowiki></pre>
 
http://<hostname>:631/printers/<printername></nowiki></pre>
Replace "<hostname>" with the hostname of the Ubuntu computer sharing the printer.
+
Replace "<hostname>" with the hostname of the Ubuntu computer sharing the printer. It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer.
Replace "<printername>" with the name (exactly as displayed including displayed casing) that was shown in the Printers window you opened earlier on the Ubuntu machine.
+
Replace "<printername>" with the name (exactly as displayed including displayed casing) that was shown in the Printers window you opened earlier on the Ubuntu machine. If you're unsure about the exact printer name, you can use your webbrowser to open
It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer.
+
<pre><nowiki>
 
+
http://<hostname>:631/printers/</nowiki></pre>
 +
That should show your printer in a webpage. Click on your printer link, and you should see the exact URL in your browser's address bar. You can use that URL in the Windows setup mentionned above.
 
2) Windows will ask you to select a driver for the printer. If you have the Windows print drivers, you should use them. Click the "Have Disk" button and select the .inf file that describes your print drivers.
 
2) Windows will ask you to select a driver for the printer. If you have the Windows print drivers, you should use them. Click the "Have Disk" button and select the .inf file that describes your print drivers.
 
 
If you do not have the drivers for the printer or cannot load the .inf file, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one should need.
 
If you do not have the drivers for the printer or cannot load the .inf file, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one should need.
 
+
'''NOTE:''' Windows XP can print over IPv6 to Ubuntu Linux (tested between Windows XP SP3 and Ubuntu Linux 8.10). Make sure both the Windows and Ubuntu have IPv6 connectivity. You should tick "Allow Printing from the Internet" on the Ubuntu machine. Then use the URL (which resolves to IPv6) of the Ubuntu machine as described above.
 
=== Earlier Versions ===
 
=== Earlier Versions ===
 
 
'''NOTE:''' This document has been tested with Ubuntu versions 5.10, 6.06, 6.10, and 7.04.
 
'''NOTE:''' This document has been tested with Ubuntu versions 5.10, 6.06, 6.10, and 7.04.
 
 
1) Install the printer on the Ubuntu computer by using the printer wizard (System -> Administration -> Printers then double-click on "Add new printer" icon when the "Printers" window opens).
 
1) Install the printer on the Ubuntu computer by using the printer wizard (System -> Administration -> Printers then double-click on "Add new printer" icon when the "Printers" window opens).
 
 
2) Press '''<Alt>+<F2>'''.
 
2) Press '''<Alt>+<F2>'''.
 
 
3) Modify /etc/cups/cupsd.conf with your favourite editor, for example
 
3) Modify /etc/cups/cupsd.conf with your favourite editor, for example
 
<pre><nowiki>
 
<pre><nowiki>
第49行: 第50行:
 
gksudo gedit -w /etc/cups/cupsd.conf</nowiki></pre>
 
gksudo gedit -w /etc/cups/cupsd.conf</nowiki></pre>
 
NOTE: For Kubuntu users, you use '''kdesu''' instead of '''gksudo'''. An appropriate text editor would be '''kate''' instead of '''gedit'''.
 
NOTE: For Kubuntu users, you use '''kdesu''' instead of '''gksudo'''. An appropriate text editor would be '''kate''' instead of '''gedit'''.
 
 
4) Scroll down until you see the "Listen" configurations. There should be two and they are
 
4) Scroll down until you see the "Listen" configurations. There should be two and they are
 
<pre><nowiki>
 
<pre><nowiki>
第55行: 第55行:
 
Listen /var/run/cups/cups.sock
 
Listen /var/run/cups/cups.sock
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Below those lines add another "Listen" configuration corresponding to the IP address of the computer sharing out the printer. For example, if the IP address is 192.168.1.2, add this line.
 
Below those lines add another "Listen" configuration corresponding to the IP address of the computer sharing out the printer. For example, if the IP address is 192.168.1.2, add this line.
 
<pre><nowiki>
 
<pre><nowiki>
 
Listen 192.168.1.2:631
 
Listen 192.168.1.2:631
 
</nowiki></pre>
 
</nowiki></pre>
 
+
5) Save the file. Now restart the printing system with this command:  <pre><nowiki>
5) Save the file. Now restart the printing system with this command:   
+
<pre><nowiki>
+
 
sudo /etc/init.d/cupsys restart</nowiki></pre>
 
sudo /etc/init.d/cupsys restart</nowiki></pre>
 
 
6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:  
 
6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:  
 
<pre><nowiki>
 
<pre><nowiki>
第71行: 第67行:
 
Replace "<printername>" with your printer's name.
 
Replace "<printername>" with your printer's name.
 
It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer.
 
It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer.
 
 
NOTE: If using a hostname doesn't work, you could add this entry to C:\WINDOWS\system32\drivers\etc\hosts. This should only be required for Ubuntu versions prior to Feisty.
 
NOTE: If using a hostname doesn't work, you could add this entry to C:\WINDOWS\system32\drivers\etc\hosts. This should only be required for Ubuntu versions prior to Feisty.
 
<pre><nowiki>
 
<pre><nowiki>
第80行: 第75行:
 
http://printer-server:631/printers/Deskjet-940C
 
http://printer-server:631/printers/Deskjet-940C
 
</nowiki></pre>
 
</nowiki></pre>
 
 
For a driver, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one can need.
 
For a driver, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one can need.
 
 
It's also possible to use a driver from the manufacturer of the printer. This is harder to setup as most driver installation software from the manufacturer require that the printer be detected first on the Windows machine before the driver can be installed.
 
It's also possible to use a driver from the manufacturer of the printer. This is harder to setup as most driver installation software from the manufacturer require that the printer be detected first on the Windows machine before the driver can be installed.
 
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年11月17日 (二) 20:13的最新版本

By following these steps, you will be able to share a printer from your Ubuntu computer so that Windows XP, Windows Vista, and Windows 2000 computers can print to it. Before continuing, be sure that Samba is installed and configured properly. This will ensure that all computers on your network can communicate and share printer(s). See the "SettingUpSamba" documentation for more information.

Intrepid, Karmic, and Jaunty

1) Make sure your printer is installed. 2) Open the Printing window (System -> Administration -> Printing). 3) Click Server Settings in the list of printers (Server -> Settings). 4) Check the box that reads, "Publish shared printers connected to this system" and then click the OK button. 5) In the list of printers, right-click the printer you want to share and then select Properties. 6) Click on Policies and make sure all three check boxes (Enabled, Accepting jobs, and Shared) are checked. 7) Click the OK button in the lower-right corner of the window. 8) If you have a firewall enabled on the Ubuntu box you will need to allow connections from the Windows machine on port 631. For the ufw firewall the following two rules enables a windows machine on 192.168.5.4 to print

 
sudo ufw allow proto tcp to any port 631 from 192.168.5.4
sudo ufw allow proto udp to any port 631 from 192.168.5.4

Use the "On the Windows machine" section below in the Gutsy tutorial to setup your Windows machine.

Gutsy

NOTE: This was tested with the beta version of Gutsy. 1) Make sure your printer is installed. 2) Open the Printing window (System -> Administration -> Printing). 3) Click Server Settings in the list of printers. 4) To the right, under Basic Server Settings, check the box that reads, "Share published printers connected to this system". 5) In the list of printers, click the printer you want to share. 6) Click in the Policies tab and make sure all three check boxes (Enabled, Accepting jobs, and Shared) are checked. 7) Click the Apply button in the lower-right corner of the window.

On the Windows machine

1) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:

http://<hostname>:631/printers/<printername>

Replace "<hostname>" with the hostname of the Ubuntu computer sharing the printer. It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer. Replace "<printername>" with the name (exactly as displayed including displayed casing) that was shown in the Printers window you opened earlier on the Ubuntu machine. If you're unsure about the exact printer name, you can use your webbrowser to open

http://<hostname>:631/printers/

That should show your printer in a webpage. Click on your printer link, and you should see the exact URL in your browser's address bar. You can use that URL in the Windows setup mentionned above. 2) Windows will ask you to select a driver for the printer. If you have the Windows print drivers, you should use them. Click the "Have Disk" button and select the .inf file that describes your print drivers. If you do not have the drivers for the printer or cannot load the .inf file, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one should need. NOTE: Windows XP can print over IPv6 to Ubuntu Linux (tested between Windows XP SP3 and Ubuntu Linux 8.10). Make sure both the Windows and Ubuntu have IPv6 connectivity. You should tick "Allow Printing from the Internet" on the Ubuntu machine. Then use the URL (which resolves to IPv6) of the Ubuntu machine as described above.

Earlier Versions

NOTE: This document has been tested with Ubuntu versions 5.10, 6.06, 6.10, and 7.04. 1) Install the printer on the Ubuntu computer by using the printer wizard (System -> Administration -> Printers then double-click on "Add new printer" icon when the "Printers" window opens). 2) Press <Alt>+<F2>. 3) Modify /etc/cups/cupsd.conf with your favourite editor, for example

gksudo gedit /etc/cups/cupsd.conf

or

gksudo gedit -w /etc/cups/cupsd.conf

NOTE: For Kubuntu users, you use kdesu instead of gksudo. An appropriate text editor would be kate instead of gedit. 4) Scroll down until you see the "Listen" configurations. There should be two and they are

Listen localhost:631
Listen /var/run/cups/cups.sock

Below those lines add another "Listen" configuration corresponding to the IP address of the computer sharing out the printer. For example, if the IP address is 192.168.1.2, add this line.

Listen 192.168.1.2:631
5) Save the file. Now restart the printing system with this command:
sudo /etc/init.d/cupsys restart

6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Select to connect a network printer and then select the option to connect a printer on the Internet or on a home or small office network. Type in the following for the printer URL:

http://<hostname>:631/printers/<printername>

Replace "<hostname>" with the hostname of the Ubuntu computer sharing the printer. Replace "<printername>" with your printer's name. It's also possible to replace "<hostname>" with the IP address of the computer sharing the printer. NOTE: If using a hostname doesn't work, you could add this entry to C:\WINDOWS\system32\drivers\etc\hosts. This should only be required for Ubuntu versions prior to Feisty.

192.168.0.100	printer-server

Replace "192.168.0.100" with the IP address of the computer sharing the printer, then you can use a hostname instead.

http://printer-server:631/printers/Deskjet-940C

For a driver, you should select the "MS Publisher Color Printer" driver from the "Generic" manufacturer. This driver should be found on all Windows 2000 and XP installations by default and it gives all the printing functionality one can need. It's also possible to use a driver from the manufacturer of the printer. This is harder to setup as most driver installation software from the manufacturer require that the printer be detected first on the Windows machine before the driver can be installed.