理论上群辉应该也可以。6 u* k5 s/ l" q
1 P; J, H$ p( z: K F2 A7 [
我是用PVE的LXC模版。8 |9 F, ?! O1 b3 [1 p/ X% I
PVE版本号:8.4
) t% B7 [9 e/ f" \" @6 FLXC是Ubuntu 18.04.3 LTS4 | G0 A" t( D. s% `6 S
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。! `" ]' }& O1 k+ G. t- P
每种版本对应的不一样,这个版本的换源是
/ M/ T$ q; @7 L. f* v) @9 |+ |打开文档,注释掉原来的源
( t# Z" V- d/ z" _8 ]- sudo vi /etc/apt/sources.list
复制代码 阿里云源:2 D$ C& _! n" @- u6 D
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
) A# k9 H4 s# p9 [+ Z% A% E - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse: }- E* ?& P9 }. \5 K; x8 e
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse; \. `3 w2 Q* c, n5 [& r. H
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse9 I; D8 S O( W. r, `& {; A1 N
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse2 F* H, U7 s6 ^- S" j
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse2 h' {4 T6 B+ I% e5 Z. {
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
% c( u/ D$ K8 a - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
9 r: S1 c; o- i2 j8 `( u - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse, I' Q0 r. g+ m
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:$ G w4 L- @$ K6 `$ Z
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
]8 H+ Q- _2 `- j2 P$ [. @/ y - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
2 [. n* D+ g% n5 k$ x* c - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse1 R1 x5 K, S7 U4 B9 S% f1 W; g
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse! P2 y% T) N$ p( M. c! U5 |
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse, `& J2 s" |; Q, M! y0 S
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse0 q$ o- B- X0 G! L9 V7 j4 n/ t$ A
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
/ t A# j9 _- `! B5 n1 h - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 |9 t3 @# y6 t5 @
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse( @) N1 h/ p5 d: b; v
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse S6 ]8 @, d8 M
复制代码 中科大源:& ]) U8 ~3 U: n; F, q: U& t+ @
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse9 T5 Y$ b, `/ f( V
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' Y- I; n; h5 C$ |' G
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
+ h P+ d( k" `$ x# c - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse/ J+ r# o8 k6 n, B& B2 D3 t% i$ m
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse* X/ ~+ R# J5 [# A& B# g
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
' k% ]: W" b$ @+ l% e( w" |1 ~ - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse! y) Q0 @) y/ d5 [8 }) T) {
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse- w) M5 w3 g0 ~
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse. X; E4 }# `$ N) `, c) R t+ a* e0 X
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:% c$ a* ^) J( h
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
& N2 Q' ]5 {% [* Z- j6 M1 \0 [/ u - deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
5 v ]! Q- h2 D+ f8 j - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
! A; s" a4 U9 j; Y' I8 ? - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
; |( P# Y" N/ o/ u+ ? - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse' [ a5 W. W# S0 F
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
: t$ q, M4 O2 a- ?( g% Q/ j - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse; x, i5 h9 l0 @$ y' {* q( a: N
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
% l. `8 E% h; |" q# D$ I" c - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse+ y5 h% ^- m) T' k, j$ `4 s
- deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
( I, C% a( q: c# D* i1 Y完成后先关闭LXC,打印机插上USB7 o) Z% C! T0 s
PVE的Shell输入lsusb查询打印机 ?# e) J0 D+ k+ B b, T7 U
- root@pve:~# lsusb- Y2 h& a4 ^& c
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
& s7 `' E+ w+ B$ a% ] - Bus <font color="#ff0000">001</font> Device <font color="#ff0000">003</font>: ID 03f0:f22a <font color="#ff0000">HP</font>, Inc HP Laser MFP 136a5 `( ^ }& o3 [ e+ A+ ]
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/0031 a6 ^ O G% e/ b0 M
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定2 T) @* u+ ^& J( ?
9 v, \3 k3 M+ E! m# l- O; n
启动LXC安装 CUPS 软件及打印机驱动
; ` [3 W- _# A) }- apt install cups hplip -y
/ i$ t: }! j! X' Z# ~9 s - systemctl enable cups
+ E' l; Z) O: z2 m( R9 h- }9 P - systemctl start cups
复制代码 编辑 CUPS 的配置文件( |+ L/ y2 \9 [, }7 Y, a2 C
- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
" Q; ?1 K- W( I7 i1 I% L& T# g6 B9 r B; E
- # Restrict access to the server...3 |$ m2 s4 ?6 e* @9 i3 B7 K
- <Location />
+ h t5 k: e% b* p: ` - Order allow,deny( H' p5 c8 E1 H6 q
- Allow all" `7 n& o H8 P2 V% s
- </Location>
' G( ]8 z. \; C3 ? - 5 ^% M2 n" V) B, q& l5 j# e
- # Restrict access to the admin pages...1 P/ V) {3 T, Y! [; M8 p
- <Location /admin>5 n" U% i5 L4 Z+ O3 n/ Y
- Order allow,deny/ m" K- P( k" v2 J
- Allow all
7 F; n- b1 L6 p- k' \! C - </Location>
. ^, q# K7 P" U8 t
7 ~+ o7 n2 ~3 e+ f6 g5 G+ n- # Restrict access to configuration files...! r: O3 I, @3 n
- <Location /admin/conf>; r M" p, f4 a+ O
- AuthType Default, n/ W/ o1 I% ~8 |! j
- Require user @SYSTEM! r* ~' }/ [, i! T2 t1 t
- Order allow,deny' m4 J4 _1 {3 G1 z3 j
- Allow all4 ^$ U7 O7 @" h: L/ b2 \
- </Location>
O# M3 X$ D4 M3 M' y) N! N - ; Z5 F/ W- Q- s. z7 ^+ g7 K9 V
- # Restrict access to log files...' ^( I K$ q6 q* c* w
- <Location /admin/log>; K2 N; f* W/ ?2 P; T* j _
- AuthType Default
2 ~* S5 `% f( A* a - Require user @SYSTEM
' p9 G% L6 x% `1 Y) I* Z" S - Order allow,deny
x9 y. F. Q# n+ j: D* |' r. y( F - Allow all
9 K2 C3 B0 E$ \ - </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
8 Z- h- B5 q" Y. Y! w* g4 r. y- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
: d6 G- M3 v% b: Q- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压5 v4 }/ F) [+ D
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
% H) n; Y3 |! e6 O给个权限6 z& z( W0 T- W" R7 v. r
* c% w3 u$ }5 z. A1 r1 Y& d' ~安装驱动
& F/ p0 k2 [: Q; t$ f+ j一大段说明,慢慢按回车键,Y同意就行。; a& `' u- h9 z- a
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
! M) q2 U& D# O" `添加打印机就行,驱动选择HP Laser MFP 13x Series
6 t+ J* d$ }! |1 O0 C0 e& uCtrl+F搜索“13”容易找到。1 v' O5 H1 r! f8 r% O
设置好后,手机也可以打印了,不用下载APP
& q3 {: I$ F2 R; Y电脑添加打印机是(举个例子)( H+ K" }( `4 s: G7 K- ~
- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
$ i% J5 I7 C9 t; {1 H- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |