keylime / keylime-vagrant-ansible-tpm-emulator

Ansible role to deploy Keylime with a software emulator
https://keylime.dev
Apache License 2.0
8 stars 20 forks source link

Error when giving --repo=/mypath/to/keylime to vagrant #81

Closed arkountos closed 11 months ago

arkountos commented 11 months ago

OS: Ubuntu 22.04.1 When running:

vagrant --repo=/home/myuser/local_keylime/keylime up --provider libvirt --provision

I am giving my local keylime directory as the repo argument. This results in the following error:

Bringing machine 'keylime-fedora1' up with 'libvirt' provider...
/usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/builtin/mixin_synced_folders.rb:140:in `block in synced_folders': Internal error. Report this as a bug. Invalid: sshfs (RuntimeError)
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/builtin/mixin_synced_folders.rb:128:in `each'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/builtin/mixin_synced_folders.rb:128:in `synced_folders'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/machine.rb:631:in `synced_folders'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/plugins/kernel_v2/config/vm.rb:730:in `validate'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/config/v2/root.rb:71:in `block in validate'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/config/v2/root.rb:66:in `each'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/config/v2/root.rb:66:in `validate'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/builtin/config_validate.rb:15:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/warden.rb:48:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/builder.rb:149:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/runner.rb:89:in `block in run'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/util/busy.rb:19:in `busy'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/action/runner.rb:89:in `run'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/machine.rb:246:in `action_raw'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/machine.rb:215:in `block in action'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/environment.rb:614:in `lock'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/machine.rb:201:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/machine.rb:201:in `action'
    from /usr/share/rubygems-integration/all/gems/vagrant-2.2.19/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'

Elsewhere in the forums it is suggested that vagrant-sshfs plugin installation solves this problem. I installed vagrant-sshfs and vagrant plugin list outputs

vagrant-libvirt (0.7.0, system)
vagrant-sshfs (1.3.7, global)

However the problem still persists. I also tried pointing to my local keylime through the vagrant_variables.yml file. If I don't point to my local directory the vm starts.

What could be the problem here?

arkountos commented 11 months ago

Oops! Turns out I was running the vagrant up command with sudo but had installed the vagrant-sshfs plugin without sudo.

Problem solved after running sudo vagrant plugin install vagrant-sshfs. Not the best practice but here I am.