Shared folder between hypervisor host, and ubuntu guest

Posted on 2013-05-28
Last Modified: 2013-05-29
I have a windows 2012 server that is running HyperVisor.  I have a number of VM's on the host.  I am trying to get an Ubuntu 12.04-64bit server install to be able to share a folder with either a network drive, as I have seen done here, and there, or the Host machine itself.  In a perfect world there is an easy way to get a file/folder/partition to be shared to the hosted ubuntu server, that can then be mounted, and accessible to the ubuntu server.  

Going through a network drive is an acceptable answer, but not entirely sure how to get it to mount on bootup of the ubuntu device, and if they can even talk to each other, or if other packages need to be installed.
Question by:Illyankesh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 9
LVL 121
ID: 39203672
Shared Folders is a feature of VMware Workstation, VMware Player and Oracle Virtualbox.

Shared Folders is not a feature of Corporate Hypervisors, such as VMware vSphere of Microsoft Hyper-V.

You would have to use normal networking shares and features, e.g. SMB/SAMBA shares.

Author Comment

ID: 39205557
Figured as much.

So moving forward I install samba onto the linux server

sudo apt-get install smbclient smbfs

That completed successfully, but now I cannot grep for samba, smbd, and cannot start the service, or restart it.  I have rebooted the machine, and tried

sudo service smbd start, stop, restart... and I get unrecognized service.

also, /etc/init.d/samba start, stop, restart also fails...

Author Comment

ID: 39205592
Not sure about the above problem...

But moved forward trying to mount the shared folder.   I created the shared folder on the windows server, and opened up the samba ports in the windows firewall 445, 139 both directions.

sudo mkdir /media/example

Now I run

sudo mount -t cifs -o username=dood,password=test123 //servername/folder /media/example
could not resolve address fo server unknown error

Its a windows folder so I changed the hash

sudo mount -t cifs -o username=dood,password=test123 \\servername\folder /media/example
 and now I get
and I get bad UNC (\servername\folder)

Silly question.
Should the user I am attempting to connect as also have an account on the windows machine that is then allowed to share/access that shared folder/file?
What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

LVL 121
ID: 39205609
Yes! The user must have share and security permissions.

Author Comment

ID: 39205733
Alright created user on windows with password, and gave that user Read/Write permissions to the desired shared folder.  I made the username password change to reflect the user I had added, and ran the command again.

I am still getting the bad UNC (\SERVERnamesharedfolder)  does there need to be an ip address in there?

I am trying to mount the shared windows folder onto the ubuntu server

I do not have active directory setup as that will cause all kinds of havoc, I do have a workgroup setup though...

Author Comment

ID: 39205750
If I attempt manual connection/listing I get...

smbclient -L workgroup -U user

Connection to workgroup failed (error_status_bad_network_name)

if I run

sudo smbclient -L workgroup -U user....     I get....

Unable to create directory /var/run/samba for file gencache.tdb.   Error wa no such file or directory  Connection to workgroup failed (Error NT_status_bad_network_name)
LVL 121

Accepted Solution

Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 total points
ID: 39205751
You can use an IP Address for testing, if your Ubuntu Server is not setup for DNS or WINs, and cannot resolve Windows Machine Names.

UNC is usually

\\<servername>\<folder share>


\\<ip address>\<folder share>

Author Comment

ID: 39205780
smbclient \\\folder user%password     gave me
session setup failed: NT_STATUS_LOGON_FAILURE

smbclient // user%password   gave me  Not enough \ characters in service

sudo mount -t cifs -o username=guy,password=thing \\\folder /media/folder
gave me bad UNC (\


sudo mount -t cifs -o username=guy,password=thing // /media/folder
returned with
[ 4331.893170 ] CIFS VFS: default security mechanism requested.  The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3

LVL 121
ID: 39205824
yes, definately progress, username or password incorrect in first instance. (but you are getting a challenge response).

second error, is your client does not support ntlm2

Author Comment

ID: 39205840
aha, ok so the username password is that of the username of the ubuntu user, or the windows user that has access to the shared folder?   I tried the username that has access to the shared folder... I will try again incase of typos.

ntlm2 ?  I will look that up.   Some sort of apt-get-able package?

Author Comment

ID: 39205853
Do I also need to have Winbindd running?
LVL 121
ID: 39205854
Windows user.

NTLM is the NT Lan Manager Authentication Protocol that Windows speaks, but Linux does not!

NTLMv2 is v2 of NT Lan Manager Authentication Protocol

Author Comment

ID: 39205928
Looks like username/password was incorrect.

I changed password and I got a could not connect resource busy.

But I was able to nano a file called test, write, and save test (using sudo) and see it in the windows shared folder

So I still need to upgrade to NTLMv2, for compatibility issues in the future correct?
LVL 121
ID: 39205972
It's best to use the same NTLM as the Server, in this case Windows that's file serving.

Author Comment

ID: 39205981
silly question number 852-b, where would I check that on the windows server?
LVL 121
ID: 39205994
I do not understand?

is that the name of your server?

Author Comment

ID: 39206013
no, no no, that was me be snarky at myself for asking questions
LVL 121
ID: 39206020
No Problems, Asking questions on EE, that's what it's for.

Without asking questions nobody learns, a long time ago, I had to ask many questions!!!

and somedays, still need to ask questions! always learning!

Author Comment

ID: 39206095
So first half ;) success... awesome...  
May have to open another question.

Author Closing Comment

ID: 39206107
Thank you for helping me, and not just sending me a link, and telling me to figure it out on my own.  I really appreciate it.  I learn best that way.  

So in this case the main question has been answered.  I will open another question that involves the same topic, but with a few necessary specifics.

aka mounting samba share on boot, and the creating of a linux user that has read & write permissions to that folder
LVL 121
ID: 39206320
No problems, Glad to assist.

Featured Post

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question