理论上群辉应该也可以。
! b0 p6 ^& \3 r/ H, W7 L7 _% |' ^! f8 ?4 ]4 q: B$ Y' ~
我是用PVE的LXC模版。
+ D4 _, @$ ^ W \+ m; tPVE版本号:8.4
. `( |8 }$ h3 y1 k; O( a0 K9 D0 MLXC是Ubuntu 18.04.3 LTS
' o) Q9 o/ k+ `8 X因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
. ]& b. ]# {; e6 @( s/ t& w* w- B* d2 q每种版本对应的不一样,这个版本的换源是
/ x" x0 z. F' n* H/ n1 r9 t打开文档,注释掉原来的源
6 V( Y% h* j1 c# n& B; X- sudo vi /etc/apt/sources.list
复制代码 阿里云源:. T# n- J# b3 \# D& f8 l- K& { ^
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
8 D/ h% y& r+ S* q - deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse2 K% _" [5 s- a7 y; e6 |
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse8 ]% A: C9 N( U, O$ {
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse' L0 e; }! z6 C: h1 Y# ^
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
, |* f+ z. @" n J( N/ m% ~' ^# A8 H - deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" {2 u' q& {5 S
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
7 p8 a- z, x7 m - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
2 S J) T0 |% @3 J) L3 {7 i) C" z3 n - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse3 [6 ]+ k6 C$ d* X2 z- n' H
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:
" {4 ]2 l( K' ^; F# f' o- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# S2 v, j+ ^/ n$ v - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse3 g7 c' u( N$ j4 T" u* g
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# o$ Q$ @, a1 Y, L7 q - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse$ `2 P2 m/ b3 y" [# U
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
7 q( Z1 O7 c& y9 _+ Q - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# F( ]# f" u9 b" P! C3 n - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse; O$ |: I1 m1 X1 K+ d/ H# Z; t: o
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
$ t* T0 \* m1 v! t* o: V5 L: D' r - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse8 z8 n9 |' U' F
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# y P8 X/ O# _! P; \
复制代码 中科大源:
1 X" Q4 v0 E$ c6 ]; g8 X! \- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
. M [% C/ a" ^0 ^; f3 [% C - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
+ f. n" S1 z! U8 A: [ - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 {0 U/ [) B& Q* `9 `
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse5 @6 r( S# T+ F+ @0 z. d
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
8 x1 }2 [4 v/ S- A1 R - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse# Q' m$ Y. @" v& k) R1 u
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, B, m6 L; n* |% i/ E: f+ V
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse) Y/ Z% z, L g
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse; s$ ]- |+ Y, w! p& ~
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
) P1 Q+ f4 N! B. ?9 F) ?: I- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse$ P' V3 u- {% |& B
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
' P- T1 S. ?' ^ - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
; b! O2 ~4 j9 ] - deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
: h" Q$ w& ?; Z6 m; p - deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
4 m7 E* j/ I- T! O! X - deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
1 A/ _& _1 K) U" k8 }* `1 F" s - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
3 m- ]0 j' _+ o# U% \5 Z- p- w - deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
5 U) F/ s: ?% m# S - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
6 w5 @4 J& L0 {9 ^5 F8 N$ S. r2 X - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令: o: X# [& V; T8 l; r5 I* y' Y
完成后先关闭LXC,打印机插上USB
2 V& n% g8 k/ ]PVE的Shell输入lsusb查询打印机0 Z3 }0 D* W4 H- s: }
- root@pve:~# lsusb4 R( G5 K$ n6 {* I
- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
' I+ Y! @) U; N0 x4 ?" W; W - 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% w$ M c0 a; H. s4 y' w
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/0033 u- x' M% M* t! k
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定0 q7 o' y1 r: d- q) d- M3 d' Q) G3 Z
" z% V0 G/ _: c5 X: o; N
启动LXC安装 CUPS 软件及打印机驱动
5 Z% ]( Y- g; i0 h0 }# s- apt install cups hplip -y9 ]# S9 k' b- Q3 [0 {% S' ~# @
- systemctl enable cups
2 L, w( m2 M( y4 {' m - systemctl start cups
复制代码 编辑 CUPS 的配置文件
! m( N3 l+ N0 p$ P0 l- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改: B r7 N+ r3 [* w! `- H5 F( c- R
7 P8 U# [$ S2 I9 e
- # Restrict access to the server...: W. T. b+ t Z
- <Location />: _/ u1 O) z) Y: H5 t
- Order allow,deny
9 q4 A5 w5 {+ u - Allow all
3 o$ j- w% B/ q" t* R5 t! w# R - </Location> a! r4 x5 {& P5 z, M! K
& X G' G5 t. ]" ?- # Restrict access to the admin pages...
6 B$ {5 t9 Y" v) P$ T- C - <Location /admin>
& O' v+ C* h R9 Z6 ^' W - Order allow,deny
; ~ u* o; W5 m$ O% }; m/ w - Allow all" r4 b1 m, e1 m" \" V
- </Location>" L% _& F! Z5 s1 Y" y! k
: w* |4 n) p- v: y, Y- # Restrict access to configuration files...
) W, i% b1 }; d1 p - <Location /admin/conf>
3 J* p" l6 a4 F3 V: A7 Q. `1 n - AuthType Default
9 @" L' M1 S- @( r7 G/ y; m) | - Require user @SYSTEM
z, }) ^5 j$ E( g" _# d) g. s - Order allow,deny
- l# K7 z; x( z1 I/ R" R, | - Allow all7 b) N! \, u4 h2 E- w
- </Location>* l& ?1 N# t* L# N: ~: c
# k7 @& x5 s- e" S7 X2 z$ I( d- # Restrict access to log files...
% y! g9 h" X) |( W2 ^ - <Location /admin/log>) t) U' F7 a7 g) T% B) i+ b
- AuthType Default+ s0 ~* H' L, z4 P* F0 {. }# n* I
- Require user @SYSTEM
" E% p. F, b8 ?" P( z - Order allow,deny
0 e7 B- o9 f- K! y - Allow all
. k7 v9 R! e9 s0 n - </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS7 i# M/ O, {$ L! T5 D
- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动. j' h2 Q& ~5 n0 d: A+ u
- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压 V" I: H7 [" F: ^! W
- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
6 C. v; @/ }$ Q# U# |( V给个权限. q4 L+ u+ t8 ^( l1 m
2 T+ I3 T+ T4 |
安装驱动
! Q& h6 [5 q* C" b0 z6 R9 D* S一大段说明,慢慢按回车键,Y同意就行。
5 {* ~! _5 ^" D \) I6 _+ a2 o* I安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
9 g3 O3 L7 A# f K添加打印机就行,驱动选择HP Laser MFP 13x Series [+ p& d* p+ I& ?4 F! p
Ctrl+F搜索“13”容易找到。
x7 {7 C" M7 y q设置好后,手机也可以打印了,不用下载APP4 @9 t+ g6 J+ ^- _ Z
电脑添加打印机是(举个例子)
2 n b) `' m. L) E% L+ E; [- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的# L: ^% T" V- H) Z; E; F/ A) Z5 Q
- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |