理论上群辉应该也可以。
# \. S5 c6 R. b3 D' X- d/ e3 s \# s& R# _3 J/ r/ v5 c" s
我是用PVE的LXC模版。
! d. G* f3 ^# _) }. {PVE版本号:8.46 U% G. P5 z! y, U% i
LXC是Ubuntu 18.04.3 LTS8 W0 x1 C0 {; Z, o" s
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
) Y: A8 m; h/ t' i/ e3 \每种版本对应的不一样,这个版本的换源是
6 x+ `, t9 R: y% ]* ~& @打开文档,注释掉原来的源$ X5 @) F0 W. |+ Y+ w
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
" g; t4 G' d9 Q: \* |' v- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
7 \1 V/ {3 \. B5 K S2 O - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse4 B4 v# D3 L0 @% k1 \* V2 z% K
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
1 z0 [& [1 L& H, K% {( K - deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse w( H1 l! G4 Z* m
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
4 p8 ~3 C3 I' I& ^8 e7 B: A - deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse6 v/ d6 s9 B+ U5 q2 F
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse6 B; m8 C, F. K6 T U
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse0 ~! `3 y: F; l/ {
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
5 I8 F E3 a, o" H! f7 E( U - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:% G9 X% @6 l3 m- l# `
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
6 x9 r7 ]+ U. F1 N - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse: |# @: a+ {& `2 H0 v% v9 z
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse7 W: O; h8 T9 k) P( g
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
* ?) V* o7 Y& F7 w6 T% |" N - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse5 @1 a- N' z3 h4 N& h7 q. T V
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse4 D* D B9 J# { l) g8 s# g* s' J. t
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' i' g7 k9 G' O D4 m$ F. D$ S
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
/ w# G3 P, F' }# Y - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse- A# t9 K# ^+ d) `
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
0 c/ n& i1 d" y( Q
复制代码 中科大源:
) ^3 j4 P% I. l3 Y v5 S. n' z- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse" ~ S( `1 M: E, D1 n! h
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, J4 \( N2 Z) S& c0 G
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
" x! ^* O( d) x2 K/ i y: f+ q - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
1 \& L2 h; B# f. L - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse& ]$ q" h! C- _4 E' ~! h. \0 P0 A
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
" j: O" d2 H9 O0 l# q* E& N4 U - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse9 m" P* l4 B/ l3 V2 l, N$ v8 n9 M
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
/ M2 P, n9 W) V' U' i - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
7 P8 s1 R, K0 G5 Z - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:- N: l$ t5 \7 S9 H: w, J
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse2 ~0 }' `- h: B1 h( ?$ a6 S, {: o; e
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
2 j% S. A2 ?& t; {- n - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
% u1 O7 n& A. [1 u$ e - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse5 m" o6 Q8 g6 G+ A; k
- deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
- v: c9 I4 X" X1 U, n1 `; P - deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse2 Q7 B6 e2 ]% ^: D3 d3 \
- deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
% z; }- A) d& p# P8 j% B% W1 v+ q - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse& r; {: P( B5 l3 }& G
- deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse& \6 v" a0 m1 a. T: B9 N. j
- deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令9 `5 }" z$ v! F [2 B! j
完成后先关闭LXC,打印机插上USB
3 U3 Q* V9 S; y" ePVE的Shell输入lsusb查询打印机/ U4 v8 j. Y' l
- root@pve:~# lsusb
1 [6 S6 D% \' Q- m' _( @. \ - Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
; I$ ]( W- d3 _( T. U( c - 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
; u' y7 q' [2 O" s. {! E1 I. Z - Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
9 K. B4 P& O& F3 B# ^' A$ M. wPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定/ m) Y4 q: T1 l* V3 U
% J" x T: f$ j( T8 D! K q
启动LXC安装 CUPS 软件及打印机驱动
T$ ?: T' T1 r' z) |. R! m+ C- apt install cups hplip -y
- u6 J% r* J; x( X% H) x. Q - systemctl enable cups3 G! L' Z5 ~0 e1 ^$ k' I7 E
- systemctl start cups
复制代码 编辑 CUPS 的配置文件
) V! i7 B& W) q% V- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
: r: q( M; X& _4 h! x; [# } |, y5 c( ]
- # Restrict access to the server...
2 y) }4 M) n9 Z: {, i8 P - <Location /># j/ Y4 c0 S' N4 v. c! j% O: M g
- Order allow,deny: I5 g; v2 O* @& b, A0 B# }$ W
- Allow all |3 ?1 b! b+ q+ A+ A
- </Location>
: N1 v1 b6 O* y3 t4 w" w
/ B2 H# J& n" y/ K- ]7 e* D- # Restrict access to the admin pages...6 o, M; _: ^6 o0 B
- <Location /admin>3 P% Y4 c4 p' C! F4 \# N
- Order allow,deny
' G6 u* A9 E* I( @6 D. O - Allow all D3 @* A/ r; W2 K3 B% z
- </Location>7 V$ [: F/ H7 f
- ?0 d/ K2 V& D: D1 f- # Restrict access to configuration files... T; x- X f9 K) n% u$ Q
- <Location /admin/conf>
1 N, B' S% \0 k. N# p% Q2 v5 Y# ? - AuthType Default
/ K( S; Q9 F' Y3 s - Require user @SYSTEM
9 x7 P2 \( q. y% y& @1 L - Order allow,deny
4 C# Z* ]; g1 i5 \- f$ d d6 f - Allow all
, L# d( ]! A. u2 l- [# p& l - </Location>$ R6 F. ~& y! F/ Y
- 0 L6 L/ r- u# _' H6 L. Y* J5 }
- # Restrict access to log files...' h. s3 ^" R1 |4 M, e
- <Location /admin/log>
2 ?) P4 ~$ ^* L( t9 Q6 E& H - AuthType Default
0 A& h8 \- k) K$ f - Require user @SYSTEM' G4 q% i" R5 Z0 v/ `" X2 {
- Order allow,deny; A* b3 e# W( Q; z
- Allow all
7 z4 i7 U0 ~% E; M2 ]4 y& e& p; w - </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
1 c; I: R% W/ r/ |* s" w- u- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动6 X1 O1 a: ~4 v" e' K- p5 R$ w
- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压
9 b4 I1 \% k: f# @5 `4 x0 F- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录. \/ V0 A6 O$ u- G! d& T
给个权限) ~3 @7 U$ s$ ?/ F' d
, ]( z6 z G( z7 _( s/ W( y安装驱动/ ~' G3 z! e- s6 X( o
一大段说明,慢慢按回车键,Y同意就行。
# i4 a1 }: j( d) ]: q. x. o! B( k安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
* W* I+ r) j) t6 t添加打印机就行,驱动选择HP Laser MFP 13x Series
* P9 A1 y: T% t5 R) g2 UCtrl+F搜索“13”容易找到。
9 C6 r* A, t3 C3 k设置好后,手机也可以打印了,不用下载APP
) F+ Q1 k6 f* X电脑添加打印机是(举个例子)
8 m% B! D% n" t6 n- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
' V1 z1 @, _! D- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |