I have an old printer and I want to make it network discoverable. For this tutorial, you will need already running Proxmox server and a bit of know-how.
I am using VM instead of LXC because I’ve encountered some connection problems when passing the USB printer trough.
Installing Debian VM
Go to https://tteck.github.io/Proxmox/#debian-12-vm and copy the installation command.
Login into your Proxmox server and open shell on your node.
Paste the code in and press Enter. Now enter and select the following:
- “This will create a New Debian 12 VM. Proceed?” → Yes
- “Use Default Settings?” → Advanced
- “Set Virtual Machine ID” → Leave default
- “Choose Type” → Leave default
- “Disk cache” → Leave default
- “Set hostname” → “cups”
- “CPU Model” → Leave default
- “Allocate CPU Cores” → 1
- “Allocate RAM in MiB” → 1024
- “Set a Bridge” → Leave default
- “Set a MAC Address” → Leave default
- “Set a VLAN” → Leave blank
- “Set Interface MTU Size” → Leave blank
- “Start VM when completed?” → Yes
- “Ready to create a Debian 12 VM?” → Yes
- “Which storage pool you would like to use for cups?” → I assume you don’t have any other disks in your Proxmox server, so choose local-lvm (Press space bar to make selection, then tab and OK)
Now wait and don’t close the console.
If you did everything correctly, this should be the result.
And the machine ID should be in the “Server view” list
Making the disk size bigger
This part will be the tricky one. We need to extend the disk size from 2 GB to 8 GB. Unlike LXC container (where you add disk capacity in Proxmox UI), you will need to run some commands in the VM.
Click the VM in the server view list → Hardware → Select “Hard Disk” → Disk Action → Resize → Size Increment (GiB) → 6 → Resize Disk
Now the Hard Disk section should contain …,size=8G,…
Now we need to resize the disk in the actual VM. Press Console:
Login: root
You should see prompt “root@localhost:~#”
root@localhost:~#
Now list disks using fdisk:
root@localhost:~# fdisk -l
If /dev/sda is 8 GB, good. (Ignore the red error for now, we will deal with that later)
Now update the repositories:
root@localhost:~# apt update
Install parted:
root@localhost:~# apt install parted -y
Now run parted:
root@localhost:~# parted
Your shell should change to this:
(parted)
Then type print (warning should pop up, type Fix). Take note of the ext4 partition (that is the root partition that we want to expand, for me, it is 1).
(parted) print
Type in this (replace the “1” with your partition number):
(parted) /dev/sda resizepart 1 100%
Accept the warning by typing Yes
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? Yes
Type in print again and check if the size changed. At the start of this step it was around 2000 MB now it changed to 8456 MB, so we successfully changed the size.
You can quit the parted shell by typing “quit”
(parted) quit
Now reboot the VM by typing reboot:
root@localhost:~# reboot
Login again.
Login: root
We are done resizing the disk!
Installing CUPS
(Finally) We are going to install CUPS and drivers for our printer.
Update system via:
root@localhost:~# apt update && apt upgrade -y
Install CUPS and Splix (https://github.com/OpenPrinting/splix: drivers for old printers, if yours doesn’t work, you will need to find another one):
root@localhost:~# apt install cups printer-driver-splix -y
Then start CUPS.
root@localhost:~# systemctl start cups
Enable auto-start at boot time.
root@localhost:~# systemctl enable cups
Check its status:
root@localhost:~# systemctl status cups
Output should look similar to this
Now we are going to edit the config file:
nano /etc/cups/cupsd.conf
Here we need to modify a few things.
Find the following line:
Browsing Off
Change it to:
Browsing Yes
Then find:
Listen localhost:631
Change it to:
Port 631
Then we need to make the web UI accessible only from LAN, find these lines:
<Location />
Order allow,deny
</Location>
<Location /admin>
Order allow,deny
</Location>
And change them to this:
<Location />
Order allow,deny
Allow @LOCAL
</Location>
<Location /admin>
Order allow,deny
Allow @LOCAL
</Location>
Now save and close the file. (Press CTRL + X, then Y, then Enter)
After these changes restart CUPS service:
root@localhost:~# systemctl restart cups
Now create a user called cups (set the password to whatever you want):
root@localhost:~# adduser cups
Then add the “cups” user to “lpadmin” group:
root@localhost:~# adduser cups lpadmin
Now we need to find out the local IP of our VM
root@localhost:~# ip a
Copy that IP, we will need it later.
Go back to Proxmox UI and click “Hardware”
- Connect your printer via USB to the Proxmox server
- Click Add
- Click USB Device
- “Use USB Vendor/Device ID” → Find your printer
- OK
Type the IP from earlier in your search bar:
https://<IP>:631
For example https://192.168.0.112:631
- Click “Administration”
- Login your with your “cups” credentials → “Add Printer”
- Click on your printer from the list, click “Continue”
- Edit the details to your liking and check “Share This Printer”, click “Continue”
- Choose correct driver for the make of your printer, click “Continue”
- Click “Set default options”
- Everything default should be correct, click “Set default options”
Now you are finished! Your old printer should be discoverable on your local network using IPP (Internet printing protocol).
I hope this guide helped you!