laminas/laminas-db

Vagrant error " mounting failed with the error: No such device"

ZVanoZ opened this issue · 4 comments

Bug Report

Q A
Version(s) 2.13.x af9634d
Version(s) 2.12.0

Summary

I cloned repo and do "vagrant up", but have an error

vagrantUp.log

system info:

$ uname -a
Linux ivan-desktop 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ virtualbox -h
Oracle VM VirtualBox Manager 5.2.42_Ubuntu

$ vagrant -v
Vagrant 2.0.2

Current behavior

"vagrant up" finished with an error

How to reproduce

$ git clone https://github.com/laminas/laminas-db.git laminas-db.src

$ cd laminas-db.src

$ vagrant up

Expected behavior

"vagrant up" finished without an error

I have some more info about issue.

I installed clean Linux Debian 10, and VirtualBox 6.0.24 with Extension Pack 6.0.10r.132072, and Vagrant 2.2.16
But error still here.
Then, i try found reason of the error.

We can install VirtualBox Guest Extension Pack manuality, and later run vagrant.
It is fix this issue, but have another errors during install "mssql-server" (i will create a new issue).

So, we need cofigure VirtualBox nachine manuality.

  1. After the fall of "vagrant up" on the "laminas-db" project, we manually edit the image.
    We stop.
    Add cd-rom.
    Specify in "cd-rom" the path to the image "/usr/share/virtualbox/VBoxGuestAdditions.iso"
    We launch the VirtualBox virtual machine.
    Login as user "vagrant" with the password "vagrant".

  2. Manually install "GuestAdditions"
    While in the terminal of the virtual machine, execute the commands.
    $ sudo apt-get update
    $ sudo apt-get install virtualbox-guest-dkms
    $ sudo apt-get install linux-headers-virtual
    $ sudo mkdir /media/cdrom1
    $ sudo mount /dev/cdrom /media/cdrom1\
    $ cd / media / cdrom1
    $ sudo ./VBoxLinuxAdditions.run
    $ sudo reboot
    --
    Checking the result
    The output list should contain "vboxsf" and "vboxguest"
    $ lsmod | grep vbox
    vboxsf 49152 1
    vboxvideo 53248 1
    ttm 98304 1 vboxvideo
    drm_kms_helper 155648 1 vboxvideo
    drm 364544 4 ttm,drm_kms_helper,vboxvideo
    vboxguest 286720 3 vboxsf,vboxvideo
    syscopyarea 16384 2 drm_kms_helper,vboxvideo
    sysfillrect 16384 2 drm_kms_helper,vboxvideo
    sysimgblt 16384 2 drm_kms_helper,vboxvideo
    --
    Check for the presence of the "vboxsf" group
    $ cat /etc/group | grep vb
    vboxsf:x:999:

  3. Run vagrant in the laminas-db directory
    First, we stop the virualbox virtual machine (from the GUI, or by executing "$ sudo shutdown now" in the virtual machine terminal).
    Open a terminal on the host system in the "laminas-db" directory.
    Run
    $ vagrant up

VagrantUp-manuality.log

I've just spent I don't know how long getting to the bottom of this, so if this helps anyone else, I did the following (on macOS Big Sur):

Edit the vagrant file, adding this within Vagrant.configure(2) do |config|

if Vagrant.has_plugin?("vagrant-vbguest")
      config.vbguest.auto_update = false
  end

Also, change this line:

curl -s https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list > /etc/apt/sources.list.d/mssql-server.list

To this:

curl -s https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list > /etc/apt/sources.list.d/mssql-server-2017.list

To get the filesystem share to work, attach the VirtualBox additions iso to the VM (you'll have to vagrant up then vagrant halt if you don't have the VM running already)

I also installed the vagrant-vbguest plugin, whose repository is here.

Then run the following commands (annotated)

vagrant plugin install vagrant-vbguest (Unsure if necessary, but it didn't hurt)

vagrant up (Start)

vagrant ssh (SSH into it)

sudo su (You need to be root for most of this)

mount /dev/cdrom /media/cdrom (Mount the iso)

cd /media/cdrom (Change directory)

./VBoxLinuxAdditions.run uninstall (Remove whatever's already installed, just to be sure)

apt-get update (Update apt-get)

apt-get install dkms build-essential linux-headers-generic linux-headers-$(uname -r) module-assistant virtualbox-guest-dkms  (I don't know exactly how much of this is necessary, but various amounts of googling compiled this list for me)

exit (Exit su)

exit (Quit SSH)

vagrant halt (Stop VM)

vagrant up (Start VM)

If for whatever reason the database software install didn't work, after you've run vagrant up, you can run vagrant provision and it'll rerun the installation. If it's previously got half way through, it'll probably complain about a few things but I don't think it kills everything.

Furthermore, for SQL Server to properly work, you need to ssh into the VM and run:

sudo /opt/mssql/bin/mssql-conf setup
/vagrant/.ci/sqlsrv_fixtures.sh

@ZVanoZ, I highly recommend the vagrant-vbguest plugin @willjones-stratagem used; make life a lot easier for installing Guest Additions and keeping it up to date. The repository URL cited here is the one I found, too, but I haven't had time to test. Since it worked for Will, it gives me confidence it's the right one. :-)

I'll see what I can do sometime this week. Thanks very much to both of you for the work to investigate this problem.

I've just spent I don't know how long getting to the bottom of this, so if this helps anyone else, I did the following (on macOS Big Sur):

vagrant plugin install vagrant-vbguest (Unsure if necessary, but it didn't hurt)
vagrant up (Start)
...

Thank you!
Your way works for me.
Just install plugin "vagrant-vbguest" for fix this issue (#194).
So, finally four steps for profit:

$ git clone https://github.com/laminas/laminas-db.git laminas-db.src
$ cd laminas-db.src
$ vagrant plugin install vagrant-vbguest
$ vagrant up