[clug] NFSv4 "Invalid argument"

George at Clug Clug at goproject.info
Fri Oct 17 19:41:46 MDT 2014


Previously I had mentioned that I was wondering how to use NFS shares
with Virt-Manager. Well I found a web site that explained, and it was
very simple, I had not understood that NFS shares used "netfs:".  


Using the information in the above URL I used Virt-Manager to attach
to the OpenFiler NFS share. I then checked the mount for the OpenFiler
share to see what mount options Virt-Manager used (it was NFS4); on
/var/lib/libvirt/images/ofNFS type nfs4

However when I attempted to create a virtual machine there was an
error, due to file permissions;

Unable to complete install: 'internal error Process exited while
reading console log output: char device redirected to /dev/pts/3
do_spice_init: starting 0.11.0
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
kvm: -drive
could not open disk image /var/lib/libvirt/images/ofNFS/DebJessie.img:
Permission denied

After checking permissions I noticed that the VM img file was created
with 600 for nobody:nogroup, so I changed them to 666 on the img file
that and now I am able to create the virtual machine.  Much like the
issue I had previously when I was mapping the shares.

I am thinking that since Virt-Manager was able to create the virtual
machine's image but was not able to run the virtual machine, it is
likely that I have various user/group issues ?  However after
investigation I cannot see any misconfigurations with my user and
group assignments, I believe it is an issue with NFS 4 issue, but I do
not know enough about NFSv4, kvm & libvirt to know exactly what is
causing the issue. Well I don't need to use an NFS share, I would
prefer to use local storage, it is just I wanted to see if this was
possible and what might be any limitations.

# ls -al /var/lib/libvirt/images/ofNFS/
total 359169040
drwxrwsrwx 3 nobody nogroup         4096 Oct 18 00:46 .
drwx--x--x 6 root   root            4096 Oct 18 10:43 ..
-rwxrwxrwx 1 nobody nogroup   8589934592 Oct 16 10:25 Deb7Test.img
-rw-rw-rw- 1 nobody nogroup   1500971008 Oct 18 01:13 DebJessie.img
-rwxrwxrwx 1 nobody nogroup   8589934592 Oct 16 10:29 def2.img
drwxrwsrwx 2 nobody nogroup         4096 Oct 11 08:50 ISO


addgroup "$(whoami)" libvirt
addgroup "$(whoami)" kvm


Afterwards we must add the user as which we're currently logged in
(root) to the groups libvirt and kvm: 

adduser `id -un` libvirt
adduser `id -un` kvm

cat /etc/group

More information about the linux mailing list