理论上群辉应该也可以。
+ D) x, e4 g, J' q1 m1 i z$ r$ J
我是用PVE的LXC模版。
3 C8 w+ [- V" H& m. y8 ]9 I7 qPVE版本号:8.4/ a$ W6 W% A) f: C& @) Q: _8 A% E
LXC是Ubuntu 18.04.3 LTS
; p! r. e0 V- q/ ] ?因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
+ d; Q1 J$ O2 u9 d每种版本对应的不一样,这个版本的换源是' O! H8 C* r- k( y- [! T
打开文档,注释掉原来的源1 S- H) e! Z& z2 ^3 h8 E$ X
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:0 P" g- t# W5 _( s x( i' ~; [/ S
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse3 c2 ~/ v7 O) H# Q, w
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse0 ?7 S& K, M, ^2 e' _. N4 p! s7 y* ?
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse0 x- I( D6 h. R1 H) A; G8 |2 U8 S
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
) U$ R* C* l( E1 `1 I* E - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
' U- B6 w1 B# ?0 f. n* i - deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
8 N4 e) f/ x8 |: ?4 o - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse6 {9 r( ]. P7 c, s" c
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse, ~/ L8 M7 ]3 r/ f* U2 h" p
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
" Q9 g' ] H$ u, }" I* s - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:9 _3 q% e- o, ~" d" A
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse: d) _& A4 J* [( I0 \& v
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
3 g/ u0 j9 c% D) W# O - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse3 e2 T+ V( }7 i$ \) ]! n
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
1 u. S! [% F: K3 A7 D - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
& K. d. Y0 H4 ?- Y& v" c$ @. Y+ x - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse) `9 V4 E7 H9 l: v! A4 D" e ^
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
1 L5 A* v, x& Q/ ?1 e5 X: L - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
b2 b7 V% q7 ]- h - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
- N7 X5 e/ e4 S - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
5 ^- K" I. h; p4 S
复制代码 中科大源:
* F- `/ T2 V8 F) q- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
+ B% l- R6 c$ F: G- B ]' x5 S - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' h) m9 A$ i1 {
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
% W0 h M% g+ L8 i7 M6 V' m - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse' s x: @- D, x/ A3 {3 [
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse+ l# H: `) n7 N U7 J( U! {
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse2 ^' k( m" K$ K2 k
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' y8 c- `/ j ^ m! D3 z
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
. V, X9 u+ {0 Z1 `- Z) W" } - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
! E2 R# B# v9 N4 m' q - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:% y4 g; p, ]1 F5 t7 _6 P9 o
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
1 G9 G) S6 y5 f( ? - deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse l1 _1 u$ l4 w ^+ d
- deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
6 x1 g p+ _% b" a1 K! e - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
* j9 m! y( B$ n; }$ e, K - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse5 E! @7 `6 s) \5 c* `
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
8 E. v3 i6 M. o+ J0 | - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
/ A$ C' I5 I4 F$ u - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse* c% }% v7 e1 d5 t. S- g( ^
- deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
; K7 q# o5 g) w - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
6 F5 {7 h3 b, ]2 A# y2 w完成后先关闭LXC,打印机插上USB
n6 k$ [) n# W- `( _PVE的Shell输入lsusb查询打印机
1 n |& \) @" ?1 n5 d- root@pve:~# lsusb+ |8 U2 }. ?& w$ N' W, S
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub: S, T4 b, V9 R% Z; m8 K7 N1 g
- Bus <font color="#ff0000">001</font> Device <font color="#ff0000">003</font>: ID 03f0:f22a <font color="#ff0000">HP</font>, Inc HP Laser MFP 136a1 i9 M! b( S5 m/ [4 j/ c
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
6 l5 e( M$ ]* \4 JPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
' \$ B# q! N- i( y7 a
& W7 i% u7 K; v4 X3 y8 [8 N启动LXC安装 CUPS 软件及打印机驱动
# r$ u" t" t' e- apt install cups hplip -y
9 z. n5 p) c3 Z" S2 j - systemctl enable cups+ d( ^4 `! v3 E! c
- systemctl start cups
复制代码 编辑 CUPS 的配置文件
4 m# G3 D, J/ U) K" H+ S7 b! |2 A- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
& E5 C: z& c3 Y7 i( A( ~0 _; ~6 v+ X2 b2 s( s* ^3 ]& a
- # Restrict access to the server.... ^7 A6 @( [% s% [
- <Location />
! G. ?' z5 r( ?. W& X7 g" A - Order allow,deny+ S; [" `) y/ W* Y7 j5 M a C+ X3 [
- Allow all1 J t6 N+ f7 S
- </Location>
) s5 I0 z2 s5 g! A% s - . a% R w5 }. u( _0 t
- # Restrict access to the admin pages...
) ~, I. v' r, M* | - <Location /admin>
( E2 r% n7 O- d! H2 g; i( F - Order allow,deny+ K0 l2 c/ U v- s; m& U5 q
- Allow all9 D$ k ` \0 w4 q: c4 h, g
- </Location>
: W9 t2 n& R/ o6 A4 T% f) R# p
W/ s3 |# Z/ M# s- # Restrict access to configuration files...
( ^. w: o: V7 p. ^) { - <Location /admin/conf>
' Y! f" q$ u+ C0 U$ L - AuthType Default. ?* [$ l9 \( u7 ]7 O4 {# G
- Require user @SYSTEM
" k; K! b3 X2 k; d& G$ V - Order allow,deny/ i% t1 j Z2 f
- Allow all
6 N8 p$ U2 C R8 S7 x - </Location>
6 c9 i C: z8 p - ; P' S8 J1 h3 {+ o% R
- # Restrict access to log files...
, V4 H0 ^9 r! L0 [; G b0 L" n - <Location /admin/log>
$ o' k! v9 {& P( L s - AuthType Default
! ^. E4 n( T; e# E6 B* d9 S) F - Require user @SYSTEM
9 q) T( v' M+ b, h - Order allow,deny
8 N: ^; K. p9 `3 o. _) [4 Z" e c% f4 ] - Allow all7 Q9 l; \% [) T# f( ?
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
4 P' A! c1 _# g& c; Q$ K `; D- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
, R* y: ]/ b( W& ^- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压+ O2 P; w [3 a, J
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录8 e2 G4 D/ r' p$ j% @0 W Q/ o
给个权限
. g6 x8 i/ n7 A2 X9 P! b0 {! U0 f# K# u
安装驱动. J5 {" v ]' o4 p4 h7 T2 U
一大段说明,慢慢按回车键,Y同意就行。; ~' _6 Q" ]$ F' K
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
( h) B5 Z& K/ S- c v% }& z0 T添加打印机就行,驱动选择HP Laser MFP 13x Series8 ?1 ?! [6 _7 n, ~5 w4 P( I$ C
Ctrl+F搜索“13”容易找到。
; X: b& v; x2 E; T/ a设置好后,手机也可以打印了,不用下载APP* Q* P5 a/ X, k! z' T ? s
电脑添加打印机是(举个例子)
7 L8 l5 q; \9 N1 n/ l- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
, x! m/ r8 A% M! P9 H5 Z( {- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |