理论上群辉应该也可以。
0 v, ` ~+ h/ U8 ~% A& `8 E6 y- k& ]0 W1 J4 B( H9 t1 F1 _
我是用PVE的LXC模版。9 ^! p$ Z5 O9 a/ r
PVE版本号:8.4
# }- e0 }$ d/ _- l. d+ t6 lLXC是Ubuntu 18.04.3 LTS3 B/ D, W& \ `* E$ A! Z7 Z
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
6 l' V- f1 W; \7 g* C每种版本对应的不一样,这个版本的换源是
' I$ L6 \) v) f, r9 e6 I' |$ K打开文档,注释掉原来的源
# x4 u% V$ d9 O3 j+ X& v7 v- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
; O; k0 F! r* b- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
5 p# f' e- r4 U/ S- o8 u- b0 k - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse( i9 K2 {: N$ k1 d
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
: ~& g. N% {( ^- S8 @3 Z - deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
& [+ X6 _4 \" H - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" R. q8 n }: h2 J9 W1 x; l" D
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse3 b1 f* y' Y e" L3 }: f* k7 L
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse3 @& W; l) h" P! t$ C
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
3 Q \5 `% p* a5 B6 i. m - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
) X' [' @$ }. i; T" U - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:* |8 Z% x2 O0 G- q
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
3 D. n, `0 c$ i' T - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
; J$ q' E1 o; s& `9 H0 B) G - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
8 T, Q4 h ~ C. B0 y. G9 c+ X8 y - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
/ e Y0 [- B. x) U: _9 Q! U/ a+ ?. S0 R - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse4 X! f* C& r! o, P
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse' Z, P' |/ H7 t p# ` K! c$ s
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
, e) C2 l/ y/ C0 u3 j+ C8 B - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
8 v$ c) c, l9 x - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
* n, u. c1 p" c* [& V - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
/ c4 [: m" z/ K# l ^7 U2 H) y
复制代码 中科大源:
; |; }, {, F1 U. L" C- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
: O6 V* l! s5 A4 Y5 H! u - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse: L: f s8 k% n' r5 L3 {, e+ c
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse# g7 c: b9 H+ L* C" |
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
i$ D: U4 Q9 l! O' S - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
6 Y) e6 F7 h9 I& I& F& m; x - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
8 n) v( |. P( L) ` - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse7 ?. t! l7 H3 g5 k1 @
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
! G. _: t( m( R s( r - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse }# w( r8 {0 A; L" t
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源: O9 ]* }! D2 y6 e* n5 h
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse* L7 I4 L4 A" E7 N4 Q
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
: n" i$ V% V/ Y' v6 s! f7 w6 V - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
+ c/ P- d8 {; a' H7 b# @2 K+ g& B - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
% [5 T* e/ Y" V# Z& { - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse0 h* B0 x! d, a
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
4 v- t3 g" P, _. Z - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
: @- R! o+ C+ Z% M8 Z - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse' @% w# \$ G( _5 R9 f& u& \: Z
- deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
/ B+ f- l6 q8 @& O - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令) z: E' u6 v0 A( B
完成后先关闭LXC,打印机插上USB% _. o% Q3 c/ T
PVE的Shell输入lsusb查询打印机
' V$ k: P7 S$ O# M2 `* D# S4 a- root@pve:~# lsusb5 ?8 X1 `! C/ p
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
7 r* X' L% s$ M, w8 f - 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" A" v; q# j7 Q" Z; I
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003% Z0 w+ S! H2 v! W4 [
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定2 C- G s3 g4 k
8 U; M; q- t- `# Y, c- N启动LXC安装 CUPS 软件及打印机驱动
. T" u# b- j7 X( J1 V" O- apt install cups hplip -y
. Z4 N1 o% m2 t% K/ _ - systemctl enable cups* O4 i1 F- f- p `/ p7 L. z
- systemctl start cups
复制代码 编辑 CUPS 的配置文件6 L6 g$ B' P* Y& K! d6 y4 h
- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
7 [: M8 {- y8 B6 ]# I4 s# {( u7 g
( ?, O- [2 {$ v) b- j0 F- # Restrict access to the server...
; o$ S4 n) m3 a% C: J - <Location />
( T8 @5 l+ j' G0 }6 h' P9 Z, P - Order allow,deny+ M, O7 i$ o, z2 f4 Z0 v
- Allow all5 F# U# U! p: f+ f+ R! j
- </Location>
8 ~ q( C* _2 B( n0 B - 2 V+ o8 O2 y4 r& r- A# U L- _
- # Restrict access to the admin pages...
" l8 e8 N/ L9 x+ a- m/ ? - <Location /admin>
2 M# a4 d( V7 G4 d" N7 ` - Order allow,deny
1 L( J- u$ _7 X - Allow all. t# W: c4 R8 F
- </Location>
4 x, ~* O6 @& L- @2 v! i
n4 I5 l1 x" Q9 J u- # Restrict access to configuration files...0 |; C: l& X" x! Y; L: D8 s% t
- <Location /admin/conf>3 G: F& x' d8 N
- AuthType Default
; r$ H% U& G. u - Require user @SYSTEM
n, c' L' J2 P; o - Order allow,deny1 i+ d6 {! X( N) M+ E
- Allow all; u4 D+ a1 b7 k' [: ^, M( |1 ^* j
- </Location>
, h+ v8 A& f: c; W - * G' E% t: \; s7 L
- # Restrict access to log files...
( w v+ r ^7 k: k+ M6 p: d: I4 ? - <Location /admin/log>/ C; a3 R5 D1 e& a3 r
- AuthType Default7 _; b; d# E7 v! K3 `
- Require user @SYSTEM
" D8 O7 _# n. X m7 g7 ^ - Order allow,deny) O: z* F, Z1 g/ O
- Allow all" e% P" B0 ]' o$ F' d j
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
$ A$ ]" o" c; i; c! N, \- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动: c/ b' `6 x8 Z: X9 M# V0 h
- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压+ a) P# @3 d. P5 U) N v
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
4 c$ n. R* D; D0 [给个权限
# R! h0 L, q' W: n, q" m
. ~6 F0 u. r" G5 {0 [安装驱动
4 ?' U2 e7 ]* M: S一大段说明,慢慢按回车键,Y同意就行。1 ~& f p2 Z* w. \) o
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码/ m' D c$ A/ a* `6 A$ G* k. n
添加打印机就行,驱动选择HP Laser MFP 13x Series
% ]" m$ z7 B6 H' j5 Y0 [. oCtrl+F搜索“13”容易找到。! y! }" f$ c/ r% E ?. q! d
设置好后,手机也可以打印了,不用下载APP
2 I6 g& R& F5 F电脑添加打印机是(举个例子)
+ U7 t4 x2 i. O: K6 ^- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
/ [1 i6 C3 {" {2 a9 c& Q- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |