Gnome-boxes on 22.04 starts and immediately crashes

Ubuntu Version:22.04

Desktop Environment (if applicable):mate

Problem Description:
I am new to Gnome-Boxes, but I had a win10 VM working then attempted to clone it, at which point boxes appeared to be hung. after quite some time I tried to stop the clone process, but nothing worked from within the app. So I killed the app.

Now when I start Boxes, it starts up and immediately crashes.

I’m assuming I left something in a bad state (orphan lock file, or some such) but can’t figure out what, or how to solve it.

Relevant System Information:
Running on a brand new System76 Meerkat-10, 32 G RAM, 1T M2 drive, two monitors. CPU is Intel(R) Core™ Ultra 5 225H


(gnome-boxes:768374): Gtk-WARNING **: 18:14:15.445: GtkFlowBox with a model will ignore sort and filter functions

(gnome-boxes:768374): Gtk-WARNING **: 18:14:15.446: GtkListBox with a model will ignore sort and filter functions
Boxes-Message: 18:14:15.929: libvirt-machine.vala:274: Failed to connection to system libvirt: Unable to open qemu+unix:///system: Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory

(gnome-boxes:768374): Boxes-WARNING **: 18:14:15.930: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:768374): Gtk-WARNING **: 18:14:15.940: Calling org.gnome.SessionManager.Inhibit failed: GDBus.Error:org.gnome.SessionManager.GeneralError: Invalid inhibit flags

** (gnome-boxes:768374): CRITICAL **: 18:14:15.940: gvir_storage_vol_get_path: assertion 'GVIR_IS_STORAGE_VOL(vol)' failed

(gnome-boxes:768374): Boxes-WARNING **: 18:14:15.957: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:768374): Boxes-WARNING **: 18:14:15.964: libvirt-broker.vala:164: Failed to find source machine of clone Win-10-vm 2

(gnome-boxes:768374): Boxes-CRITICAL **: 18:14:15.964: boxes_vm_importer_get_source_media: assertion 'self != NULL' failed
Segmentation fault (core dumped)

What I’ve Tried:
manually delete the VM. uninstall/reinstall Boxes. Try to find where boxes (and its subsidiary tools) keep lock files, etc. not necessarily in that order.

Before Posting:
I found one post with the same problem but saw no solution to it.

Welcome to Ubuntu Discourse :slight_smile:

Which version of Boxes was originally installed, the apt or snap version?

Which version did you try reinstalling, same?

same. remove with synaptic. reinstall with synaptic.

version 42.2-0ubuntu1

The issue appears to be on this line:
Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory

Let’s check this first:
dpkg -l | grep libvirt

2 Likes
ii  libvirt-daemon                                8.0.0-1ubuntu7.13                                               amd64        Virtualization daemon
ii  libvirt-daemon-driver-qemu                    8.0.0-1ubuntu7.13                                               amd64        Virtualization daemon QEMU connection driver
ii  libvirt-glib-1.0-0:amd64                      4.0.0-2                                                         amd64        libvirt GLib and GObject mapping library
ii  libvirt-glib-1.0-data                         4.0.0-2                                                         all          Common files for libvirt GLib library
ii  libvirt0:amd64                                8.0.0-1ubuntu7.13                                               amd64        library for interfacing with different virtualization systems

It appears you might be missing some of the essential packages needed to run Boxes.

But I want to make sure so let’s check some other things first:

systemctl list-unit-files | grep libvirt
dpkg -L libvirt-daemon-system | grep systemd
ls -ld /var/run/libvirt

Thanks

I posted a reply via email. will I need to post it here, too, or will it find its way here?

Fred


fredex@pop-os:~/Desktop$ dpkg -L libvirt-daemon-system | grep systemd
dpkg-query: package 'libvirt-daemon-system' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.

