理论上群辉应该也可以。
3 T$ Y% }/ `$ h/ H3 d3 n4 u5 i$ y! A" d( {/ r& p Y B& {7 W
我是用PVE的LXC模版。* T# g$ _8 [) i0 g- u
PVE版本号:8.4
1 g7 E) k8 C4 h0 O+ T# {8 M4 D7 P1 VLXC是Ubuntu 18.04.3 LTS6 M4 B6 s' \- U, a
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
0 B6 H8 h) |% G2 H/ v每种版本对应的不一样,这个版本的换源是# y# s, J% b3 X7 `4 S
打开文档,注释掉原来的源
6 I0 Z4 H, g* I8 C. Z0 L, q0 E- sudo vi /etc/apt/sources.list
复制代码 阿里云源:8 R0 H: z6 ]+ D# [( p
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
3 b! u- d3 K$ V h* r, t. ] - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
1 V7 Y) y' [4 r# g. F6 ~ - deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse+ f5 f7 N( ^6 y& `9 e
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
0 \. g8 k. Q+ D$ b - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
" N8 g( @7 k0 E; L - deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
/ n1 d! U8 l* d& `2 H8 u - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
' s$ D& t; }$ h! _8 s9 t - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
4 b" Y- d: r3 x7 O8 A0 P - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
6 l3 R8 |3 y7 S3 ]" T - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:
, e; h) j& H- w: P5 D- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse7 u! `. n5 [* Y1 @
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
! E1 [9 D* x" X# U7 O8 c# w - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
3 [! A$ V2 [/ e/ k' b1 o - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
8 s# z! \7 _0 S3 k3 e" v3 {* M( _ - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
k r, n4 p7 X S: j - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse1 P' P4 L! e7 t
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse. W# }3 C" a5 G6 |
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
1 ], ?1 ` \$ b0 Z - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
2 D4 I& H/ p) o# A$ @4 d. w! T7 g - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
/ A1 N& U! E% `! x' i' h
复制代码 中科大源: X0 ?# N1 z7 T$ [; j+ c
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse/ W1 j y; Y2 h& i1 K( ~8 Z0 O6 X
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse. s. h# s; m/ J
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
4 A4 H0 D' [2 l& r, f - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
- W7 t3 I2 n u, U7 }3 Z$ ]$ O1 ] - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse+ y) l$ I3 ?" m/ j1 F: l
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse1 t+ W2 c6 h! ]& f$ B2 r/ m
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
" I/ R5 z+ o9 D" X1 | - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 b* B. s4 {* ?# a/ |0 L
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
0 D4 x2 X |# D! `" L - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:0 O2 z0 z4 m7 L8 c [
- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
- t* W% Z' h2 x, R% \( `$ o - deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
# Q. \, |, G( f& M) o* Y - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
4 P; w/ A3 d& E& K - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse6 s4 L& _7 g/ v" ?3 `
- deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
3 U! |7 g& _: H4 p+ B( M/ b - deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
5 c; L& y6 W, u8 ]% S. M - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse! n% Q6 X5 }( a+ l) u; I" E; Y
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse f7 m5 n2 K' |/ C4 F5 v' W
- deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse8 J! \7 s) X4 H3 H3 S7 {# T0 A# z: j
- deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
# Z/ Z q7 K+ H2 ?8 o0 c& ?完成后先关闭LXC,打印机插上USB
# U( z- f2 \, X: Z5 D& _# W" PPVE的Shell输入lsusb查询打印机. j5 o$ F. ? y8 ]7 ~9 b
- root@pve:~# lsusb
J5 l% G* p8 j, T - Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
. P' L3 {, v, z" O - 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% Z# V2 P4 [0 ^1 c3 M
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
\7 U, \3 r, {9 l2 xPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
' G: w8 K, L' E: C3 m
+ z+ {5 u+ \+ ?& @启动LXC安装 CUPS 软件及打印机驱动
6 f1 Y8 a0 _! Y! p4 l5 P. I- apt install cups hplip -y4 a# D. L# U- s. A1 e% N
- systemctl enable cups4 j/ O9 I+ ~ l- x% Y
- systemctl start cups
复制代码 编辑 CUPS 的配置文件1 a3 o/ u# {) d7 l; K7 q
- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
6 K& t! f6 r6 j/ k, s% H5 ^4 c$ O, t# P$ Y& a2 F, M% s
- # Restrict access to the server...
! H) J9 ~* S/ j) J, ? - <Location />' C v( k' ]$ M; j2 P! O
- Order allow,deny
. g" w, A8 Y r - Allow all
: d6 u% m. {4 P9 H0 } - </Location># u% v% d+ A6 g- O4 l
# s% g+ C% _5 L5 Y" h6 E1 w! s- # Restrict access to the admin pages...1 @# a* X+ v) B0 _' Z
- <Location /admin>2 n' |1 k5 [0 g6 z8 Y3 x
- Order allow,deny/ r! w# |6 u5 _& c" [( C' m
- Allow all
+ b! c: [, F; u% k6 D$ }6 w' p# H - </Location>
7 L' A9 v ?- d' a) H8 {- |. \3 V5 V
& n+ p. _) [: N' V$ D' Z' D3 ~- # Restrict access to configuration files...; Z8 F) o! r& u0 [& R! k
- <Location /admin/conf>5 |4 q0 q, a2 D/ @
- AuthType Default) c* u( z5 K* W' c* R+ ?, O* d
- Require user @SYSTEM
5 {# w7 v% f/ r* X( E. e! J- G - Order allow,deny+ A+ n8 b+ C0 w* y. e. ]
- Allow all
9 D+ |- b6 h" a: }( ]9 {( N# q - </Location>7 \' k; z1 j) }4 l( M
- ! q5 [5 A* i- p7 w' v6 A
- # Restrict access to log files...+ I) t9 c& j5 A& Q' F& h0 z3 G
- <Location /admin/log>- l: h- }2 M0 Y/ [" Q* R
- AuthType Default
" z4 ~6 G9 k/ C, K( Y - Require user @SYSTEM5 u& T, x- U% w
- Order allow,deny# H4 Z9 F+ C3 C
- Allow all% {, {* [0 C9 L/ ^! r
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
: A4 B3 u4 \* C8 X3 f. `+ y" u. ~- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动. c# B( ^1 H G+ z+ q: u4 C3 W# g
- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压# g0 H& }) X; y. N! V/ Q, r
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录0 v5 s. P$ c0 A) J6 g. x2 \
给个权限& q* S9 \6 O/ P
$ V' V& ?5 n& s
安装驱动/ c& M, r& Y' c
一大段说明,慢慢按回车键,Y同意就行。
7 w q ?6 _/ I# M1 n安装好后打开CUPS界面,账号root,密码就是lxc设置的密码! z( u2 x+ T I
添加打印机就行,驱动选择HP Laser MFP 13x Series
4 l3 r; R: G7 x T, ~+ z/ u" eCtrl+F搜索“13”容易找到。3 u* r% D8 p( z
设置好后,手机也可以打印了,不用下载APP
8 O# y: q2 h2 r, \8 U电脑添加打印机是(举个例子); A2 t) R3 p A; \$ _
- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
^8 U k* x9 T- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |