理论上群辉应该也可以。, v8 @$ |# `4 B0 X2 F- L
' u+ a1 \; z5 z# e我是用PVE的LXC模版。
2 _8 x' r D oPVE版本号:8.4) W9 p# m4 X3 E8 h# ]0 _
LXC是Ubuntu 18.04.3 LTS
: e, G/ ~8 s8 p% a* T$ S4 a: a, M因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
4 S. X6 D; ?6 ^$ a! Z/ g每种版本对应的不一样,这个版本的换源是
; A8 F2 X* Q' K% l6 H打开文档,注释掉原来的源: X1 J1 ?3 A+ p5 M+ t
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
; R7 G. e: j: z3 x* {' B- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
: t3 s* _! W V, Z - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
! s5 X. D [" [+ l - deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
4 N5 b' A& G R# b: w6 K3 \ - deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
! X% {+ [8 m% e$ Y5 k - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse! c4 B7 U& n/ R; T/ o6 f6 m
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse1 F& s6 L9 r) a% Y( l2 d/ l. {
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
( u2 t. s8 f$ I: U! @/ i7 k - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
$ R! h* Q5 a1 D" z5 ]% J4 n - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse! m p; Q! z7 d* e
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:
1 Z4 E( A, [& P$ v- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse1 U+ q2 O3 o4 e4 |% N( e
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
* y# |4 R) Y) {; D j - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
3 x& J* f* C4 { G1 Q - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
7 F/ ?+ U1 B$ Z0 v* y8 C - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
* _& y3 } | {4 w, c Q* L+ V - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
( C+ ~ U+ K9 H7 j& D - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
0 F, j$ U3 O0 I7 K- J1 u8 b4 l - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
2 I+ t( t, ]/ _" d - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
l( a, \3 U6 [0 Q - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
6 r6 l2 t2 X9 e$ S' b
复制代码 中科大源:
4 B. s) ?6 m5 s6 T* J- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
! H5 H) s6 C8 r/ w E - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
' i% y' Y5 J" w, p: i' F# a - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse9 ?% `9 u p0 [7 H+ V
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
3 c4 E- {- l2 [1 v; {- J - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse9 P! B7 Q6 O& B8 W6 V0 z7 s
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
' F7 X4 b( L% k- g. P - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse5 q" o3 v+ E% Y1 I# H
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
b$ g4 I8 V# G - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
( w# v: Q3 X, M) l4 q+ \ - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
& q! |7 F' a* ~9 z- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse8 t" A( h2 m* Y3 s2 A2 H& G
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse$ H2 c5 D6 M1 m' M8 \
- deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
8 u5 Z s( u1 J - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
{. j7 q4 d! \; W# c - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse+ c! n# d: [5 z
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse7 V9 F8 d0 |% X, I9 J! A; j
- deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse# p5 O$ i( ~4 O" i0 u( X
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
: d6 ]6 W+ O2 Q! @& X; F$ s - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
6 ]2 Y2 }9 K' f! d$ G) ^; N - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令4 E# K- c- E( {
完成后先关闭LXC,打印机插上USB
" x6 c. w/ F2 L( N1 r" gPVE的Shell输入lsusb查询打印机 s/ k# x' O( ]6 I' c2 p ?- U
- root@pve:~# lsusb
& q: @/ S) i% Q* w4 X5 f$ y- W - Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub# F; y. J! u7 d* C, O
- Bus <font color="#ff0000">001</font> Device <font color="#ff0000">003</font>: ID 03f0:f22a <font color="#ff0000">HP</font>, Inc HP Laser MFP 136a
/ I1 l; L% `0 P - Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003; [. v# ~9 E9 x% @+ U/ `2 S
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定% u" i; s3 I' ]' p, Y
- z; m4 f" D0 P$ O9 v' R \! D启动LXC安装 CUPS 软件及打印机驱动( Z. I$ @. Z# C: r/ N
- apt install cups hplip -y
2 X8 c% S: t/ W7 K% r - systemctl enable cups
8 N/ U; O' p! W0 r7 h# ~ - systemctl start cups
复制代码 编辑 CUPS 的配置文件
. R2 K3 d9 f& N# d) _- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
# w& L, N/ f4 B4 W0 a X6 E
) I8 l3 o# g: i+ J6 P* F- # Restrict access to the server...
- X6 Q) u' U" a- ], c5 E - <Location />& q8 a# S2 Y9 l6 c" X5 m
- Order allow,deny
: i% O, f" f" Q: i3 a% @- w( N - Allow all
+ L( g3 ]1 o8 I/ ~ - </Location>
$ C' |* |/ o8 a" R' L5 x" }" ^0 M' X
. m2 e7 F" T5 w% C9 C9 c. \( P- # Restrict access to the admin pages...- s% _/ Z( q. ]3 i
- <Location /admin>
3 ~; y# t0 }* y6 _ x1 e - Order allow,deny5 V& ~9 J8 u4 C# l% R. b4 w
- Allow all0 z5 a& I7 ^6 `2 N* O# J
- </Location>
! }- e6 D8 E, G+ s5 N: ?
& ] r1 ], L& A, O5 A- # Restrict access to configuration files...
K2 I) s( y' D: I1 d9 s. V - <Location /admin/conf>& z6 `* d7 b" Z" R! N) f0 s
- AuthType Default
( I* R5 w' H2 F1 o6 K1 l) U! _! K - Require user @SYSTEM
4 B& T' j P6 W - Order allow,deny
0 S6 b6 D% c# {, ]3 y: } - Allow all3 b2 n7 p! P; g- v% I
- </Location>
7 p/ i# K/ L$ A$ U - 6 M& h6 z( J* v/ l8 u
- # Restrict access to log files...
3 {# @6 e/ |: j+ J8 a - <Location /admin/log>/ y! ?# ]2 b# m( Y: n
- AuthType Default
$ v1 `7 U! F* a2 @( ~ - Require user @SYSTEM
4 F7 A0 K; z' o! X: X& A' j4 r& J - Order allow,deny
$ [8 w, P- l. o; ]( V5 x - Allow all
+ d8 S* T) S; u {& u: k; W* k - </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS- ]1 b, J' z4 ^3 i! S7 J
- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动) N- p9 ~8 ~) G* O+ n
- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压( D' y1 b) s0 k5 K7 j- c
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
( k& g. R& C! s给个权限- V5 X# ]$ m; U- @
4 p/ `/ v* V# }& P
安装驱动
3 b* c9 [( A) z/ c# [8 k一大段说明,慢慢按回车键,Y同意就行。0 u n k' @% q$ G2 h/ [5 o! }& R
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码, n8 |' ]6 z3 L) Q$ Q
添加打印机就行,驱动选择HP Laser MFP 13x Series- [& j, _& _& ?& I/ G5 n
Ctrl+F搜索“13”容易找到。! ~' H( h& J6 t# c
设置好后,手机也可以打印了,不用下载APP
) D6 |8 U) |* x电脑添加打印机是(举个例子) x" L* T- |' [* L$ r) G) o3 c/ g
- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的& p9 I1 L* I2 B9 Q3 B0 T
- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |