I've been having an issue for a few months with Nautilus crashing in Ubuntu 16.04.2 LTS. Everything will work fine for a few days, and then suddenly I get a bug report error stating that Nautilus crashed. After that when I try to open it, it opens for a second and then closes. The only way I've found to get it working again is to reboot my laptop.
After it crashes, if I try to launch Nautilus through the terminal, I get the following error:
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
(nautilus:5316): Gtk-WARNING **: cannot open display: :1
Any ideas how to resolve this so I don't have to keep rebooting just to use my file manager?