Open S4nfs opened 2 years ago
Hello @S4nfs, thanks a lot for your interest in my project. Could you please paste the complete error message here?
In the meantime, I'll look at the code and see what could be the cause. Just like that I would say that one of the libvirt
related service is not running... 🤔
Can you additionally run this command on the server and make sure that all the related services are running correctly?
$ systemctl status libvirt-bin.service libvirt-guests.service libvirtd.service -l
Last thing about what you've mentioned to have installed ucspi-tcp
. This package is not required if you are running PHP
version 7.4.x and above. So feel free to remove it.
Maybe what I wrote as documentation was confusing, let me know if that was the case.
Thanks in advance for your help and again for your interest in my project.
@Jiab77 i really love ur work as i have been working on a similar kinda project & thanks for updating the documentation but i think it's just some another issue.
Here's the error shown in the img:
error: failed to connect to the hypervisor error: Cannot create user runtime directory '/var/www/.cache/libvirt': Permission denied
PS: Also mine was deployed on the same server with the all those permissions and dependencies.
@S4nfs, huge thanks for your appreciation of my work. I wish I could spend more time on my projects so that I could finish them and improve them from time to time 😅
Thanks a lot for providing me the full error message. In this case I think you're right and it's not something I could test on my side 'cause I'm only relying on the PHP
embedded web server to run the web interface.
Regarding the deployment, I got two working deployments using the PHP
embedded web server and then just using the script start-web-server.sh to fire it up. So, I got a local deployment and a remote deployment on a small dedicated server. That's why I didn't encountered similar issues as you did.
What I don't understand in your case is why apparently libvirt
is trying to write into your apache
web folder under a .cache/libvirt
subfolder...
Just to make sure that the issue is not in the code / to isolate it correctly, could you please just try running the script start-web-server.sh and see if you get the same issue?
Otherwise, if you can't, what you can do would be to create that /var/www/.cache
folder and set it temporarily to chmod 777
and see under which user the libvirt
folder got created. Once done, try to restrict write access to only the related user used to create that libvirt
folder.
Also, I don't think that having deployed everything on the same host would be an issue. Basically if you check the code, I'm simply calling the libvirt
binaries like virsh
, parsing the output and render it in the web interface. And as I just deployed the code in the $HOME
folder, I didn't had the same permission issues you had.
I'll try to setup a VM with apache
+ the nested virtualization enabled and do some tests to understand what caused your issue, debug it and then document my findings + workarounds if possible.
Thanks again for having took the time to report your issue 🙇🏽
Error:
error: failed to connect to the hypervisor error: Cannot recv data: Connection reset by peer
It do create some files under /.cache/libvirt
I'll figure it out if something's wrong by my side and update you.
@S4nfs, that's interesting and thank you for sharing details from your side. It's clearly something I didn't experienced 'cause not having used apache
as you did but it's something I must document so I'll do the necessary tests too 😉
Btw, I just checked the progress made by Cockpit and I'm not really sure I should keep working on this project... I made it when Cockpit was still at it's beginning but now, it's already covering what I wanted to achieve.
The only, if I may say "advantage" of my project would be that it does not need a lot of resources and don't alter much the host where it will be deployed where Cockpit is a much bigger solution but covers much more things and certainly much better than I did.
The other reason why this project seemed staled was because I wanted to redraw the web interface under another framework called Fomantic-UI but I could not find enough time to finish the work...
So, at some point if you find that it will ask you too much efforts to make my project working on your server, you should probably try Cockpit then. It should work by default with your current setup.
Just came across this. Yes Cockpit is good, if you are running Linux.
There are reasons to run this from a Mac and in that situation Cockpit is unavailable and the currently available solutions for MacOS do not directly use or manage the open source setup. UTM is the closest but it is based on a fork of Qemu.
@mac2net I did some research and found a project much more advanced than mine and kinda use the same ideas as mine but in way better 😅
This project is called webvirt made by @kevr.
I haven't tested it but I think you should give it a try and if it does not work for you and only mine does, then I might take the time to improve it and fix existing bugs.
What @kevr made is very advanced but much bigger than what I wanted to do.
My goals are primarilly to offer something light, easy to run and that can run mostly everywhere php
and libvirt
can be installed in a standalone way.
I don't know what's causing this error but i have all dependencies installed related with the server and PHP
sudo apt install libvirt-bin virtinst libguestfs-tools php-cli php-gd php-xml php-json
ANDsudo apt install ucspi-tcp
My Dist: Ubuntu 18.4 LTS, Apache Server