Go Premium for a chance to win a PS4. Enter to Win


Shared folder between hypervisor host, and ubuntu guest

Posted on 2013-05-28
Medium Priority
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 124
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?
2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

LVL 124
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 124

Accepted Solution

Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 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 124
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 124
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 124
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 124
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 124
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 124
ID: 39206320
No problems, Glad to assist.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If your vDisk VHD file gets deleted from the image store accidentally or on purpose, you won't be able to remove the vDisk from the PVS console. There is a known workaround that is solid.
Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

824 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