2

I've got Debian Bullseye installed on my computer and I want to play a bit with Vagrant. Unfortunately, I stumbled upon two problems that at first sight are not related, however in order to give full overview I list them both:

  1. While installing vagrant package from repos, Debian automatically removes virtualbox and virtualbox-qt packages, and vice versa! When I try to reinstall virtualbox Debian informs me that during the installation vagrant and vagrant-libvirt will be removed. Why? Are there any obstacles that those packages cannot work together on Debian? On bullseye's webpage about vagrant package you can only find that: ''Vagrant upstream uses Oracle’s VirtualBox by default to create its virtual machines. On Debian, Vagrant will use libvirt/KVM by default as VirtualBox is not part of Debian main, but will use VirtualBox if it's installed.''

Anyway, I circumvented this issue by installing virtualbox from official Debian's repos, and downloading standalone, appImaged vagrant binary from vagrant's official page, and copying it into some system path directory. Now both of them are working...

  1. The second problem is that even for simple Vagrantfile like:
    Vagrant.configure("2") do |config|
      config.vm.box = "bento/ubuntu-18.04"
    
      config.vm.provider "virtualbox" do |vb|
      # Display the VirtualBox GUI when booting the machine
      vb.gui = true
    
      vb.cpus = 2
      vb.memory = 1024
      vb.customize ["modifyvm", :id, "--vram", "128"]
      vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]  
      end
    
      config.vm.provision "shell", inline: <<-SHELL
         apt-get update
         apt-get install -y emacs
      SHELL
    
    end

the commands from config.vm.provision "shell", inline block are not executed! What is more I cannot vagrant ssh into vm. I keep obtaining:

VM must be running to open SSH connection. Run `vagrant up`
to start the virtual machine.

Details: After vagrant up the vagrant box is created (I can see it in virtualbox), virtualbox is being launched and I got the virtual machine login screen. I can login and everything is ok (in virtualbox window).

However the last messages from command line say that:

The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

The full output from the command line is here:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-18.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'bento/ubuntu-18.04'
    default: URL: https://vagrantcloud.com/bento/ubuntu-18.04
==> default: Adding box 'bento/ubuntu-18.04' (v202212.11.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/bento/boxes/ubuntu-18.04/versions/202212.11.0/providers/virtualbox.box
==> default: Successfully added box 'bento/ubuntu-18.04' (v202212.11.0) for 'virtualbox'!
==> default: Importing base box 'bento/ubuntu-18.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-18.04' version '202212.11.0' is up to date...
==> default: Setting the name of the VM: debian-vagrant_default_1676627515085_33587
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.

The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.

I found somewhere that disabled VT features in BIOS might cause this kind of problems. I checked this and I had them enabled in my BIOS.

1 Answer 1

1

Vagrant is not compatible with the latest version of virtualbox (7.x). You have the compatible versions here https://developer.hashicorp.com/vagrant/docs/providers/virtualbox

5
  • Thanks for the link. Nevertheless, the clue, you provided, does not explain the fact that Vagrant 2.3.4 and VirtualBox 7.0 work as expected when I install them on Windows. I tried with VirtualBox 6.1 installed from Oracle's site, however this in a turn gave rise to problems with dkms and after playing a bit with this I gave up for a while. So I'd rather blame Debian for the problems. Commented Mar 1, 2023 at 9:45
  • I'm fighting with this now too. That vagrant link links to the VirtualBox downloads page, but what is provided is a debian package, and to actually install it you also have to install all of its dependencies, and their dependencies, of which there are many. So while it's possible, there is definitely no one-liner command that will do it for you... I wonder if there is a tool that can help me generate an apt install command for all the dependencies of a debian package, assuming debian provides them all... Commented Apr 7, 2023 at 17:49
  • Aha, apt -f install will do just that! Commented Apr 7, 2023 at 18:27
  • askubuntu.com/a/40050/207584 Commented Apr 7, 2023 at 18:27
  • Not very related to this question but maybe useful to someone: If you, like me, are trying to run this on an AWS EC2 instance, you may soon discover that most EC2 instance types don't support virtual machines, and the ones that do are expensive. I hear that maybe you can make VirtualBox run your guest OS in an emulated mode, but then maybe performance is terrible. So maybe don't try to run a guest OS on EC2. Just launch another EC2 instance running the OS you want. Commented Apr 7, 2023 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .