3

在 Proxmox VE(PVE)安装最新微码(microcode),改善 N5105 虚拟机死机问题

 7 months ago
source link: https://cyrusyip.org/zh-cn/post/2023/09/20/install-microcode-on-proxmox/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

在 Proxmox VE(PVE)安装最新微码(microcode),改善 N5105 虚拟机死机问题

2023-09-20 约 902 字 预计阅读 2 分钟

本教程介绍用 apt 命令安装最新版微码(microcode)的方法。为了避免弄坏系统,请勿从 unstable 软件仓库安装微码以外的软件包。本教程测试于 Proxmox VE 7.4 / 8.0.2。

微码是修复中央处理器(CPU)的固件。它在开机时被使用,应该装在宿主机(host),不要装在虚拟机(virtual machine)。Proxmox (Debian stable)仓库的微码可能是过时的,所以要从 Debian unstable 仓库安装。

添加 unstable 仓库,只使用 non-free-firmware 组件。

echo "deb http://deb.debian.org/debian/ unstable non-free-firmware" > /etc/apt/sources.list.d/debian-unstable.list

创建 /etc/apt/preferences.d/unstable-repo 配置文件,添加以下内容,防止从 unstable 仓库安装其他软件包。

# 降低所有 unstable 仓库软件包的优先级
Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 10

# 允许从 unstable 仓库升级微码
Package: intel-microcode
Pin: release o=Debian,a=unstable
Pin-Priority: 500
# 此行应该是空行或者注释
Package: amd64-microcode
Pin: release o=Debian,a=unstable
Pin-Priority: 500

更新仓库,确保没有软件包从 unstable 仓库升级。

apt update && apt list --upgradable

根据处理器厂商安装微码软件包。

# Intel 处理器
apt install intel-microcode
# AMD 处理器
apt install amd64-microcode

重启 Proxmox。

reboot

核实微码加载情况。

journalctl -k --grep="microcode updated early to"

看到和下面类似的输出信息就对了。

Sep 10 11:38:55 pve kernel: microcode: microcode updated early to revision 0x24000024, date = 2022-09-02

此处的 2022-09-02 和微码软件包版本不对应,它表示 Intel 上次更新本机处理器(N5105)的日期。

其他安装方法

如果你不想添加 unstable 仓库,可以直接从 Debian 网站下载微码软件包。根据处理器厂商,从 amd64-microcode 或者 intel-microcode 获取最新的下载链接,使用 wget '链接' 命令下载,apt install ./文件名.deb 命令安装。

# AMD 处理器
wget 'http://ftp.us.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/amd64-microcode_3.20230808.1.1_amd64.deb/DontCopyThisLinkVerbatim'
apt install ./amd64-microcode_3.20230808.1.1_amd64.deb

# Intel 处理器
wget 'http://ftp.us.debian.org/debian/pool/non-free-firmware/i/intel-microcode/intel-microcode_3.20230808.1_amd64.deb/DontCopyThisLinkVerbatim'
apt install ./intel-microcode_3.20230808.1_amd64.deb

移除微码软件包和 unstable 仓库:

# 移除微码软件包
apt purge amd64-microcode intel-microcode
apt autoremove
# 确保没有从 unstable 仓库安装软件
apt list --installed | grep '/unstable'
# 移除 unstable 仓库与配置文件
rm /etc/apt/sources.list.d/debian-unstable.list /etc/apt/preferences.d/unstable-repo
# 重启
reboot
# 检查微码,此时应该看到 No entries
journalctl -k --grep="microcode updated early to"

我在零刻 EQ591 N5105 迷你主机安装了 Proxmox VE。一开始用得挺开心的,但部分虚拟机时不时死机,搞的我很烦。我发现很多 N5105 处理器的用户也有一样的问题,其中一个解决方法是安装微码,于是我就装上最新的微码。虽然微码没有完全解决问题,但确实大大减少了死机的情况。除此之外,我还安装了 Proxmox VE No-Subscription 仓库里最新的内核。


  1. 零刻 EQ59 N5105 对应的海外型号是 Beelink U59 N5105. ↩︎


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK