理论上群辉应该也可以。
+ n0 t: S8 e7 e! N, c2 k1 @4 r+ ]5 Y
/ A% W; Z2 r+ ?6 v& T: O我是用PVE的LXC模版。& }- A2 H# Q+ G, }
PVE版本号:8.4
+ p. w3 W/ ]& x* n7 RLXC是Ubuntu 18.04.3 LTS/ e) s7 g5 k5 E7 S1 l8 @. x8 H
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
+ n' ]2 G: J# T: J+ ]每种版本对应的不一样,这个版本的换源是* @2 \. [: \0 e7 q; ?
打开文档,注释掉原来的源; b% U6 n) M3 x# b$ P5 k$ U4 e! k: d% _/ Z
- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
: e# L- `, u# r- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
2 J6 O" W* l! W* `1 _8 I* v - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse0 a0 `- h& L4 R3 B/ r- }+ H( g
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse# T ^# x# Y- w. u
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse( b) s+ h5 e; {, g1 r8 _
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse2 A% }, b' g$ T$ |; b* R
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse# y5 _" O5 L5 r( A+ g, o. M$ y. n
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
$ N6 d' d+ O- a - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
3 l. N8 [3 j# P - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
! ^& G. _7 u; w - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:
6 h, j4 ?# c _& L; d1 m% q- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
; y# Y3 n) V1 X4 K" I {- ]" h. B - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
0 M; C4 m; D( A7 w - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
4 [8 h* S* U) B6 D% L* }3 a5 e - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
( A8 ^* [- d! k' Q - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse: l; j4 x; _1 ^, y2 ~1 o
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
: @, ^: x% f9 k/ ?& c* v X - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse0 K, J, C) z: Z `+ \* X, ~/ t* @! q
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse1 w3 K$ ~* M! s* j; r. w
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
& U% r! d) @' x% P - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse2 D- O) s7 R8 ]* i H, t' }4 h+ r S
复制代码 中科大源:
' D/ D! u* b% p6 J l, i- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
$ v( m! \/ M7 R' b7 e/ l' \ - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse+ Q5 ]; k5 R8 J# u( C4 k" a
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 s( G3 C2 J: ?
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse+ @) F% L' W, T6 r" S
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse+ G1 T' R" {7 U' L7 Y6 A
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
% f2 r* l8 y. Y: i - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse6 e8 w- S! g @ I' l7 c2 M1 h0 S
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse, F( ^1 Z' V+ V4 d8 l5 m
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse9 m# M" e" x" \! u6 G3 y
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
, t. Z* ^+ [. X+ |0 i! `8 m; q- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
# I9 z5 f8 ?2 U3 }: G1 w - deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse& v2 @/ c y; z$ g# x0 G9 ^; g7 K" B
- deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
6 g L8 `# C9 n7 }" D - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
! _. X6 I' H) {' T& L3 f. d9 [8 N - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse+ v D: u9 ]) h6 E2 r) ? G" ?
- deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
) R/ d" e! J7 ^" ~ - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse/ w/ `0 }% u& j: j2 w H* ~" H; k
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse0 m6 X3 g: x4 C
- deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
+ ~( Y( ]( j( e# ?- _$ D - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
+ @" C, K. i% }- p9 K I完成后先关闭LXC,打印机插上USB8 `/ [. Z2 K, ^% u" T
PVE的Shell输入lsusb查询打印机
" ?; v5 G3 m& _3 G, ^- w- root@pve:~# lsusb8 x4 R3 q( E4 C( Z* {& d3 m2 T4 w6 b
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub" x) q% Z2 j6 |) D- r
- 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# v: b/ I4 X4 B$ F
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
- y5 v9 D! u7 E* A; m0 d% m+ E/ aPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定* ~4 J+ ?3 w+ ~# ]
0 }* w# U% W) \) W4 d" X
启动LXC安装 CUPS 软件及打印机驱动8 z/ }2 n& E2 {$ y) B
- apt install cups hplip -y
9 o1 B8 G( o( L7 m+ ^; s - systemctl enable cups+ X- G8 |9 s. U$ Z
- systemctl start cups
复制代码 编辑 CUPS 的配置文件# K9 p$ `# O9 O% Z
- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
7 @1 x( b0 ]# Z* \- u) c4 W D# Y0 A( O
- # Restrict access to the server...
. D+ f- A: L& J) Z - <Location />
8 z* }4 h4 @' Y' k3 M - Order allow,deny. q1 k$ t1 \/ \: F
- Allow all
' P) U4 }% n; E% N/ R4 Y1 d, c: V5 j - </Location>' }! e2 N+ B7 X7 T( R9 K' O
- " g d- p6 S* K+ L1 @4 F+ J
- # Restrict access to the admin pages...- ]3 f% C( b8 ^; Y( C* n" i
- <Location /admin>9 @; C' H( z; Q7 A* ]
- Order allow,deny
- @- ]& F& c. ? - Allow all
$ B* x" @3 |9 V! J* |- h' m - </Location>
9 S- t- b0 l/ P9 Z6 L2 [; A: E
; b* {/ s' d% u; x- e' Y8 L7 y- f- # Restrict access to configuration files...1 _( ?/ R# h1 }) d8 n
- <Location /admin/conf>6 L, f: P) x1 o6 ]
- AuthType Default
* u1 F/ F5 \- _) v - Require user @SYSTEM
) U# y8 ?# B1 C - Order allow,deny
+ G* x- V1 J/ S - Allow all* `$ s' y. Y5 T/ }
- </Location>
, u5 b0 e. @) e( h- y
& K( {' j/ U; }9 w8 n/ L% e/ a& h- # Restrict access to log files...
& {3 f7 F( i5 p/ G - <Location /admin/log>
]. b6 ~# s) k+ w - AuthType Default
4 S9 v: m3 G4 }2 v. n! ^& ] - Require user @SYSTEM
5 |, R: ? g6 M2 {0 o$ u1 m - Order allow,deny
* l. m( T6 ?5 @ - Allow all
1 H" _0 |0 ?1 T. s: T) F- P - </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
9 U. \0 S, N7 G# l- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
$ N7 |4 s; J0 H" S- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压/ `) J9 X, n# d4 }
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录0 D6 M/ k) g) m5 m
给个权限
6 l+ i6 W$ H7 V# @9 B6 X/ V! L M' D9 n. o$ l N
安装驱动* l8 b- u2 k& d! k7 o9 e8 k
一大段说明,慢慢按回车键,Y同意就行。$ D) H5 O& q; r+ [
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码5 T; _0 `: V- ~3 g1 G c8 @; n( F. D
添加打印机就行,驱动选择HP Laser MFP 13x Series7 x4 D* G6 N+ h
Ctrl+F搜索“13”容易找到。) n5 z# _9 \. U
设置好后,手机也可以打印了,不用下载APP- |$ Q8 F2 r/ M7 U: H. [' I7 i
电脑添加打印机是(举个例子)
: @2 K8 y& T" c2 ~ X( g- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
8 \/ @$ }. [! l( A+ Z- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |