Unable to Mount Share on MobyLinuxVM

Expected behavior

When the mount authentication token is put on the VMBus, a cifs mount should be created

Actual behavior

Mounts are missing

Information

Beta 7

I’m trying to find out the cause, I can not see the hv_kvp_daemon write the auth token to /var/lib/hyperv/.kv_pool_0 - could you please clarify which process acts on the auth token once it’s there?

when I manually mount:

mount -t cifs //10.0.75.1/C /C -o username=<username>,password=<password>,noperm

it works fine, but pushing the token c;/C;username=<username>,password=<password>,noperm under cifsmount key doesn’t work.

I can confirm the token is on the bus with…

$VmMgmt = Get-WmiObject -Namespace root\virtualization\v2 -Class ` 
    Msvm_VirtualSystemManagementService
$vm = Get-WmiObject -Namespace root\virtualization\v2 -Class ` 
    Msvm_ComputerSystem -Filter {ElementName='MobyLinuxVM'}

($vm.GetRelated("Msvm_KvpExchangeComponent")[0] ` 
    ).GetRelated("Msvm_KvpExchangeComponentSettingData").HostExchangeItems | % { ` 
        $GuestExchangeItemXml = ([XML]$_).SelectSingleNode(` 
            "/INSTANCE/PROPERTY[@NAME='Name']/VALUE[child::text() = 'cifsmount']") 

        if ($GuestExchangeItemXml -ne $null) 
        { 
           $GuestExchangeItemXml.SelectSingleNode(` 
            "/INSTANCE/PROPERTY[@NAME='Data']/VALUE/child::text()").Value 
        }    
    } 

any hints?

lsof | grep hyper only returns the hv_kvp_daemon … which may be the reason the mounts fail.

If somebody from Docker would give me some hints I’d be able to help troubleshoot this issue a lot more… your choice

Hi Vincent

apologies for not replying earlier…I was going to, when I first saw this but then forgot.

Your excellent blog is indeed correct in the way we trigger the mounts. We modified the hv_kvp_daemon to issue the mount command. You can take a look at the source code which is inside the VM under /usr/share/src/hvtools.tar.gz in the latest Beta. The modifications also make sure that the key is actually not stored in the VM (and with the latest Beta is also removed from the host side copy).

As for your issue, it is indeed strange that the mount works if you issue it manually. Did you also have to manually share the drive on windows or did that work for you?

Are you joined in a domain (I think I read somewhere else that you were) and if so, are you exporting the share via <domain>\<username>? I assume you do, but just wanted to check. Also, does either your domain or your username contain spaces?

In the Linux VM, could you look at the /var/log/messages and see if there is an error? grep KVP /var/log/messages should give you all the logs from the KVP daemon.

Thanks
Rolf

Hi, I was traveling for the last few days and just saw your awesome reply.

I will investigate this further over the weekend, just wanted to say I love the technical details here and I’ll definitely troubleshoot it more.

My laptop is on a domain (without spaces in its name) but I created a local user (user part of laptop, not part of domain, also without spaces). The share is shared to this local user. If I mount -t cifs <computername>\<user> it works, if I omit the computername it fails (because the user is scoped to the computer). neither domain-name, computername or any of the usernames contains spaces (domainname uses a dot between last and firstname though)

I will grep the logs for more details, thanks!