sodcalculator

10 Tech How-To

Print from Ubuntu to Windows or Mac Shared Printer

Guide 10-14172 · Updated · Step by step

This guide walks you through connecting an Ubuntu computer to a printer that is shared from a Windows PC or a Mac on the same network. You will learn how to find the shared printer, install the correct driver, and set it as your default, so you can print wirelessly without plugging the printer into your Ubuntu machine.

What You’ll Need

  • Ubuntu desktop (any recent LTS version, e.g., 22.04 or 24.04)
  • A printer already shared on a Windows or Mac computer on the same local network
  • The IP address or hostname of the computer sharing the printer
  • Administrative (sudo) access to install drivers
  • Optional: the printer’s model name for driver selection

Step-by-Step

  1. Find the shared printer’s address. On the Windows machine, open Command Prompt and type ipconfig to find the IPv4 address (e.g., 192.168.1.20). On a Mac, go to System Settings → Network and note the IP address. Also confirm the printer is shared: on Windows, go to Settings → Bluetooth & devices → Printers & scanners, select the printer, and check “Printer Sharing� is on. On Mac, go to System Settings → Printers & Scanners, select the printer, and check “Share this printer on the network�.
  2. Open Ubuntu’s printer settings. Click on the Activities overview (or press the Super key) and type “Printers�. Open the Printers settings app. You can also run system-config-printer from the terminal.
  3. Add a printer. Click the “Add Printer� button. The system will search for network printers. If your shared printer appears in the list, select it and skip to step 6. If not, click “Find Network Printer� or “Network Printer� to manually enter the address.
  4. Enter the printer’s URI. In the “Device URI� field, type the address using one of these formats:
    • For Windows shared printers: smb://HOSTNAME/PRINTER_NAME or smb://IP_ADDRESS/PRINTER_NAME. For example, smb://192.168.1.20/HP_LaserJet.
    • For Mac shared printers (using IPP): ipp://IP_ADDRESS/printers/PRINTER_NAME. For example, ipp://192.168.1.21/printers/Brother_HL.

    If you are not sure of the exact printer name, check the sharing settings on the host computer. The printer name usually appears there.

  5. Provide credentials if prompted. Ubuntu will ask for a username and password to access the shared printer. Use the Windows or Mac account credentials that have permission to access the share. If the host computer has a guest account enabled, you can try “guest� as the username and leave the password blank.
  6. Select the printer driver. After detecting the printer, Ubuntu will try to find a driver automatically. If it fails, you will see a list of manufacturers. Choose the correct brand and model. If your exact model is not listed, try a generic driver like “Generic PostScript� or “Generic PCL 6� – these often work for basic printing.
  7. Set the default printer (optional). Check the box “Set as default printer� if you want to use this printer for all print jobs.
  8. Finish and test. Click “Add� or “Apply�. Ubuntu will add the printer. Print a test page by right-clicking the printer in the Printers list and selecting “Properties� → “Print Test Page�.

Common Mistakes

  • Using the wrong URI format. For Windows, the share name is usually the printer name, but sometimes it has spaces or special characters. Make sure to use the exact share name, not the model name.
  • Firewall blocking the connection. Windows Firewall or Mac’s firewall can block SMB or IPP ports. Ensure that file and printer sharing is allowed through the firewall on the host machine.
  • Incorrect credentials. Using a Microsoft account password instead of the local account password can fail. Try the local account username and password.
  • Choosing a wrong driver. Selecting a driver that does not match the printer can result in garbled output or nothing at all. Try a generic driver if the exact one is unavailable.
  • Not enabling sharing. The printer must be explicitly shared on the host. Double-check the sharing settings on Windows or Mac.

Tips

  • If your printer supports AirPrint, you can often add it directly via IPP without needing the host computer to be on. Look for the printer’s own IP address.
  • Use a static IP address on the host computer to avoid the IP changing and breaking the connection.
  • If you have trouble with SMB, try using IPP instead. Many Windows printers can be shared via IPP as well.
  • Keep the host computer on and awake. If it sleeps, the shared printer becomes unavailable.
  • For Mac hosts, ensure that “Printer Sharing� is enabled in System Settings → General → Sharing.

Troubleshooting

Printer not found in the list. Manually enter the URI as described in step 4. Use the IP address instead of the hostname if the hostname does not resolve.

“Unable to get printer status� or “Connection failed�. Check that the host computer is reachable by pinging its IP from Ubuntu. Also verify the printer is not paused or offline on the host.

Authentication errors. Try using the host computer’s local username and password. For Windows, if the account is a Microsoft account, use the email and password, but also try the local account name (often the first five letters of the email).

Print job stuck in queue. Right-click the printer in Ubuntu and select “Cancel All Jobs�. Then try printing again. If it still fails, restart the CUPS service with sudo systemctl restart cups.

Garbled output. This usually means the driver is wrong. Change the driver in Printer Properties → Settings → Driver. Try a generic PostScript driver if your printer supports it.

Firewall on Ubuntu blocking outbound. Usually outbound is allowed, but if you have a strict firewall, allow ports 139, 445 (SMB) or 631 (IPP) for the local network.

Frequently Asked Questions

Do I need to install the printer driver on Ubuntu?

Yes, Ubuntu needs a driver to communicate with the printer. It will try to auto-detect, but you may need to manually select one. Many modern printers work with open-source drivers included in Ubuntu.

Can I print to a Mac shared printer using AirPrint?

Yes, if the printer supports AirPrint, you can add it directly via IPP using the printer’s IP address, without going through the Mac. This is often more reliable.

Why does Ubuntu ask for a username and password?

Because the printer share is protected by the host’s user accounts. You need to provide credentials that have permission to access the share.

What if my printer is not listed in the driver list?

Try a generic driver like “Generic PCL 6� or “Generic PostScript�. If that does not work, check the printer manufacturer’s website for Linux drivers, but be cautious about third-party sources.

Can I print from Ubuntu to a printer shared on Windows 11?

Yes, the steps are the same. Windows 11 still supports SMB sharing for printers. Ensure that “File and Printer Sharing� is enabled in Windows firewall settings.

Will the printer work if the host computer is turned off?

No, the shared printer relies on the host computer being on and connected to the network. If the host is off, the printer is unavailable.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →