You are not logged in.
I installed libvirtd and qemu. I did not have a /var/run/libvirt directory. I uninstalled libvirtd, qemu, qemu-arch-extra, and qemu-block-iscsi, rebooted, and reinstalled those packages. I still do not have anything in /var/run/libvirt. Originally, I did not have a libvirt directory in /var/run, so I ran mkdir libvirt.
The output of systemctl status libvirtd.service is below.
systemctl status libvirtd.service
○ libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disa>
Active: inactive (dead) since Thu 2021-07-01 16:04:33 CDT; 11min ago
TriggeredBy: ● libvirtd.socket
● libvirtd-admin.socket
● libvirtd-ro.socket
Docs: man:libvirtd(8)
https://libvirt.org
Process: 2267 ExecStart=/usr/bin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 2267 (code=exited, status=0/SUCCESS)
CPU: 102ms
Jul 01 16:02:33 paul-linux2 systemd[1]: Started Virtualization daemon.
Jul 01 16:04:33 paul-linux2 systemd[1]: libvirtd.service: Deactivated successfully.Any help would be appreciated. Thank you in advance!
Last edited by paulbarbee (2021-07-06 00:46:39)
Offline
You have not explained why the directory not existing / being empty is an issue.
Offline
I apologize. I suppose that was obvious to me. The directory being empty is an issue because libvirt-sock is supposed to be in that directory. According to https://wiki.archlinux.org/title/libvirt, I should test if libvirt is running on a system level, so I ran
virsh -c qemu:///systemThat gave me the following output
setlocale: No such file or directory
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directoryBasically, libvirtd is not running correctly, so I cannot crate any virtual machines.
Offline
I ran
touch /var/run/libvirt/libvirt-sockand rebooted. Now I'm getting the following output when I run
sudo virsh -c qemu:///systemsudo virsh -c qemu:///system
[sudo] password for paul:
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refusedWhen I run the command as a normal user I get a permission denied error as the last line. the regular user is a member of the following groups: libvirt kvm wheel paul mykvm.
Offline
I have managed to solve the issue. Earlier, I had moved /var to another drive. As part of resolving that issue, some program had complained about /var/run and /var/lock, so I had created those directories. Looking at the files for an earlier installation, /var/run and /var/lock are supposed to be simlinks to /run and /run/lock, respectively. Ultimately, I rebooted into an Arch live installation and issued the following commands:
mount /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p2 /mnt/boot
mount /dev/sda3 /mnt/mnt/sda3
mount --bind /mnt/mnt/sda3/var /mnt/varI also had /home and /tmp on the same drive, so I mounted them with bind.
mount --bind /mnt/mnt/sda3/home /mnt/home
mount --bind /mnt/mnt/sda3/tmp /mnt/tmpThe I did a chroot and created the proper links.
arch-chroot /mnt
cd /var
ln -s /run run
ln -s /run/lock lock
ls -lahthe ls showed that everything pointed to the correct place, I cd'ed to /var/run and /var/run/lock and made sure that there were files in those directories. After that, I exited the chroot, rebooted and made sure the boot went smoothly.
virsh -c qemu:///systemnow brings up the virsh prompt and everything appears to be running correctly.
Thank you to everyone who looked at this issue!
Last edited by paulbarbee (2021-07-06 00:46:06)
Offline