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
Error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied #240
Comments
After fresh install on ubuntu 18.04 I've got the same issue after adding compute machine by selecting local option. What should I do? Compute status says: Connected. But I cannot create Instance on it. |
Have you run that script on the host? What is the error while creating instance? |
Yes I've run the script. But I guess I mixed up users. I initially started process as sudo user and then run that script as root user. I guess this fucked up my installation. Recreating fresh VPS again. |
I recommend you that isolate webvirtcloud from hypervisor host.
|
I see thank you very much for your suggestion. Right now this is my first try of webvirtcloud. So I'm just testing things out. Once I get familiar with the project concepts I'll create dedicated host for webvirtcloud :) Also I'll try to enhance docs here and there If I see something broken. |
Okay, just finished installing. I'm still seeing this error. Here is my whole installation steps. sudo apt-get update
sudo apt-get -y install git virtualenv python-virtualenv python-dev python-lxml libvirt-dev zlib1g-dev libxslt1-dev nginx supervisor libsasl2-modules gcc pkg-config python-guestfs
git clone https://github.com/retspen/webvirtcloud
cd webvirtcloud
cp webvirtcloud/settings.py.template webvirtcloud/settings.py
python # Generating secret key in python shell
vim webvirtcloud/settings.py # putting the key here
sudo cp conf/supervisor/webvirtcloud.conf /etc/supervisor/conf.d
sudo cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d
cd ..
sudo mv webvirtcloud /srv
sudo chown -R www-data:www-data /srv/webvirtcloud
cd /srv/webvirtcloud
virtualenv venv # This line gave error, because folder was owned by www-data:www-data now
sudo chown -R me:me venv # So I had to change back permission to my current user
pip install -r conf/requirements.txt
python manage.py migrate
sudo chown -R www-data:www-data /srv/webvirtcloud # fixing permissions back after installing things
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart
sudo service supervisor restart
wget -O - https://clck.ru/9V9fH | sudo sh Now I'm here. I guess I followed everything correctly, are you seeing anything abnormal here? |
Hmm, i never try local connection. I should ... |
I didn't install virt-manager. I guess it wasn't needed.
Edit: Ah it is called libvirtd $ sudo service libvirtd status
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-11-06 17:54:25 UTC; 12min ago
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 20575 (libvirtd)
Tasks: 19 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─20575 /usr/sbin/libvirtd
├─20937 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
└─20938 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
Nov 06 17:54:27 instance-2 dnsmasq[20937]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Nov 06 17:54:27 instance-2 dnsmasq-dhcp[20937]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Nov 06 17:54:27 instance-2 dnsmasq-dhcp[20937]: DHCP, sockets bound exclusively to interface virbr0 |
Virt-manager does not need. But to check somethings, it is useful. |
Ran command as my current user $ virsh list
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
$ sudo virsh list
Id Name State
---------------------------------------------------- |
As you see it is related with users and permissions. |
It is indeed. Okay I've fixed it. I've added myself to Edit: adding |
Libvirt-sock problem Seems to solved. |
Just double checked it by removing Oh thank you! I didn't know I actually had to click on the compute name. Now I'm seeing whole lot of menus out there! Thank you very much. /close |
I have just installed it and have not changed anything. I added a compute node and then got this error. I added myself to the libvirt group and virt-manager works just fine. Only Webvirtcloud has this issue. Help?
The text was updated successfully, but these errors were encountered: