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
  • 12
  • 9
LVL 118
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?
LVL 118
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 118

Accepted Solution

Andrew Hancock (VMware vExpert / EE MVE) 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 118
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?
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Author Comment

ID: 39205853
Do I also need to have Winbindd running?
LVL 118
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 118
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 118
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 118
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 118
ID: 39206320
No problems, Glad to assist.

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
In this Micro Tutorial viewers will learn how they can get their files copied out from their unbootable system without need to use recovery services. As an example non-bootable Windows 2012R2 installation is used which has boot problems.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now