理论上群辉应该也可以。
2 I) q; |+ P( M7 Q1 u: L
: ?! O8 M# t- O3 w# X我是用PVE的LXC模版。
( q# e+ y" Q5 q/ GPVE版本号:8.41 p7 Z: I$ h' a$ d
LXC是Ubuntu 18.04.3 LTS" O! t( M6 U7 L8 q3 k8 `
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
# E `: G6 l/ B1 v: @ {7 y4 f/ Z( f每种版本对应的不一样,这个版本的换源是
& C1 D- ^! q% t! M- A# L) v打开文档,注释掉原来的源
. y$ ~: [3 V, Q9 A- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
+ R6 I, A! P8 Y8 Y0 E- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse7 R r0 R- x% l! w! L# y
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
: ?/ \& ]7 M/ V, u0 f% q$ u - deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse; A- Y0 \$ c- f/ J
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
$ n8 ]) Z; d6 @& u - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
6 \) W- _$ e5 ? - deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
5 r' n- V/ y% j0 c& @9 _ P - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse, X9 y3 p/ b9 X7 l6 @0 B; C7 Y( q: V
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse4 w& L }6 d4 Q% f3 n# [; x$ `) ^7 V* S
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
Q) J! D" Q ~ - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:1 Y& ?( f4 M7 s# ]
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
$ E$ @: \/ s H/ J - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
2 `5 Y/ V+ K: v; r7 A! {8 g* d - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse7 d( D' ?: }: d
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
5 A) a. e4 _. n' K3 F' k! X' {' E - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse" n+ U6 @3 F& F
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse. b8 X6 k4 r7 M" q+ a4 O
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
$ e7 L# N. |/ w - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
, X% J3 b6 M- _) [0 Q - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
4 A/ n L4 Y* L - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse# C- B! J' T6 H) A" y
复制代码 中科大源:
4 \" R7 p+ I: U; A/ u8 y6 ^) K- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse1 l& l& C0 s4 I! I& D/ s' i
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse: @* [* t/ [6 h/ k
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
9 z c/ p! T3 L - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
: D9 h: q' ~ W) C% ]" O - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse2 i+ ^% ^8 d3 l5 u$ G
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
- R& B: B# I. \; Q( g6 J - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse; ]. g7 @' p7 B" L" o, [
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse/ J# N* _0 n+ ] P7 ~) C
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
3 ]$ `4 _( e# E+ y" G - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
; @" a: U% o. a; ]) @- ^3 b- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse3 t( J" @/ e# j' }
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
0 N2 b. j: g4 {) N, B - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse5 f5 c) `. \, |$ N1 v; m
- deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
6 a: R( _& @- q9 |1 L* F$ ] - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse$ T+ w' s0 b( c8 ^$ { S" A
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse( S u+ V! f J l
- deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse- y& Q# i# I$ @) n- y, Z. P- t
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
* F1 y7 W1 n/ H) v6 A: x - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
/ k6 |! H7 D$ I* w5 I2 F' H/ ^ - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令) U7 I1 {) e$ j
完成后先关闭LXC,打印机插上USB) a% E) n9 j0 S U4 C
PVE的Shell输入lsusb查询打印机) ~& W: k) b' _ y' q) H# ~* s# q) _
- root@pve:~# lsusb+ E) n3 a/ i6 Q' N0 `9 S# r
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
7 W ?# a# Q- p h; l' I - 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) M4 @7 D p7 F
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
L. H1 h0 o, S! }$ I- \9 ePVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定& W9 e! W! c5 N- \; F6 A! f% T" f
2 p* ], q: r. F; _ T+ `- f启动LXC安装 CUPS 软件及打印机驱动6 C% d, s1 L: V/ T
- apt install cups hplip -y
- w8 E3 v, o) L& `& f - systemctl enable cups6 D5 V0 k" ?( P1 M( w- A
- systemctl start cups
复制代码 编辑 CUPS 的配置文件
- j! t$ p' n- `( Q6 z2 k- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改. p1 I# H& F3 p4 I v% ?: [# F
1 p, [# F+ \3 J9 t
- # Restrict access to the server... T1 H( g2 \( G" l: M+ T6 ^- g
- <Location />
7 a- [1 B& R" [3 t - Order allow,deny
& t, ]# j$ Z8 f% Y8 U: E - Allow all) Y4 k$ c4 F+ A1 j( T
- </Location>* F; t7 _8 `" N% [9 K& l/ F& M9 O
; _* G1 M M# N) A# l- # Restrict access to the admin pages...
/ @2 ^. X7 c: I$ b5 E6 ]0 R' }) w - <Location /admin>
7 N2 I& j/ W) y7 G3 t/ O9 O - Order allow,deny1 d: V7 g4 ?# g
- Allow all
6 \" U5 @; Z6 I. ~ - </Location>+ C/ M, W& O& j' b1 F4 f" D
- % ~$ N1 ?( I4 m# K# L
- # Restrict access to configuration files.../ |* |5 N) M$ ?
- <Location /admin/conf>
3 @0 Z; D9 l8 ?; P, B0 o - AuthType Default, l; n- n1 \ Q2 Y' T7 e" g" T
- Require user @SYSTEM
7 A3 E" ~" i+ u+ Q - Order allow,deny
( @* G3 c. T7 h, D - Allow all
; P& N. V6 d1 k0 X4 c0 k8 q - </Location>
3 R3 u& `) h/ ?+ h3 V' `$ F
& `8 G& @: o) n9 @2 l- # Restrict access to log files...
( s4 g! u( l' B) e; [ - <Location /admin/log>" y* z; Z2 I& F( J
- AuthType Default" v: x) F- }; z% N2 X
- Require user @SYSTEM& R. Z; G2 B# A
- Order allow,deny0 T( E4 T4 n, P
- Allow all3 i6 ]2 }( S8 W" V; {+ a
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
# a( X X+ r1 ]" w- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
! W' X% ]4 ^: D J. m/ |- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压
+ |7 ^ d7 \/ A3 i9 w- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
: S1 X" M( o+ E# i; e: B# T给个权限/ y ~ Q' L, w% k+ r4 q9 z1 q
& z3 b8 Y& Y8 k$ z( Q) Y& ]
安装驱动% [6 P, x# ?- P3 H4 Z9 [% k2 u
一大段说明,慢慢按回车键,Y同意就行。0 D) ~ H( Y' d# }8 ?/ Z7 c& Q
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
" K6 y( D$ X7 r4 N5 `. }5 H添加打印机就行,驱动选择HP Laser MFP 13x Series) d0 \" r) c3 H& V7 {
Ctrl+F搜索“13”容易找到。3 b/ m4 _" Z; o2 {: ~) u, o- _7 Y
设置好后,手机也可以打印了,不用下载APP
% C$ n, P! H2 E! x- l电脑添加打印机是(举个例子)+ x/ C4 b3 t! e3 x6 ~+ B* Q" Q( F
- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
. G0 H5 F. l0 U* c- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |