理论上群辉应该也可以。; j$ u: ~# y0 t! O
# d* z: C- M; X. _7 H/ T我是用PVE的LXC模版。3 }! L6 p$ g1 M( W
PVE版本号:8.4
& V' L! U' F7 k4 G/ HLXC是Ubuntu 18.04.3 LTS
5 I# a: @) D( g* H9 K因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
% S$ V) c+ ?: P* a+ z# b2 T每种版本对应的不一样,这个版本的换源是
( k/ C- ?3 A# P打开文档,注释掉原来的源3 i: p9 \- n' ]( \* k& w9 O
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:4 Q3 [, q' w5 Z
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
8 M* K& N3 q% ] - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
8 ^- N/ i" L& [ - deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse* ]. c4 e, n. F6 n3 N6 z
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
) S& X' w) v$ K; T) {3 E/ f& d - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse* ?- {+ b+ H7 x. j F4 j1 ~
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
- }! t; D% P, }+ d* T0 ` - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse. ^0 c1 k$ y W, Q6 B+ {
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse* c2 j+ x& {3 n0 }# _1 L& {
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
2 S" b# \* H, }; V8 B5 ] - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:% @' m4 t5 ~# F8 q2 M! |: W
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse: _8 i. u# q2 ]7 C
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
9 K( P! R3 P5 s - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 [: p& {, s& Y6 r5 f* |
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
! q6 x. G& K2 x$ b8 `3 ~/ {3 I - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse* n8 c, y ^2 W0 `3 s. q
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse1 v" j ~1 e. c" t
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse5 M, A Y" r) I2 s
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
f4 ^& C$ T" {6 j' [, O - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse8 G% k* u/ f% {- Y6 K/ |! P n
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse. W: `9 l: R5 H- J4 N/ s7 W q/ C
复制代码 中科大源:
9 ]) Q- H0 p* F( a4 J; q- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse; |" Z1 G+ p0 y: j) a5 I. r" @
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse7 T' A4 S! Z& s; W7 g- @4 K, d
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# e- G3 l/ B2 a - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
& `# C# ?! ^. r( n - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
& d E6 r5 H7 F/ K# s. y - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
- A0 R' [, `$ { - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, d8 T( A( c6 v/ ^- C7 z" g
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse+ E1 k& ], ^$ H9 k
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse4 U- z% J" ^, t7 t6 p
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
) d! O: R/ w/ |5 c& Q" x0 L; K+ `- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
' S3 Q- b& x% \2 e! Y! j: J: f - deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse3 A( [$ w! K; x w! V$ Z
- deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
' |+ r" N+ n5 }3 {# D2 j2 J - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse! s. }! \0 M, R% g' d
- deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse* ^; J! n1 P* u G; l
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
8 a0 D7 Q: V5 o; O% T9 _7 k9 d" l - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
3 d% p2 n4 f: m O - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
X/ e4 A! |5 i% ? - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
/ W/ A' h5 d7 d, X' A - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令4 `5 ?: r3 O3 V% n! c# V8 j
完成后先关闭LXC,打印机插上USB' M2 A2 X' `/ M+ w s. E
PVE的Shell输入lsusb查询打印机7 o* i5 t! d4 }& a" M4 G2 W- N- ^
- root@pve:~# lsusb2 `4 l* d" X' f3 P7 j
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
' I( P4 o. V) a* E9 n: y6 { - 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
3 E. E; _! M& T' d; T& \; c0 Y! T - Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
" `& X0 @5 G: S7 f4 YPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
) n" ]% y, A# A8 }7 L* M
' j: l( r( Y9 k. ?启动LXC安装 CUPS 软件及打印机驱动/ M9 ]' O/ o+ O- o" i4 b0 m
- apt install cups hplip -y4 \4 d1 H* o: O6 q' o
- systemctl enable cups
1 j2 i/ w" H, H$ X* G) c - systemctl start cups
复制代码 编辑 CUPS 的配置文件
4 D/ `0 F ]+ v9 J- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
* L1 q* i, R; w8 r- J$ E: A0 N
5 ^& v' R8 s* Q. ^2 v' I7 h: y- # Restrict access to the server...- ]# @. v* H' a# n; h# u
- <Location />
. }3 p% S) y Z& n4 t6 { - Order allow,deny
! q. L' A) d/ p: i9 X0 j - Allow all
0 O; d; b, D% d - </Location>/ K0 O# F/ ]. V8 k8 W4 Q" Q! n
+ A8 A1 B% N w1 e7 u, n9 I- # Restrict access to the admin pages...
: [4 P0 q0 _' t0 f! a0 v# |2 n% ^ - <Location /admin>. W8 `8 k/ t6 H9 b8 g
- Order allow,deny3 t. e; c9 N) G3 y0 @' v, [
- Allow all
" X9 f& H5 P/ p$ w) y n& K - </Location>$ v1 C* \. q6 ^
- c" Q7 a3 x9 s4 c
- # Restrict access to configuration files...# {/ s3 }4 _! F, i# _! ?
- <Location /admin/conf># Y, V W+ U- U
- AuthType Default0 j; t5 M' P% i3 V5 d; ?! C5 L* V
- Require user @SYSTEM
8 @& U, `: J$ [! v - Order allow,deny( B0 B4 K5 M7 k
- Allow all
- K) |, f1 K9 F9 a - </Location>
% P5 u5 ~/ e( V - ( M1 e' Y: \" S7 W& K3 j9 z( e
- # Restrict access to log files...
, r @+ O5 G8 w1 X1 |9 _: d" P - <Location /admin/log>
2 Y3 h% F S0 `4 M: |+ _ - AuthType Default
; H8 P& v7 Z5 p' j A- o9 {* u9 ` L - Require user @SYSTEM
8 N" ?. I& x0 p0 q X - Order allow,deny
( ^) S6 x* I8 |# [% U - Allow all5 m; |$ H- {/ r5 W
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS& X) l0 d' y" a- u- r6 N
- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
f" x1 j. g$ Z2 h- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压0 W/ Q* L$ m2 j/ t1 \
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录" b+ ?# V5 [0 N8 p/ _; i, Z
给个权限
7 e; k1 A8 q8 ?. V$ R7 D7 H7 c: |5 K* {
安装驱动: l1 z4 z: {7 G- Y
一大段说明,慢慢按回车键,Y同意就行。
/ e2 T$ n1 U" i& s- E- e( ^' e n, h安装好后打开CUPS界面,账号root,密码就是lxc设置的密码% R+ S4 s7 w# M7 l+ ~7 n" y
添加打印机就行,驱动选择HP Laser MFP 13x Series* U' W2 V6 d5 n8 `
Ctrl+F搜索“13”容易找到。
& ^" Q I$ T8 \设置好后,手机也可以打印了,不用下载APP2 k$ G- ]: @5 }% x# c$ X. s
电脑添加打印机是(举个例子)
# ~4 _. C+ \$ c5 [9 u1 f1 f( Z- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的, [3 c' {5 L3 J9 {" O
- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |