Skip to content

Impossible to mount cdrom /dev/sr0 after boot from VagrantFile #13533

Open
@filoucrackeur94220

Description

@filoucrackeur94220

Issue Description

With VirtualBox 7.0 and Vagrant, it seems impossible to associate an optical device from an .iso file without preventing the priority booting from the hard disk. Even when forcing the boot order, the virtual machine always boots from the attached ISO file instead of the present hard disk, causing issues during startup.

Configuration

Here is the configuration I am using in my Vagrantfile:

config.vm.disk :dvd, name: "trimbox-server.iso", file: ENV['ISO_PATH']

vb.customize ["modifyvm", :id, "--boot1", "disk"]
vb.customize ["modifyvm", :id, "--boot2", "none"]
vb.customize ["modifyvm", :id, "--boot3", "none"]
vb.customize ["modifyvm", :id, "--boot4", "none"]

Expected Behavior

I expected the virtual machine to boot from the hard disk when it is present, even if an ISO file is attached. In other words, I wanted the boot order to be respected, allowing for normal startup from the hard disk.

Actual Behavior

However, the virtual machine always boots from the attached ISO file when it is present, even after specifying the boot order. This prevents the operating system installed on the hard disk from booting correctly.

Reproduction Information

Vagrant Version

vagrant -v

Vagrant 2.4.1

Host Operating System

Fedora 41 with GNOME

Guest Operating System

Create a Vagrantfile using the configuration above.
Bring up the virtual machine with vagrant up.
Observe that the virtual machine boots from the ISO file instead of the hard disk.
Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"

  # ISO configuration
  config.vm.disk :dvd, name: "test-server.iso", file: ENV['ISO_PATH']

  # Boot order configuration
  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--boot1", "disk"]
    vb.customize ["modifyvm", :id, "--boot2", "none"]
    vb.customize ["modifyvm", :id, "--boot3", "none"]
    vb.customize ["modifyvm", :id, "--boot4", "none"]
  end
end

Debug Output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions