理论上群辉应该也可以。
8 ~: R4 b7 O2 j0 `$ y
' \5 q8 O: K8 J我是用PVE的LXC模版。
7 o: ^8 i% P0 vPVE版本号:8.4
) l& h; B5 i+ b8 @$ CLXC是Ubuntu 18.04.3 LTS
8 j$ T* d# K6 ?/ X- X( b. t( U因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
3 J4 w0 Q% t/ P2 v4 T4 }" ?每种版本对应的不一样,这个版本的换源是
) W! y% k0 O8 q) B, B打开文档,注释掉原来的源
8 ~5 `7 @0 J, o! b2 N6 Z# |1 T4 Y- sudo vi /etc/apt/sources.list
复制代码 阿里云源:
2 x2 y! v( c3 E' x$ @, x- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse; e/ G5 n3 M0 N6 _4 ~$ b Y _
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
) R# A8 b4 J. n' b' h - deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse' |) L6 \; K3 V5 F8 D
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
. I) d( |! u: c! Y - deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse( F' z3 R R6 a$ i8 a# D. Y6 T
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse) w- f4 f& \* W' m# Z' l, n% r
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse) b$ [7 E9 M6 ^7 `
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
9 U2 ~* ^8 U/ M, @! o! R - deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse- {& e; M' \: v
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 清华源:7 ~ O H$ J5 ?7 z n9 w1 x2 g
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse* m/ D+ u0 i( d- ~; c6 V9 Y
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse% \9 c+ D$ ~; D" H) Y# o
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse+ Z v+ ?/ U2 A1 A
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
, j! r2 V; N/ E* Y4 m - deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse: i3 ^2 O0 v% a. @( U
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
1 y, j% ~! f9 D7 o: m: z- a - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse/ `3 G* ~$ b7 F$ t* P4 j# @
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
0 Z9 v2 @# H5 O - deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse, T7 H# \* S) i' E/ ?, X K4 p
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
" R7 ^- C. X1 |: c: M0 A3 A
复制代码 中科大源:: e. P6 X% @3 `
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse/ _- c0 g" }6 v* D
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, r2 n6 x A& l# P6 ]6 t- ]
- deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
; n. W$ y. _& Y) i" h- l - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
9 a" ]2 V6 `* H5 U; R. n) l6 v - deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse3 W& m, }: a3 T, ^; W! C
- deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
. k$ ]! ]; s6 q; W5 w* j3 B5 ~ - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
, ]. l8 Q% t; c - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
' I$ \6 M$ D- W# j - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
- E( T: |" I$ f Z5 } - deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码 163源:
& _- |" v5 {2 `) X( u' q& `- deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse8 J! F7 u$ b1 D8 [& c
- deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
4 L. X q0 V) S# K, O' J0 Z$ g - deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse' D# A: S' t: w: U
- deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse5 y, j0 a- E A* f
- deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
* Q9 h& S2 q8 x1 c! M - deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
% x( ]9 w1 R& R - deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse* s1 r' F* K t D
- deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
6 E* f( b; @! _% J - deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
( T4 v9 Z4 t# M% \' Q6 n( k+ _ - deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码 更改完成之后执行以下命令
/ @: l$ K0 N6 r5 y5 M完成后先关闭LXC,打印机插上USB9 r$ Y7 ^/ d" ]: w
PVE的Shell输入lsusb查询打印机
* O+ O9 `2 N- S( s2 c- root@pve:~# lsusb
( Q3 A, c. Z% @, ~/ _* p - Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub+ f5 S$ `: T2 n H8 Y7 S5 C
- Bus <font color="#ff0000">001</font> Device <font color="#ff0000">003</font>: ID 03f0:f22a <font color="#ff0000">HP</font>, Inc HP Laser MFP 136a2 c# E$ D( ^: J- E) s: K
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码 Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003. W, y9 S) b( x" u, y6 S
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
0 k- X9 T5 p5 Q# p a" i! ]4 r4 J" [9 Y5 |
启动LXC安装 CUPS 软件及打印机驱动* y1 x2 I: p# v1 k7 K3 K
- apt install cups hplip -y0 n2 y9 h8 P' w! C
- systemctl enable cups+ o6 w" h1 o7 @7 n8 a( s
- systemctl start cups
复制代码 编辑 CUPS 的配置文件
+ T, l4 M4 Z7 U- nano /etc/cups/cupsd.conf
复制代码 其他项按照以下修改
3 {0 h; _3 D0 J" U1 _
- }4 M1 R c5 e8 `- # Restrict access to the server...
5 y0 D4 g% K9 A - <Location />- r6 F( a5 D2 ~+ m
- Order allow,deny
+ y* S4 n- A6 Z \4 B( _+ o1 s - Allow all' N: S) L( q7 o
- </Location> |: Y) `+ R$ r- x
- 2 i7 q! `& {1 t$ W, L/ D$ M
- # Restrict access to the admin pages...- M) n: O# p7 {: Y) o
- <Location /admin>3 b w% u/ r0 u! U" H$ K+ B9 b
- Order allow,deny
5 x& }# B9 E$ w! M- l3 L - Allow all
4 [6 O. \1 m, _* f- i5 U: t* | - </Location>
% m; L" o/ u% W, d - 2 U! g# }! ]1 R) q% u L
- # Restrict access to configuration files...% F0 c$ b) L) W H$ U5 {* s
- <Location /admin/conf>/ x& q V) r H3 u3 Z, s3 \! t/ L
- AuthType Default9 F B1 p3 J; g. Q7 E1 p7 W
- Require user @SYSTEM
, H3 x& {( Z& w; _8 `' i - Order allow,deny2 a0 a8 F! v6 U9 Z2 `8 [' f
- Allow all ?# v9 X% \! M) ~6 B
- </Location>1 w; n/ |% }5 d) g1 R! h
2 Z1 V0 \+ w6 c4 F- # Restrict access to log files...
6 C2 ^% ~9 o; K: n$ L% H - <Location /admin/log>% a+ K- s. J1 b" K" u! R; z% ?8 g
- AuthType Default
% @* e+ z$ a, x - Require user @SYSTEM
/ [8 Y# U' q) m# F; x5 ` - Order allow,deny
$ v$ d' B) P/ I/ `" z5 D4 b - Allow all! u0 Y0 c4 X$ m
- </Location>
复制代码 修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
' D. _9 `& G/ `" h7 s, \- sudo service cups restart
复制代码 下载惠普HP136a LINUX驱动
* I' l, y& P1 `1 B7 m+ {6 w- wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 解压
' N; J% o' s3 j) Z% |: @7 {- tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码 进入安装目录
+ x) y# T! j. Q! c' }+ h给个权限
4 }# m! [/ f7 L; N$ ~& V6 Z
H# X; F7 X2 k/ Y" [安装驱动
. _* `$ |$ B" ~% c, n3 x% h" e一大段说明,慢慢按回车键,Y同意就行。1 `2 a: x+ x! a6 j2 t- X n
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
1 V7 C9 g8 z0 g- n0 @- e. v添加打印机就行,驱动选择HP Laser MFP 13x Series& H, Y! B5 d8 s1 Y& F9 O$ {
Ctrl+F搜索“13”容易找到。
$ A4 Z8 s3 @) `8 C- V. {设置好后,手机也可以打印了,不用下载APP
8 V$ d4 W' x" i% o; r电脑添加打印机是(举个例子)
8 I- y" C! D! D$ M+ m- https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机添加打印机是(举个例子),不带http的
$ A4 n9 D+ Z" f+ z- 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码 手机相册里可以直接打印了。 |