理论上群辉应该也可以。
+ [+ p. I* V' S
3 O% T$ Y, O, J/ M! C我是用PVE的LXC模版。- Z# y1 X5 @ j
PVE版本号:8.4! [1 J' ~5 b& v# R6 G
LXC是Ubuntu 18.04.3 LTS
9 M& m% ?0 n2 P因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。' T; K2 V3 O2 v5 B9 r
每种版本对应的不一样,这个版本的换源是
# s9 v% X( w6 \ n2 ]% I6 J! f打开文档,注释掉原来的源, L# W" h/ G4 i L( x! p# q* b
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
% g- b1 R; A1 A! X! w5 S5 u4 O- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse( Q$ w) ]$ {: K
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse$ c/ |5 L. k; P) T- W( @( r5 |
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse% ~% X- `& i. H8 Z
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
( I; D; G: x) B8 D. i v# p - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse/ U9 Z6 v) d8 U. o g& H/ r
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# X- s5 B4 N9 |, D - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
% F8 J9 x! o0 k, \7 ~5 N. B& i7 J - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse& v4 f4 y6 [' O% c6 b
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
7 B$ r* f3 }- x! I, a - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:
# ?% X2 v8 l$ M! Q! a, m3 s- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
2 v' u. Z% B- t - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
0 L, N5 i& C; _) P% B - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse4 A- v4 w) f0 j2 k+ g3 ]
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse/ t% @ k3 V( ?; x+ u! F
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
$ D/ H! [% L" \ - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse6 m+ ?$ a' l2 }" O/ ~2 G
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse* S# p' N" M1 Q7 n+ v. a; w
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 ?3 J0 E2 b# |+ v# _
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
6 C) p. _2 k+ `/ T' m+ w8 _ - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse& W3 F8 ~" W) Z( X4 u) d L/ ` F: [& G2 o
复制代码 中科大源:
0 Q% ]% @7 u6 D! b- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
5 `( w x% {' T7 g7 `- K+ Q& Q H - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse3 h' n6 |$ L- r+ W
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
1 {6 w$ I0 R+ d- \' H: M: P5 o - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" k2 e- ?1 Y' N( v
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
' v w; U; N. U" B0 o" D; U7 ? - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
3 B+ k! h2 t; y - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
& t+ W( l' G8 A7 }4 C8 ] - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse! }: r' h/ j0 L3 B b# j' t$ J+ m
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse; Y4 |( g. t2 l: `7 G
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:" j) i) S- Y& x3 `+ Y K
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse8 l) o2 y) f- ?
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
! L! S+ @( M% o: B& ^ - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
! q m. i( f& [8 P5 x$ w8 O - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
* j5 d1 W' V# `, d' x - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse6 ]3 c5 S" D6 m
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
/ {2 ?5 j& m7 T6 y! @. v5 \ - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
9 M: t+ m7 ]$ q1 l - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
4 U, I- x* Y. a$ z/ ]! l1 e( D - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
- [, z" \' ~- C1 |; n" L - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
$ R8 x+ B" b7 a5 y完成后先关闭LXC,打印机插上USB
- I5 j0 _, T* j3 H! UPVE的Shell输入lsusb查询打印机
! _0 W) n [. X) g- root@pve:~# lsusb
4 j3 S% f7 a. |% x5 X4 K4 h: ~9 ~2 { - Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub* w* w; C' s+ |% E5 t. Y ^3 U) J
- 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
0 m' Q x3 s K% n' {: [ - Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
4 |9 R0 S6 W4 |* K; F9 G. m: }+ pPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定8 V3 k. o8 e4 ^( a
' J1 X7 M, g8 I8 V f启动LXC安装 CUPS 软件及打印机驱动
6 n0 n; A7 G& {9 I* B- apt install cups hplip -y
' f0 m l& r' [/ q# J9 y9 R, r, p - systemctl enable cups
x* D; W/ {* z$ O) o1 y - systemctl start cups
复制代码 编辑 CUPS 的配置文件2 W! N! {; U( _4 W2 y; r2 Q( m
- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
) P) c, O6 q- s$ i' i
5 O. A! R, L4 {/ x3 n; g- p- ^* `- # Restrict access to the server...7 M5 I7 [, i+ `
- <Location />
* M& E Z! y2 X0 Z - Order allow,deny
7 L; ^3 ^- k# X& I: m, N# o- [5 R - Allow all _, y" t" J. ]2 @, `* `
- </Location>" h# m* c3 @$ z$ x) T6 U
8 [6 L) Z D2 f( c( M k- # Restrict access to the admin pages...# Z) c$ o7 h, S8 |0 @+ a) e
- <Location /admin>
8 `+ Z, ~- |' G( ]& ~' S - Order allow,deny
& I! X! ^/ q/ Y - Allow all
- j2 N1 [+ \. }" n7 g6 u' P7 y5 [ - </Location># t0 E% j9 p) Y: X$ m
- 1 e# a5 S1 m. C* e
- # Restrict access to configuration files...
~; I; z9 B7 J' i6 Z. v6 E4 [( ` - <Location /admin/conf>
" a! g6 U/ _; K* a+ `( i: y$ ^ - AuthType Default
* t b. I7 l- t, U# H. w1 ], L( S* N - Require user @SYSTEM
$ c7 Y/ i1 T' { - Order allow,deny
; Y/ t8 ^ c* Z& z2 M. h - Allow all
$ J2 ]6 R7 b' Q/ w( B - </Location>. r- g/ }/ b+ ^- ~. I: b. }& n; T
- ; ] K) e, M9 [& V
- # Restrict access to log files...
, b: c+ ]$ F7 E - <Location /admin/log># @, R, p8 P: i2 h
- AuthType Default
0 O' _9 S; @9 y9 Z! i6 b5 k - Require user @SYSTEM5 n3 k9 [: Z! m1 z$ Z; l% x
- Order allow,deny
' X: W5 l$ R. G6 p3 h" } - Allow all. |/ ^- P; H, L8 m# D
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
6 {/ ]$ g( G: s4 X; o+ C- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
% I( R; w. _: B# V- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压
4 \" ^7 R) k$ M# L- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
4 Z# o/ z- ]% E给个权限9 Z' e/ v* F$ T' j* q
! U- \% I! J5 f2 {
安装驱动' i' q- H' X6 ?! m! B% C' Z* N
一大段说明,慢慢按回车键,Y同意就行。" t7 {0 ]* _ B4 |, }. j6 K
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
$ j9 k) Z$ \! R7 t/ _添加打印机就行,驱动选择HP Laser MFP 13x Series
" N' |! R+ K* a* B0 H) x' z1 O; mCtrl+F搜索“13”容易找到。7 ~* x1 n0 k" T9 h3 Q2 p
设置好后,手机也可以打印了,不用下载APP$ t5 K# h# b& P& p
电脑添加打印机是(举个例子)
! r& C0 H/ B1 X) {" b# ]- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
2 N' ~# G' R, H# ~% P/ [- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |