每当我运行任何类型的虚拟化软件时,Ubuntu 20.04 都会冻结。它会运行良好,然后突然主机就冻结了。什么都无法使用——键盘、鼠标。视频停止播放,音频只是不断循环播放最后说的一句话。我已经等了 5 分钟,它却再也没有恢复。
我尝试过 VirtualBox、VMWare 甚至 GNOME Boxes,结果都一样。
我正在运行 Nvidia GEforce GTX 1060 3GB。
我从日志中找到了这些内容:
11:16:55 AM systemd-udevd: /etc/udev/rules.d/60-brother-libsane-type1-inst.rules:14 Invalid key 'SYSFS'
11:16:55 AM kernel: Initramfs unpacking failed: Decoding failed
已更新更多信息请求
free -h
输出 - 我现在不运行虚拟机,因为我不想崩溃:
total used free shared buff/cache available
Mem: 15Gi 1.6Gi 11Gi 72Mi 2.6Gi 13Gi
Swap: 18Gi 0B 18Gi
$ sysctl vm.swappiness
vm.swappiness = 60
我为客户机分配了 8 GB 的 RAM 和 4 个 CPU。我在同一个系统上的 Windows 上进行了相同的设置(双启动),运行顺畅。
$ sudo dmidecode -s bios-version
F.25
$ neofetch
OS: Ubuntu 20.04 LTS x86_64
Host: OMEN by HP Obelisk Desktop 875
Kernel: 5.4.0-33-generic
Packages: 2352 (dpkg), 12 (snap)
Shell: bash 5.0.16
Resolution: 1680x1050, 1680x1050
GNOME
Mutter
WM Theme: Adwaita
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: Intel i7-8700 (12) @ 4.600GHz
GPU: NVIDIA GeForce GTX 1060 3GB
Memory: 1766MiB / 15891MiB
$ sudo grep -i swap /etc/fstab
# swap was on /dev/sdb1 during installation
UUID=ce9111f7-159f-4b0f-a64e-dab27666db50 none swap sw 0 0
NVIDIA 信息:
$ dpkg -l \*nvidia\* | grep ii
ii libnvidia-cfg1-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-440 440.82+really.440.64-0ubuntu6 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA libcompute package
ii libnvidia-compute-440:i386 440.82+really.440.64-0ubuntu6 i386 NVIDIA libcompute package
ii libnvidia-decode-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-440:i386 440.82+really.440.64-0ubuntu6 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-440:i386 440.82+really.440.64-0ubuntu6 i386 NVENC Video Encoding runtime library
ii libnvidia-extra-440:amd64 440.82+really.440.64-0ubuntu6 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-440:i386 440.82+really.440.64-0ubuntu6 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-gl-440:i386 440.82+really.440.64-0ubuntu6 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-440:amd64 440.82+really.440.64-0ubuntu6 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii libnvidia-ifr1-440:i386 440.82+really.440.64-0ubuntu6 i386 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA compute utilities
ii nvidia-dkms-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA DKMS package
ii nvidia-driver-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-440 440.82+really.440.64-0ubuntu6 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.14 all Tools to enable NVIDIA's Prime
ii nvidia-settings 440.64-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA driver support binaries
ii xserver-xorg-video-nvidia-440 440.82+really.440.64-0ubuntu6 amd64 NVIDIA binary Xorg driver
$ sudo lshw -C memory
*-firmware
description: BIOS
vendor: AMI
physical id: 0
version: F.25
date: 11/19/2019
size: 64KiB
capacity: 16MiB
capabilities: pci pnp upgrade shadowing cdboot bootselect edd int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification netboot uefi
*-memory
description: System Memory
physical id: 3c
slot: System board or motherboard
size: 16GiB
*-bank:0
description: DIMM DDR4 Synchronous 2666 MHz (0.4 ns)
product: HP26D4U6D8ME-16X
vendor: Kingston
physical id: 0
serial: EF02EDAB
slot: ChannelA-DIMM0
size: 16GiB
width: 64 bits
clock: 2666MHz (0.4ns)
*-bank:1
description: DIMM [empty]
physical id: 1
slot: ChannelB-DIMM0
*-cache:0
description: L1 cache
physical id: 46
slot: L1 Cache
size: 384KiB
capacity: 384KiB
capabilities: synchronous internal write-back unified
configuration: level=1
*-cache:1
description: L2 cache
physical id: 47
slot: L2 Cache
size: 1536KiB
capacity: 1536KiB
capabilities: synchronous internal write-back unified
configuration: level=2
*-cache:2
description: L3 cache
physical id: 48
slot: L3 Cache
size: 12MiB
capacity: 12MiB
capabilities: synchronous internal write-back unified
configuration: level=3
*-memory UNCLAIMED
description: RAM memory
product: Cannon Lake PCH Shared SRAM
vendor: Intel Corporation
physical id: 14.2
bus info: pci@0000:00:14.2
version: 10
width: 64 bits
clock: 33MHz (30.3ns)
capabilities: pm cap_list
configuration: latency=0
resources: memory:a3516000-a3517fff memory:a351f000-a351ffff
$ dpkg -l *virtualbox*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============================-=========================-============-=====================================================
rc virtualbox 6.1.6-dfsg-1 amd64 x86 virtualization solution - base binaries
un virtualbox-2.0 <none> <none> (no description available)
un virtualbox-2.1 <none> <none> (no description available)
un virtualbox-2.2 <none> <none> (no description available)
un virtualbox-3.0 <none> <none> (no description available)
un virtualbox-3.1 <none> <none> (no description available)
un virtualbox-3.2 <none> <none> (no description available)
un virtualbox-4.0 <none> <none> (no description available)
un virtualbox-4.1 <none> <none> (no description available)
un virtualbox-4.2 <none> <none> (no description available)
un virtualbox-4.3 <none> <none> (no description available)
un virtualbox-5.0 <none> <none> (no description available)
un virtualbox-5.1 <none> <none> (no description available)
un virtualbox-5.2 <none> <none> (no description available)
un virtualbox-6.0 <none> <none> (no description available)
ii virtualbox-6.1 6.1.10-138449~Ubuntu~eoan amd64 Oracle VM VirtualBox
un virtualbox-dkms <none> <none> (no description available)
un virtualbox-guest-additions-iso <none> <none> (no description available)
un virtualbox-guest-dkms <none> <none> (no description available)
un virtualbox-guest-modules <none> <none> (no description available)
un virtualbox-modules <none> <none> (no description available)
un virtualbox-ose <none> <none> (no description available)
rc virtualbox-qt 6.1.6-dfsg-1 amd64 x86 virtualization solution - Qt based user interface
un virtualbox-source <none> <none> (no description available)
答案1
BIOS
HP OMEN Obelisk 台式机 875
您有 BIOS F.25。
有较新的 BIOS 可用,即 F.51,可以下载这里。看这里。
笔记:请确认我拥有适合您型号变化的正确网页。
笔记:更新 BIOS 之前请做好备份。
初始化系统映像
对于该Initramfs unpacking failed: Decoding failed
消息,请使用 重建您的 ramdisk sudo update-initramfs -c -k $(uname -r)
。
在命令之前和之后在 /boot 中查找 initrd.img 文件,并注意文件大小是否发生变化。
虚拟机
虚拟机的 RAM 和 CPU 设置过高。请将其设置为 RAM=2048 和 CPU=2。
交换
对于 16 RAM 主机 RAM,除非您正在休眠,否则不需要 18G 交换。将其缩小到 4G 就可以了。
查看 /etc/fstab 时,它显示您正在使用交换分区。要减小交换大小,您必须编辑分区大小并重新初始化交换。
可能更容易改为使用 /swapfile,并删除当前交换分区。
笔记:命令使用不当dd
可能导致数据丢失。建议复制/粘贴。
sudo swapoff -a # turn off swap
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile # set proper file protections
sudo mkswap /swapfile # init /swapfile
sudo swapon /swapfile # turn on swap
free -h # confirm 16G RAM and 4G swap
在 /etc/fstab 中更改此行...
从:
UUID=ce9111f7-159f-4b0f-a64e-dab27666db50 none swap sw 0 0
对此:
/swapfile none swap sw 0 0
然后重新启动并验证是否正常运行。