Gnome Boxes and Windows Guest

I recently decided to try switching to Gnome Boxes for my Windows Virtual Machine from Virtual Box simply to see if the integration with Gnome Shell would be better. What follows is a summary of my experience getting things running optimally, hopefully it will be helpful to others interested in trying the switch. Note that I’m using Arch and Gnome 3.12 at the time this was written.

While not strictly necessary, the first step for me was to uninstall VirtualBox and all it’s dependent packages such as guest additions and the host packages. After that, I installed the gnome-boxes package which automatically drags in Qemu. I would also recommend installing virt-manager and virtviewer in case you need to perform more advanced tasks then Boxes will allow.

With the packages installed, I tried Boxes and found I could not do anything because it would fail as libvirtd was not starting automatically as it should. A bit of explanation, under the hood Gnome Boxes uses libvirtd, a library that abstracts virtualization implementations, to interact with Qemu. In turn Qemu has two different scopes for virtual machines: system and session.

The system scope is when the libvirtd is running as a daemon and the virtual machines have wider access to resources due to the higher privileges of the daemon. Session scope is when the VM is running in the current user context and only has access to what the current user is permitted.

Gnome Boxes uses the session scope so there is no need to enable the libvirtd daemon in Arch for Boxes, however as mentioned there is an annoying issue where libvirtd doesn’t start automatically as it should. Therefore when you start up Boxes you can an error message similar to the below:

Unable to open qemu+unix:///session: Failed to connect socket to
'/run/user/1000/libvirt/libvirt-sock': No such file or directory

You can check out this thread here (https://bbs.archlinux.org/viewtopic.php?id=186874) for more information on it, I simply worked around it by adding a script libvirtd.sh to /etc/profile.d to start it on login:

[bash]

libvirtd -d

[/bash]

Make sure to include the -d switch to run it in the background otherwise your login will hang.

Once that was fixed, I used Boxes to convert my Windows 7 VirtualBox image over to Qemu and fire it up. It ran fine but performance was terrible, after doing some reading I found there are two must do items to achieve decent Windows performance under Boxes and Qemu:

a. Uninstall the VirtualBox Guest Additions if you have them installed.

b. Install the Windows Guest Tools here which includes the QXL video driver, clipboard support, etc. This makes the VM experience much more performant and seamless similar to what the VirtualBox Guest Additions provide.

c. Install the virtio driver in the Windows guest for optimum network performance in the VM, they can be found here

At this point I had a well running VM but I still had an issue with Boxes that whenever I closed and re-opened the Windows VM Boxes would complain that it couldn’t be started and I had to start it from scratch. This was really irritating, but after a fair amount of troubleshooting I discovered the issue was that I had a inTSC feature enabled in the VM which was causing the issue. Using virsh, I modified the image in ~/.local/share/gnome-boxes/images to remove this feature and everything worked fine afterwards.

Finally the last issue is that in VirtualBox sharing folders between the host and guest is a snap, in Boxes there is no way to configure this easily in the Boxes UI. Looking at Qemu and KVM, it looks like there is a way to directly share folders but I opted to simply use Samba on the host to expose it to the Windows Guest. To do this, I installed the samba package in arch and then copied the file /etc/samba/smb.conf.default to /etc/samba/smb.conf and modified the newly copied file to expose the desired shares. In the guest, you can use the gateway address (10.0.2.2) to access the folders, i.e. \\10.0.2.2\Documents.

So after a bit of work everything is up and running at about the same performance level as VirtualBox. I love the integration of Boxes with Gnome Shell such as the search provider and will likely stay with Boxes. I do have one minor issue where I wish there was an option for Boxes to stop starting my VM in full screen mode however apparently this is addressed in Gnome 3.14 which should be available for Arch shortly.

9 thoughts on “Gnome Boxes and Windows Guest

  1. It’s actually a great and helpful piece of info. I’m satisfied that you simply shared this useful information with
    us. Please keep us up to date like this. Thanks for sharing.

  2. Pingback: GNOME Boxes and Samba Shares | GExperts Inc

    • Sorry for the late reply, too much travelling these days for work. Anyways, assuming you are referring to the script to start libvirtd, the reason I didn’t use systemctl is because Gnome Boxes uses session scope and it has to be started in the user context not the system context.

      Anyways, list problem has been fixed in later versions of libvirtd and having that script in profile.d is no longer required.

  3. Great info…thanks. Instead of a samba share, I just put a copy of WinSCP on the windows guest, then make sure sshd is running on the host and you can connect to copy files back and forth easily. Samba probably gives you more flexibility in actually mounting a directory, etc, but ssh/WinSCP is another option if you don’t need all of that.

  4. I know that this is quite late, considering that comments in this post are from 2017, however, I’ve found that by installing spice-webdav which can be found in the spice website link that you shared, files and folders can be easily shared between the windowsVM and the linux host. I personally use my windows vm for iTunes, which allows me to sync my music and files to my iPhone; and altserver, which allows me to install altstore and sideload apps onto my iPhone.

Leave a Reply

Your email address will not be published. Required fields are marked *


*