fredex@pop-os:~/Desktop$ ls -ld /var/run/libvirt
ls: cannot access '/var/run/libvirt': No such file or directory
fredex@pop-os:~/Desktop$```

not much showing there, looks like you may be right! Odd that Gnome-Boxes appeared to be working (for some values of "working") before I commited my little faux pas, though.

Fred

It seems replying by email worked?

The output seems to confirm that the libvirt-daemon-system, which is needed for libvirt and GNOME Boxes to function is missing.

How did this happen? Not sure to be honest but let’s try and fix it.

sudo apt update
sudo apt install libvirt-daemon-system
sudo systemctl enable --now libvirtd

Assuming no errors, then check the status and if the correct files are now in place:

systemctl status libvirtd
ls -l /var/run/libvirt/

Try starting Boxes again and fingers crossed :pray:

thanks for the ideas!

unfortunately it still starts then crashes. I started it from a commandline, so here is the result from that perspective:


(gnome-boxes:881740): Gtk-WARNING **: 23:29:55.810: GtkFlowBox with a model will ignore sort and filter functions

(gnome-boxes:881740): Gtk-WARNING **: 23:29:55.810: GtkListBox with a model will ignore sort and filter functions

(gnome-boxes:881740): Boxes-WARNING **: 23:29:56.274: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:881740): Gtk-WARNING **: 23:29:56.287: Calling org.gnome.SessionManager.Inhibit failed: GDBus.Error:org.gnome.SessionManager.GeneralError: Invalid inhibit flags

** (gnome-boxes:881740): CRITICAL **: 23:29:56.287: gvir_storage_vol_get_path: assertion 'GVIR_IS_STORAGE_VOL(vol)' failed

(gnome-boxes:881740): Boxes-WARNING **: 23:29:56.308: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:881740): Boxes-WARNING **: 23:29:56.316: libvirt-broker.vala:164: Failed to find source machine of clone Win-10-vm 2

(gnome-boxes:881740): Boxes-CRITICAL **: 23:29:56.316: boxes_vm_importer_get_source_media: assertion 'self != NULL' failed
Segmentation fault (core dumped)

systemctl status libvirtd shows this:

     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-10-20 23:27:47 EDT; 4min 44s ago
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd-ro.socket
             ● libvirtd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 880794 (libvirtd)
      Tasks: 19 (limit: 32768)
     Memory: 8.1M
        CPU: 209ms
     CGroup: /system.slice/libvirtd.service
             └─880794 /usr/sbin/libvirtd

Oct 20 23:27:47 pop-os systemd[1]: Starting Virtualization daemon...
Oct 20 23:27:47 pop-os systemd[1]: Started Virtualization daemon.
Oct 20 23:29:57 pop-os libvirtd[880794]: libvirt version: 8.0.0, package: 1ubuntu7.13 (Bhavin Gandhi <bhavin192@geeksocket.in> Tue,>
Oct 20 23:29:57 pop-os libvirtd[880794]: hostname: pop-os
Oct 20 23:29:57 pop-os libvirtd[880794]: End of file while reading data: Input/output error

Fred

The output here suggests the following:
Boxes is trying to open or import a VM named “Win-10-vm 2”

This is a known recurring GNOME Boxes issue when:

  • a VM is cloned or renamed,
  • or the source .qcow2 file or XML definition under ~/.local/share/gnome-boxes/images/ or ~/.local/share/libvirt/images/ is missing,
  • and Boxes wasn’t cleaned up properly

Steps-to-Fix:

  • Close GNOME Boxes
  • Move its old data folders out of the way:
mv ~/.local/share/gnome-boxes ~/gnome-boxes-backup
mv ~/.config/gnome-boxes ~/gnome-boxes-config-backup
  • Start GNOME Boxes again:
gnome-boxes

It should now open normally (empty list, no crash).

Let’s hope this finally resolves it :pray:

Once again, thanks for the ideas, skull-sweat, and patience!


(gnome-boxes:884972): Gtk-WARNING **: 00:11:30.509: GtkFlowBox with a model will ignore sort and filter functions

(gnome-boxes:884972): Gtk-WARNING **: 00:11:30.509: GtkListBox with a model will ignore sort and filter functions

(gnome-boxes:884972): Boxes-WARNING **: 00:11:30.684: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:884972): Gtk-WARNING **: 00:11:30.706: Calling org.gnome.SessionManager.Inhibit failed: GDBus.Error:org.gnome.SessionManager.GeneralError: Invalid inhibit flags

** (gnome-boxes:884972): CRITICAL **: 00:11:30.706: gvir_storage_vol_get_path: assertion 'GVIR_IS_STORAGE_VOL(vol)' failed

(gnome-boxes:884972): Boxes-WARNING **: 00:11:30.725: libvirt-machine.vala:101: Failed to disable 3D Acceleration

(gnome-boxes:884972): Boxes-WARNING **: 00:11:30.731: libvirt-broker.vala:164: Failed to find source machine of clone Win-10-vm 2

(gnome-boxes:884972): Boxes-CRITICAL **: 00:11:30.731: boxes_vm_importer_get_source_media: assertion 'self != NULL' failed
Segmentation fault (core dumped)

Have you tried the suggestions in post #12?

I am hoping that should fix the problems.

do you mean this?

mv ~/.local/share/gnome-boxes ~/gnome-boxes-backup
mv ~/.config/gnome-boxes ~/gnome-boxes-config-backup

if so, then yes, the last result I posted was after doing those steps.

What does this show?
sudo virsh list --all

[sudo] password for fredex: 
 Id   Name   State
--------------------

fredex@pop-os:~$ ```

Well, this is interesting.

Check this:
dconf dump /org/gnome/Boxes/

If the Windows VM or files are showing this is likely the cause of the problems.

Then run this:
dconf reset -f /org/gnome/Boxes/

This won’t affect the ISO or whatever you stored it as, only the settings in Boxes that thinks it still points to.

Try opening again:
gnome-boxes

fredex@pop-os:~$```

and you want me to run the second command ONLY IF the one above shows something?

Fred

Running the second command won’t make a difference in this case. It means we have to keep digging.

It would be safe to run but I do not think it will make a difference.

All it does is clear the settings so you have a clean configuration the next time you start Boxes.

But post the dump output because I am curious if it does show something that might give us a clue.