New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't install vagrant-libvirt on Fedora #1403
Comments
For Fedora I'd recommending using the following in order of preference:
I believe the problem you are seeing is because there is a conflict between the libraries bundled in upstream vagrant and those that the libvirt library is linked against, consequently you see this issue. The script reference in option 3 takes care of patching the upstream vagrant with builds of libraries that should work to allow ruby-libvirt be linked to libvirt when being installed. But it means use of sudo to modify some of the libraries bundled with the upstream vagrant, so there could be breakage further down. That install script reference is my attempt to get closer to regularly testing the latest from this repo against the various distros. I don't yet have it running automatically, but testing last weekend it was able to correctly install upstream vagrant and patch it to allow vagrant-libvirt to be installed directly on fedora 33 & 34. I'm also hoping to work out the steps for fedora to use the distro vagrant, combined with distro ruby-libvirt/fog-libvirt packages installed in a way that means only vagrant-libvirt need come from a gem and be installed by vagrant itself to give access to the latest features without the problems installing it, but that's still a work in progress. In general though, I'd recommend using the distro packaged versions where possible. If the distro packages work for you, easier to stay with them, otherwise if you need the latest vagrant-libvirt you'll possibly want to consider the docker/podman image, or using that install script and accepting having it modify vagrant itself. |
Actually the following instructions should work to get the latest vagrant-libvirt plugin installed with the distro vagrant package:
Keep in mind this uses the system libvirt connection, while the default package for fedora uses the session connection. Only difference is you'll need to However that might be a lot easier than messing around with the upstream vagrant package. |
@electrofelix I have tried your second instruction but it didn't seem to work for me. I got the same error. I will try the first approach later. Thanks a lot! |
@JaneSoo can you share what you saw when trying to use those commands? I was on a pristine fedora 34 VM when I checked that, so you might have to purge both the upstream vagrant and anything relating to the plugins ~/.vagrant.d/ to get it to work if you've already tried installing some bits as otherwise can end up with issues with vagrant trying to deal with two versions of the same gem and picking the wrong one. |
@electrofelix All commands run successfully but
I am on Fedora 35 |
Unfortunately there isn't a fedora 35 box published at https://app.vagrantup.com for me to use to experiment to compare, so I'm stuck checking install steps with fedora 34 for the moment. Worth using |
Here is the log: |
I can see it's still using the upstream vagrant rather than the distro vagrant. Can you uninstall the vagrant package completely and try the instructions again for the distro based one. There is probably a setting that would have removed it and installed the distro one instead, just not sure what it would be. |
I am confused. Isn't the instruction below for distro based:
|
That installs the vagrant package as built by hashicorp, unfortunately that causes issues with vagrant-libvirt due to incompatible library versions. If you want to use that package you will need to use the script I've linked previously which modifies the files installed by the hashicorp package. However I've now worked out how to get the latest vagrant-libvirt to be installable with the fedora packaged vagrant, which is the subsequent instructions:
But for that to work it requires removing the hashicorp packaged vagrant to allow the fedora packaged vagrant to be installed. Otherwise it will skip installing the fedora package as there is already a vagrant package installed. |
I got it. I keep uninstalling and installing vagrant with distro again but it always picks up the one from hashicorp because I have the repo enabled. I disable harshicorp repo and follow your step above. It works perfectly. Thanks a lot @electrofelix |
I hadn't considered that it would keep using the upstream package, thanks for sharing that, I'll have to keep that in mind for any instructions I share. Hopefullly something as simple as the following would work to switch to the distro packaged verison:
|
Minor correction to the above instructions, you probably want to run the following to ensure an explicit install of the vagrant-libvirt dependencies so that fedora doesn't think it can automatically remove them subsequently.
Or change the instruction
|
Get to learn something new, thanks |
Try to install these two pacakges
|
Error message showing that I don't have libvirt on my distribution while I already installed:
vagrant plugin install vagrant-libvirt
Steps to reproduce the error:
Installed vagrant on my Fedora 35 following this doc:
https://www.vagrantup.com/downloads
Installed libvirt following this doc:
https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-virtualization/#installing-virtualization-software
Added extra packages:
sudo dnf install -y gcc libvirt libvirt-devel libxml2-devel make ruby-devel libguestfs-tools
Add user group
sudo usermod -aG libvirt $USER
Reboot
Added vagrant-libvirt plugin:
vagrant plugin install vagrant-libvirt
Error message:
Does anyone know if I miss something?
The text was updated successfully, but these errors were encountered: