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:
- While installing
vagrant
package from repos, Debian automatically removesvirtualbox
andvirtualbox-qt
packages, and vice versa! When I try to reinstallvirtualbox
Debian informs me that during the installationvagrant
andvagrant-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...
- 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.