You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac上使用Vagrant启动bento/ubuntu-18.04虚拟机失败求助

Fix: linux-headers-4.15.0-12-generic No Installation Candidate on Old Ubuntu 18.04 Vagrant Box

Hey, I’ve run into this exact issue before with outdated Ubuntu Vagrant boxes. The core problem here is that your bento/ubuntu-18.04 201803.24.0 box is way too old—its included kernel (4.15.0-12-generic) has had its corresponding headers package removed from Ubuntu’s active repositories. The GuestAdditions version mismatch is a secondary issue tied to this outdated box. Here’s how to fix it:

Step 1: Bypass GuestAdditions Auto-Update & Update the Kernel

First, we need to get the VM running without the failing GuestAdditions install:

  1. Edit your Vagrantfile to disable automatic vbguest updates temporarily:
Vagrant.configure("2") do |config|
  # Keep your existing config here...
  config.vbguest.auto_update = false
end

Run vagrant up—this should start the VM successfully now, since it skips the broken headers/GuestAdditions install.

  1. SSH into the VM with vagrant ssh, then update the package lists and install the latest supported kernel for Ubuntu 18.04:
sudo apt update
sudo apt install -y linux-generic

This will replace the old, unsupported kernel with a newer one that has available headers in the active repos.

  1. Reboot the VM to load the new kernel:
sudo reboot

Step 2: Re-enable GuestAdditions Auto-Update

Exit the VM, then edit your Vagrantfile again to remove the config.vbguest.auto_update = false line (or set it to true). Then run:

vagrant reload --provision

The vagrant-vbguest plugin will now automatically install the matching GuestAdditions version (5.2.12) for your host, and the new kernel’s headers will be available for installation—no more errors.

Alternative: Use a Newer bento/ubuntu-18.04 Box

If you don’t want to mess with updating the old box, just pull the latest version of the bento/ubuntu-18.04 box:

vagrant box update --box bento/ubuntu-18.04

Newer boxes include more recent kernels that still have supported headers in Ubuntu’s repos, so you won’t hit this issue in the first place.


内容的提问来源于stack exchange,提问作者Larry Martell

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:43:46