给ProxmoxVE (PVE)的网络模型添加E1000e网卡,让你的DSM支持最新版本

/ 0评 / 1

前面介绍过一个PVE下给群晖添加E1000e网卡的教程:《在ProxmoxVE (PVE)系统下给群晖添加E1000e网卡,让它支持DSM最新版本》,但是这个方法仅对某个虚拟机而已。今天介绍另外一种方法,把E1000e网卡添加到PVE系统里面,这样在新增虚拟机的时候,就可以直接选择。

本教程在PVE6.09下测试通过,其他的PVE版本请自行测试。需要注意的是:修改有风险,修改前请自觉做好文件备份!

具体操作如下:

一、电脑打开WinSCP,以root用户登录PVE,找到 /usr/share/perl5/PVE 目录下的 QemuServer.pm 文件,用Notepad++编辑,大约在837行找到这行内容:

 

把原内容:

<span class="hljs-attribute">my</span> <span class="hljs-variable">$nic_model_list</span> = [<span class="hljs-string">'rtl8139'</span>, <span class="hljs-string">'ne2k_pci'</span>, <span class="hljs-string">'e1000'</span>, <span class="hljs-string">'pcnet'</span>, <span class="hljs-string">'virtio'</span>,<span class="hljs-string">'ne2k_isa'</span>, <span class="hljs-string">'i82551'</span>, <span class="hljs-string">'i82557b'</span>, <span class="hljs-string">'i82559er'</span>, <span class="hljs-string">'vmxnet3'</span>,<span class="hljs-string">'e1000-82540em'</span>, <span class="hljs-string">'e1000-82544gc'</span>, <span class="hljs-string">'e1000-82545em'</span>];

改成:

<span class="hljs-attribute">my</span> <span class="hljs-variable">$nic_model_list</span> = [<span class="hljs-string">'rtl8139'</span>, <span class="hljs-string">'ne2k_pci'</span>, <span class="hljs-string">'e1000'</span>, <span class="hljs-string">'e1000e'</span>, <span class="hljs-string">'pcnet'</span>, <span class="hljs-string">'virtio'</span>,<span class="hljs-string">'ne2k_isa'</span>, <span class="hljs-string">'i82551'</span>, <span class="hljs-string">'i82557b'</span>, <span class="hljs-string">'i82559er'</span>, <span class="hljs-string">'vmxnet3'</span>,<span class="hljs-string">'e1000-82540em'</span>, <span class="hljs-string">'e1000-82544gc'</span>, <span class="hljs-string">'e1000-82545em'</span>];

确认一下修改无误后保存退出;

 

二、找到 /usr/share/pve-manager/js 目录下的 pvemanagerlib.js 文件,用Notepad++编辑,大约在1813行找到这行内容:

 

把原内容:

<span class="hljs-keyword">if</span> ((match_res = p.match(/^(ne2k_pci|e1000|e1000-82540em|e1000-82544gc|e1000-82545em|vmxnet3|rtl8139|pcnet|virtio|ne2k_isa|i82551|i82557b|i82559er)(=([0-9a<span class="hljs-_">-f</span>]{2}(:[0-9a<span class="hljs-_">-f</span>]{2}){5}))?$/i)) !== null) {

改成:

<span class="hljs-keyword">if</span> ((match_res = p.match(/^(ne2k_pci|e1000|e1000e|e1000-82540em|e1000-82544gc|e1000-82545em|vmxnet3|rtl8139|pcnet|virtio|ne2k_isa|i82551|i82557b|i82559er)(=([0-9a<span class="hljs-_">-f</span>]{2}(:[0-9a<span class="hljs-_">-f</span>]{2}){5}))?$/i)) !== null) {

确认一下修改无误后保存退出;

 

三、在当前文件向下拉,大约在4555行处找到这些内容:

把原内容:

[<span class="hljs-string">'e1000'</span>, <span class="hljs-string">'Intel E1000'</span>],
[<span class="hljs-string">'virtio'</span>, <span class="hljs-string">'VirtIO ('</span> + gettext(<span class="hljs-string">'paravirtualized'</span>) + <span class="hljs-string">')'</span>],
[<span class="hljs-string">'rtl8139'</span>, <span class="hljs-string">'Realtek RTL8139'</span>],
[<span class="hljs-string">'vmxnet3'</span>, <span class="hljs-string">'VMware vmxnet3'</span>]
]

改成:

[<span class="hljs-string">'e1000'</span>, <span class="hljs-string">'Intel E1000'</span>],
[<span class="hljs-string">'e1000e'</span>, <span class="hljs-string">'Intel E1000e'</span>],
[<span class="hljs-string">'virtio'</span>, <span class="hljs-string">'VirtIO ('</span> + gettext(<span class="hljs-string">'paravirtualized'</span>) + <span class="hljs-string">')'</span>],
[<span class="hljs-string">'rtl8139'</span>, <span class="hljs-string">'Realtek RTL8139'</span>],
[<span class="hljs-string">'vmxnet3'</span>, <span class="hljs-string">'VMware vmxnet3'</span>]
]

确认一下修改无误后保存退出;

 

四、关掉WinSCP,回到PVE管理界面,关掉所有的虚拟主机,重启PVE;

 

五、宿主机重启完成以后重新登录PVE,这时我们去新建一个PVE的虚拟机,配置到网络模型的时候,就会发现比之前多出“E1000e”这个网卡,能不能好好的把DSM升级到最新版本就看大家了。

发表评论