几天前,我安装了 Oracle VM VirtualBox Manager 并添加了 Ubuntu 22.04 VM。我是 Ubuntu 新手,目前我遇到的问题是启动 Ubuntu 需要将近 5 分钟。
我为虚拟机提供了 16MB 的 RAM、12 个 CPU 核心和 16MB 的视频内存,因此我认为问题不是内存不足。我的笔记本电脑也是新的,因此在这方面没有问题。我查看了这里的其他问题,但似乎都没有解决我自己的问题。下面,我提供了有关该问题的所有我能找到的信息:
我使用的是联想 Thinkpad X1 Gen 10,其配置如下系统规格:
处理器 第 12 代 Intel(R) Core(TM) i7-1270P 2.20 GHz
安装 RAM 32.0 GB(31.7 GB 可用)
系统类型 64 位操作系统,基于 x64 的处理器
登录自sudo systemd-analyze
:
Startup finished in 28.543s (kernel) + 4min 12.340s (userspace) = 4min 40.883s
graphical.target reached after 4min 11.918s in userspace
登录自sudo systemd-analyze blame
:
3min 38.930s plymouth-quit-wait.service
1min 18.298s snapd.service
1min 5.788s vboxadd.service
32.317s udisks2.service
31.605s networkd-dispatcher.service
29.849s accounts-daemon.service
20.852s ModemManager.service
20.214s NetworkManager-wait-online.service
18.067s snapd.seeded.service
17.132s cups.service
13.753s NetworkManager.service
12.332s power-profiles-daemon.service
11.085s gdm.service
10.839s polkit.service
10.699s upower.service
10.270s e2scrub_reap.service
8.551s avahi-daemon.service
8.297s switcheroo-control.service
7.858s systemd-logind.service
7.791s wpa_supplicant.service
7.391s dev-sda3.device
7.091s dev-loop5.device
6.514s vboxadd-service.service
5.915s dev-loop10.device
5.877s dev-loop9.device
5.832s dev-loop8.device
5.212s dev-loop6.device
5.180s dev-loop4.device
5.064s dev-loop11.device
4.964s dev-loop3.device
4.961s dev-loop7.device
4.899s systemd-modules-load.service
4.698s dev-loop1.device
4.586s systemd-sysctl.service
4.449s dev-loop2.device
3.983s packagekit.service
3.526s dev-loop0.device
2.777s snapd.apparmor.service
2.491s grub-common.service
2.485s [email protected]
2.483s modprobe@pstore_blk.service
从cat /etc/fstab
:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda3 during installation
UUID=5ad09f57-44c7-41d2-bd5c-3488ad58dba0 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=A505-32D9 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
登录自sudo systemd-analyze critical-chain
:
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @4min 11.918s
└─multi-user.target @4min 11.918s
└─plymouth-quit-wait.service @32.987s +3min 38.930s
└─systemd-user-sessions.service @31.969s +787ms
└─network.target @30.761s
└─NetworkManager.service @16.848s +13.753s
└─dbus.service @16.823s
└─basic.target @16.539s
└─sockets.target @16.539s
└─snapd.socket @16.461s +74ms
└─sysinit.target @16.347s
└─snapd.apparmor.service @13.569s +2.777s
└─apparmor.service @11.287s +2.248s
└─local-fs.target @11.259s
└─run-snapd-ns.mount @2min 15.093s
└─local-fs-pre.target @2.163s
└─systemd-tmpfiles-setup-dev.service @1.633s +529ms
└─systemd-sysusers.service @1.086s +540ms
└─systemd-remount-fs.service @689ms +256ms
└─systemd-journald.socket @454ms
└─system.slice @439ms
└─-.slice @439ms
答案1
您的代码显示了这一点:
- 3分38.930秒普利茅斯-退出-等待.服务
- 1分 18.298秒 snapd.service
- 1分 5.788秒 vboxadd.service
尝试这个:
- 从官方网站下载并更新 VirtualBox Guest Additions:https://www.virtualbox.org/(VirtualBox
most recent version
Oracle VM VirtualBox 扩展包)。 - 更新 snapd.service:
sudo snap refresh
- 更新或禁用 plymouth-quit-wait.service。
我在使用旧版 Guest Additions 工具时也遇到了同样的问题